mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Jens Gustedt <Jens.Gustedt@inria.fr>
To: musl@lists.openwall.com
Subject: [musl] [C23 scanf 2/3] C23: add the SCNb macros
Date: Wed, 31 May 2023 16:05:42 +0200	[thread overview]
Message-ID: <98097dad6143e2b487c8e20bbe2c17ddace3912d.1685536319.git.Jens.Gustedt@inria.fr> (raw)
In-Reply-To: <cover.1685536319.git.Jens.Gustedt@inria.fr>

---
 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


  parent reply	other threads:[~2023-05-31 14:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1685536319.git.Jens.Gustedt@inria.fr>
2023-05-31 14:05 ` [musl] [C23 scanf 1/3] C23: Add the b specifier for scanf and allow 0b and 0B prefixes in integers Jens Gustedt
2023-05-31 14:05 ` Jens Gustedt [this message]
2023-05-31 14:05 ` [musl] [C23 scanf 3/3] C23: implement wN and wfN specifiers for scanf functions Jens Gustedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=98097dad6143e2b487c8e20bbe2c17ddace3912d.1685536319.git.Jens.Gustedt@inria.fr \
    --to=jens.gustedt@inria.fr \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).