aboutsummaryrefslogtreecommitdiff
path: root/make.c
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-01-20 19:32:48 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-01-20 19:32:48 +0100
commit99941fbee8af208a48db6d84616f1696e0852527 (patch)
treed9cdffacef05b3bf713e0bd88e937d1a604be9a6 /make.c
parent3587466302bb41cc0599356d88d998ba70d494db (diff)
Define _POSIX_C_SOURCE on Glibc
You sometimes need this for getsubopt()
Diffstat (limited to 'make.c')
-rw-r--r--make.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/make.c b/make.c
index ed6f8a3..4e854dc 100644
--- a/make.c
+++ b/make.c
@@ -6,6 +6,14 @@
#include <string.h>
#include <unistd.h>
+#if defined(__has_include) && __has_include(<features.h>)
+# include <features.h>
+#endif
+
+#ifdef __GLIBC__
+# define _POSIX_C_SOURCE 200809L
+#endif
+
#include "cbs.h"
#include "src/compat.h"
@@ -93,6 +101,9 @@ main(int argc, char **argv)
buf[sizeof(buf) - 2] = i + '0';
cmdaddv(&c, sv.buf, sv.len);
+#ifdef __GLIBC__
+ cmdadd(&c, "-D_POSIX_C_SOURCE=200809L");
+#endif
cmdadd(&c, buf);
if (!Pflag) {
struct strv pc = {0};