Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jan 2026 14:02:46 +0000
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Cc:        Minsoo Choo <minsoochoo0122@proton.me>
Subject:   git: 5656d0f7453e - stable/15 - stdbool.h: Update for C23
Message-ID:  <69665086.a119.530f1a35@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/15 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=5656d0f7453e0c315e57a6ad28300dcabb04c2b3

commit 5656d0f7453e0c315e57a6ad28300dcabb04c2b3
Author:     Minsoo Choo <minsoochoo0122@proton.me>
AuthorDate: 2026-01-06 19:57:27 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2026-01-13 14:01:56 +0000

    stdbool.h: Update for C23
    
    When a compiler with C23 or higher is detected, builtin bool, true,
    and false are used to conform the C23 standard.
    
    Reviewed by:    imp
    Differential Revision: https://reviews.freebsd.org/D44664
    
    (cherry picked from commit f441a225c4eb56deff1edc2402fe85a0ae263ebd)
---
 include/stdbool.h | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/stdbool.h b/include/stdbool.h
index a03835ca6962..968967a4cfa6 100644
--- a/include/stdbool.h
+++ b/include/stdbool.h
@@ -26,15 +26,19 @@
  * SUCH DAMAGE.
  */
 
+#ifndef __STDC_VERSION_STDBOOL_H__
+#define __STDC_VERSION_STDBOOL_H__ 202311L
+
 #ifndef __bool_true_false_are_defined
 #define	__bool_true_false_are_defined	1
 
-#ifndef __cplusplus
+#if (__STDC_VERSION__ < 202311L) && !defined(__cplusplus)
 
 #define	false	0
 #define	true	1
 
 #define	bool	_Bool
 
-#endif /* !__cplusplus */
+#endif /* (__STDC_VERSION__ < 202311L) && !defined(__cplusplus) */
 #endif /* __bool_true_false_are_defined */
+#endif /* __STDC_VERSION_STDBOOL_H__ */


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69665086.a119.530f1a35>