libc: Restore prior C23 include guards

To avoid any sort of POLA violation, this commit restores old
guards and defines the C23 feature test macros in addition to
them.  This is to close off whole class of possible breakage,
rather than patching it case by case.

Reported by:	dim
Reviewed by:	dim, dteske, fuz
Approved by:	dim, dteske (mentor), fuz (mentor)
MFC after:	1 month
Differential Revision: https://reviews.freebsd.org/D58911
This commit is contained in:
Faraz Vahedi committed 2026-08-19 13:51:21 +03:30
1 parent 8109a5c0fb
commit 8d29d24296
11 files changed
+24 -22

No files matched your search

+5 -3
View File
@@ -68,8 +68,10 @@
#endif /* __BSD_VISIBLE */
#endif /* NDEBUG */
#ifndef __STDC_VERSION_ASSERT_H__
#define __STDC_VERSION_ASSERT_H__ 202311L
#ifndef _ASSERT_H_
#define _ASSERT_H_
#define __STDC_VERSION_ASSERT_H__ 202311L
/*
* Static assertions. In principle we could define static_assert for
@@ -92,4 +94,4 @@ __BEGIN_DECLS
void __assert(const char *, const char *, int, const char *) __dead2;
__END_DECLS
#endif /* !__STDC_VERSION_ASSERT_H__ */
#endif /* !_ASSERT_H_ */
+4 -2
View File
@@ -29,7 +29,9 @@
* SUCH DAMAGE.
*/
#ifndef __STDC_VERSION_LIMITS_H__
#ifndef _LIMITS_H_
#define _LIMITS_H_
#define __STDC_VERSION_LIMITS_H__ 202311L
#include <sys/cdefs.h>
@@ -148,4 +150,4 @@
#include <sys/syslimits.h>
#endif
#endif /* !__STDC_VERSION_LIMITS_H__ */
#endif /* !_LIMITS_H_ */
+1 -1
View File
@@ -332,7 +332,7 @@ __BEGIN_DECLS
extern void xdrmem_create(XDR *, char *, u_int, enum xdr_op);
/* XDR using stdio library */
#ifdef __STDC_VERSION_STDIO_H__
#ifdef _STDIO_H_
extern void xdrstdio_create(XDR *, FILE *, enum xdr_op);
#endif
+4 -2
View File
@@ -32,7 +32,9 @@
* SUCH DAMAGE.
*/
#ifndef __STDC_VERSION_STDIO_H__
#ifndef _STDIO_H_
#define _STDIO_H_
#define __STDC_VERSION_STDIO_H__ 202311L
#include <sys/cdefs.h>
@@ -540,4 +542,4 @@ extern int __isthreaded;
__END_DECLS
__NULLABILITY_PRAGMA_POP
#endif /* !__STDC_VERSION_STDIO_H__ */
#endif /* !_STDIO_H_ */
+1 -1
View File
@@ -68,7 +68,7 @@ __BEGIN_DECLS
#include <xlocale/_ctype.h>
#endif
#ifdef __STDC_VERSION_STDIO_H__
#ifdef _STDIO_H_
#include <xlocale/_stdio.h>
#endif