Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <98097dad6143e2b487c8e20bbe2c17ddace3912d.1685536319.git.Jens.Gustedt@inria.fr>
Date: Wed, 31 May 2023 16:05:42 +0200
From: Jens Gustedt <Jens.Gustedt@...ia.fr>
To: musl@...ts.openwall.com
Subject: [C23 scanf 2/3] C23: add the SCNb macros

---
 include/inttypes.h | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/include/inttypes.h b/include/inttypes.h
index 73a42e32..780c2bb0 100644
--- a/include/inttypes.h
+++ b/include/inttypes.h
@@ -1,5 +1,5 @@
-#ifndef _INTTYPES_H
-#define _INTTYPES_H
+#ifndef __STDC_VERSION_INTTYPES_H__
+#define __STDC_VERSION_INTTYPES_H__ 201711L
 
 #ifdef __cplusplus
 extern "C" {
@@ -228,6 +228,21 @@ uintmax_t wcstoumax(const wchar_t *__restrict, wchar_t **__restrict, int);
 #define SCNoFAST32 "o"
 #define SCNoFAST64 __PRI64 "o"
 
+#define SCNb8   "hhb"
+#define SCNb16  "hb"
+#define SCNb32  "b"
+#define SCNb64  __PRI64 "b"
+
+#define SCNbLEAST8  "hhb"
+#define SCNbLEAST16 "hb"
+#define SCNbLEAST32 "b"
+#define SCNbLEAST64 __PRI64 "b"
+
+#define SCNbFAST8  "hhb"
+#define SCNbFAST16 "b"
+#define SCNbFAST32 "b"
+#define SCNbFAST64 __PRI64 "b"
+
 #define SCNx8   "hhx"
 #define SCNx16  "hx"
 #define SCNx32  "x"
@@ -243,12 +258,14 @@ uintmax_t wcstoumax(const wchar_t *__restrict, wchar_t **__restrict, int);
 #define SCNxFAST32 "x"
 #define SCNxFAST64 __PRI64 "x"
 
+#define SCNbMAX __PRI64 "b"
 #define SCNdMAX __PRI64 "d"
 #define SCNiMAX __PRI64 "i"
 #define SCNoMAX __PRI64 "o"
 #define SCNuMAX __PRI64 "u"
 #define SCNxMAX __PRI64 "x"
 
+#define SCNbPTR __PRIPTR "b"
 #define SCNdPTR __PRIPTR "d"
 #define SCNiPTR __PRIPTR "i"
 #define SCNoPTR __PRIPTR "o"
-- 
2.34.1

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.