aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-02-14 00:47:43 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-02-14 00:47:43 +0100
commite38017f8ce131d8cffbd56ac3d2b5cba6091abe5 (patch)
treef0a0cfe17f08f41d32b202dc058954d474248932
parentc567757f537c08a02e9cc2b457c27c8a5b4438a8 (diff)
Define _GNU_SOURCE when using Glibc
-rw-r--r--make.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/make.c b/make.c
index 0a97ff0..2008b21 100644
--- a/make.c
+++ b/make.c
@@ -9,6 +9,10 @@
#include <stdlib.h>
#include <string.h>
+#if __has_include(<features.h>)
+# include <features.h>
+#endif
+
#include "cbs.h"
#define WARN \
@@ -17,8 +21,12 @@
"-Wno-parentheses", /* if (x = foo()) */ \
"-Wno-pointer-sign" /* char ↔ char8_t */
-#define CC "cc"
-#define CFLAGS WARN, "-std=c2x"
+#define CC "cc"
+#ifdef __GNUC__
+# define CFLAGS WARN, "-std=c2x", "-D_GNU_SOURCE"
+#else
+# define CFLAGS WARN, "-std=c2x"
+#endif
#define CFLAGS_DBG CFLAGS, "-Og", "-ggdb3", "-DDEBUG=1"
#ifdef __APPLE__
# define CFLAGS_RLS CFLAGS, "-O3"