libc: Fix C23 version macro visibility

In headers that existed prior to C23, these should be visible only in
C23 or BSD mode.

Fixes:		0fe73dcf7c ("libc: Add <assert.h> C23 feature test macro")
Fixes:		1f09e35429 ("sys/limits.h: Add BOOL_MAX, BITINT_MAXWIDTH, and C23 feature test macro")
Fixes:		cd0727ec70 ("libc: Add <stdio.h> C23 feature test macro")
Fixes:		fc9d02cb29 ("libc: Add <time.h> C23 feature test macro")
Fixes:		4aeed6e9d2 ("libc: Add <setjmp.h> C23 feature test macro")
Reviewed by:	fuz, kfv, dteske
Differential Revision:	https://reviews.freebsd.org/D59272
This commit is contained in:
Dag-Erling Smørgrav committed 2026-08-30 19:56:51 +02:00
1 parent b5dcd8f9d6
commit 5076e9b546
6 files changed
+22 -10

No files matched your search

+2
View File
@@ -71,7 +71,9 @@
#ifndef _ASSERT_H_
#define _ASSERT_H_
#if __ISO_C_VISIBLE >= 2023 || __BSD_VISIBLE
#define __STDC_VERSION_ASSERT_H__ 202311L
#endif
/*
* Static assertions. In principle we could define static_assert for
+4 -2
View File
@@ -32,10 +32,12 @@
#ifndef _LIMITS_H_
#define _LIMITS_H_
#define __STDC_VERSION_LIMITS_H__ 202311L
#include <sys/cdefs.h>
#if __ISO_C_VISIBLE >= 2023 || __BSD_VISIBLE
#define __STDC_VERSION_LIMITS_H__ 202311L
#endif
#if __POSIX_VISIBLE
#define _POSIX_ARG_MAX 4096
#define _POSIX_LINK_MAX 8
+4 -2
View File
@@ -37,10 +37,12 @@
#ifndef _SETJMP_H_
#define _SETJMP_H_
#define __STDC_VERSION_SETJMP_H__ 202311L
#include <sys/cdefs.h>
#if __ISO_C_VISIBLE >= 2023 || __BSD_VISIBLE
#define __STDC_VERSION_SETJMP_H__ 202311L
#endif
/* The size of the jmp_buf is machine dependent: */
#include <machine/setjmp.h>
+4 -2
View File
@@ -35,12 +35,14 @@
#ifndef _STDIO_H_
#define _STDIO_H_
#define __STDC_VERSION_STDIO_H__ 202311L
#include <sys/cdefs.h>
#include <sys/_null.h>
#include <sys/_types.h>
#if __ISO_C_VISIBLE >= 2023 || __BSD_VISIBLE
#define __STDC_VERSION_STDIO_H__ 202311L
#endif
__NULLABILITY_PRAGMA_PUSH
typedef __off_t fpos_t;
+4 -2
View File
@@ -37,13 +37,15 @@
#ifndef _TIME_H_
#define _TIME_H_
#define __STDC_VERSION_TIME_H__ 202311L
#include <sys/cdefs.h>
#include <sys/_null.h>
#include <sys/_types.h>
#include <sys/_clock_id.h>
#if __ISO_C_VISIBLE >= 2023 || __BSD_VISIBLE
#define __STDC_VERSION_TIME_H__ 202311L
#endif
#if __POSIX_VISIBLE > 0 && __POSIX_VISIBLE < 200112 || __BSD_VISIBLE
/*
* Frequency of the clock ticks reported by times(). Deprecated - use