diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-02-14 00:47:43 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-02-14 00:47:43 +0100 |
commit | e38017f8ce131d8cffbd56ac3d2b5cba6091abe5 (patch) | |
tree | f0a0cfe17f08f41d32b202dc058954d474248932 | |
parent | c567757f537c08a02e9cc2b457c27c8a5b4438a8 (diff) |
Define _GNU_SOURCE when using Glibc
-rw-r--r-- | make.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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" |