From 634f254d282f119de7eeef22325045bffb5b1cf1 Mon Sep 17 00:00:00 2001 From: Mosder Date: Thu, 8 Oct 2026 14:37:05 +0200 Subject: feat: added feature test macros for different OSes / libc's --- compat/compat.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'compat') diff --git a/compat/compat.h b/compat/compat.h index 8a7ef4a..0279eda 100644 --- a/compat/compat.h +++ b/compat/compat.h @@ -4,7 +4,12 @@ #ifndef MOSLIB_COMPAT_H #define MOSLIB_COMPAT_H -#define _GNU_SOURCE +#define _GNU_SOURCE 1 // glibc, musl, Bionic, Cygwin +#define _ALL_SOURCE 1 // AIX, z/OS, musl +#define _DARWIN_C_SOURCE 1 // macOS +#define _NETBSD_SOURCE 1 // NetBSD +#define _OPENBSD_SOURCE 1 // OpenBSD +#define __EXTENSIONS__ 1 // Solaris // In C99 TU needs a declaration (which won't be the case if all functions are available) typedef void mos_compat_decl; -- cgit v1.2.3