aboutsummaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorMosder <git@mosder.eu>2026-10-08 14:37:05 +0200
committerMosder <git@mosder.eu>2026-10-08 14:37:05 +0200
commit634f254d282f119de7eeef22325045bffb5b1cf1 (patch)
tree96f659aa0d41ff797a8b7721b8fb25f55669f60e /compat
parent81330972640629b905fbc3d10ffc3e53361479b5 (diff)
feat: added feature test macros for different OSes / libc's
Diffstat (limited to 'compat')
-rw-r--r--compat/compat.h7
1 files changed, 6 insertions, 1 deletions
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;