Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <b0f8440792873e0066b2a94761caa335a8fbfe70.1684932861.git.Jens.Gustedt@inria.fr>
Date: Wed, 19 Apr 2023 10:16:33 +0200
From: Jens Gustedt <Jens.Gustedt@...ia.fr>
To: musl@...ts.openwall.com
Subject: [C23 divers headers 09/17] C23: update stdbool.h

C23 has false, true and bool as keywords, so this file is basically
not needed for modern applications. It is only provided for backwards
compatibility. Implementations may also provide macros in addition to
the keywords, so we do that because some user code may rely on these.
---
 include/stdbool.h | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/include/stdbool.h b/include/stdbool.h
index a9d7ab78..d9df7524 100644
--- a/include/stdbool.h
+++ b/include/stdbool.h
@@ -1,11 +1,17 @@
-#ifndef _STDBOOL_H
-#define _STDBOOL_H
+#ifndef __STDC_VERSION_STDBOOL_H__
+#define __STDC_VERSION_STDBOOL_H__ 202311L
 
 #ifndef __cplusplus
 
+#if __STDC_VERSION__ >= 202311L
+#define true true
+#define false false
+#define bool bool
+#else
 #define true 1
 #define false 0
 #define bool _Bool
+#endif
 
 #endif
 
-- 
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.