|
Message-Id: <db2f13e96b48fd2007ab6314a784f04e4ecf60cd.1685522953.git.Jens.Gustedt@inria.fr> Date: Wed, 31 May 2023 11:22:56 +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.