aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFaraz Vahedi <kfv@FreeBSD.org>2026-08-14 12:22:00 +0000
committerFaraz Vahedi <kfv@FreeBSD.org>2026-08-14 19:31:54 +0000
commitcd0727ec709bb54f8f82104f6113284a15dd3464 (patch)
treed0d6a2b06059261eb1f6461ed7380bc30f1af2c1
parent10d5a548596ce7c111ea4a463d3f7d5f0cb1ae4f (diff)
libc: Add <stdio.h> C23 feature test macro
Define the __STDC_VERSION_STDIO_H__ feature test macro now that the header fully conforms to C23. Reviewed by: fuz Approved by: fuz (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D58842
-rw-r--r--include/rpc/xdr.h2
-rw-r--r--include/stdio.h6
-rw-r--r--include/xlocale.h2
-rw-r--r--lib/libc/xdr/xdr.32
-rw-r--r--lib/libgeom/libgeom.h2
-rw-r--r--lib/libutil/libutil.h2
-rw-r--r--stand/libsa/geli/geliboot_internal.h8
7 files changed, 15 insertions, 9 deletions
diff --git a/include/rpc/xdr.h b/include/rpc/xdr.h
index 4c75bcc5bbf7..1b480ca0dd34 100644
--- a/include/rpc/xdr.h
+++ b/include/rpc/xdr.h
@@ -332,7 +332,7 @@ __BEGIN_DECLS
extern void xdrmem_create(XDR *, char *, u_int, enum xdr_op);
/* XDR using stdio library */
-#ifdef _STDIO_H_
+#ifdef __STDC_VERSION_STDIO_H__
extern void xdrstdio_create(XDR *, FILE *, enum xdr_op);
#endif
diff --git a/include/stdio.h b/include/stdio.h
index ea016d65095d..50e3ff2d1c34 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -32,8 +32,8 @@
* SUCH DAMAGE.
*/
-#ifndef _STDIO_H_
-#define _STDIO_H_
+#ifndef __STDC_VERSION_STDIO_H__
+#define __STDC_VERSION_STDIO_H__ 202311L
#include <sys/cdefs.h>
#include <sys/_null.h>
@@ -540,4 +540,4 @@ extern int __isthreaded;
__END_DECLS
__NULLABILITY_PRAGMA_POP
-#endif /* !_STDIO_H_ */
+#endif /* !__STDC_VERSION_STDIO_H__ */
diff --git a/include/xlocale.h b/include/xlocale.h
index cc2fc0839593..b1c83592a619 100644
--- a/include/xlocale.h
+++ b/include/xlocale.h
@@ -68,7 +68,7 @@ __BEGIN_DECLS
#include <xlocale/_ctype.h>
#endif
-#ifdef _STDIO_H_
+#ifdef __STDC_VERSION_STDIO_H__
#include <xlocale/_stdio.h>
#endif
diff --git a/lib/libc/xdr/xdr.3 b/lib/libc/xdr/xdr.3
index 65adb050fa44..5d81a867ad66 100644
--- a/lib/libc/xdr/xdr.3
+++ b/lib/libc/xdr/xdr.3
@@ -572,7 +572,7 @@ This routine returns the amount of memory required to encode
using filter
.Fa func .
.Pp
-.It Li "#ifdef _STDIO_H_"
+.It Li "#ifdef __STDC_VERSION_STDIO_H__"
.It Li "/* XDR using stdio library */"
.It Xo
.Ft void
diff --git a/lib/libgeom/libgeom.h b/lib/libgeom/libgeom.h
index 2116645bd496..713c49f0380c 100644
--- a/lib/libgeom/libgeom.h
+++ b/lib/libgeom/libgeom.h
@@ -143,7 +143,7 @@ void geom_deletetree(struct gmesh *);
struct gctl_req;
-#ifdef _STDIO_H_ /* limit #include pollution */
+#ifdef __STDC_VERSION_STDIO_H__ /* limit #include pollution */
void gctl_dump(struct gctl_req *, FILE *);
#endif
void gctl_free(struct gctl_req *);
diff --git a/lib/libutil/libutil.h b/lib/libutil/libutil.h
index 17e4f1fba247..679a213e64bf 100644
--- a/lib/libutil/libutil.h
+++ b/lib/libutil/libutil.h
@@ -151,7 +151,7 @@ int uu_lock_txfr(const char *_ttyname, pid_t _pid);
* Conditionally prototype the following functions if the include
* files upon which they depend have been included.
*/
-#ifdef _STDIO_H_
+#ifdef __STDC_VERSION_STDIO_H__
char *fparseln(FILE *_fp, size_t *_len, size_t *_lineno,
const char _delim[3], int _flags);
#endif
diff --git a/stand/libsa/geli/geliboot_internal.h b/stand/libsa/geli/geliboot_internal.h
index 50157f24c7f5..6b7b5742408e 100644
--- a/stand/libsa/geli/geliboot_internal.h
+++ b/stand/libsa/geli/geliboot_internal.h
@@ -28,9 +28,15 @@
#ifndef _GELIBOOT_INTERNAL_H_
#define _GELIBOOT_INTERNAL_H_
+/*
+ * XXX:
+ * The following deliberate defines are to keep g_eli.h from including
+ * unnecessary headers. It would be preferable to conditionally include
+ * them in a _STANDALONE branch there instead.
+ */
#define _STRING_H_
#define _STRINGS_H_
-#define _STDIO_H_
+#define __STDC_VERSION_STDIO_H__ 202311L
#include <sys/endian.h>
#include <sys/queue.h>