From e961968230ef9656870099b75ce61f5a340c5b06 Mon Sep 17 00:00:00 2001 From: millert <> Date: Sun, 29 Oct 2023 14:26:13 +0000 Subject: Enable ISO C11 APIs when building libc, even with an older compiler. Otherwise, the prototypes for timespec_get() and aligned_alloc() are not visible. OK guenther@ --- src/lib/libc/include/namespace.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lib/libc/include/namespace.h b/src/lib/libc/include/namespace.h index b42c00e4a1..8503de47be 100644 --- a/src/lib/libc/include/namespace.h +++ b/src/lib/libc/include/namespace.h @@ -1,4 +1,4 @@ -/* $OpenBSD: namespace.h,v 1.15 2019/11/25 22:57:28 guenther Exp $ */ +/* $OpenBSD: namespace.h,v 1.16 2023/10/29 14:26:13 millert Exp $ */ #ifndef _LIBC_NAMESPACE_H_ #define _LIBC_NAMESPACE_H_ @@ -19,6 +19,14 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +/* + * ISO C11 or higher is required to build libc. + * This must come _before_ sys/cdefs.h is included. + */ +#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112 +#define _ISOC11_SOURCE 1 +#endif + /* * For explanations of how to use these, see README * For explanations of why we use them and how they work, see DETAILS -- cgit v1.2.3-55-g6feb