From 8c5c74b2f1a4e1a5f3e16c3ca18ae449faf65d96 Mon Sep 17 00:00:00 2001 From: Ben Barham Date: Fri, 26 Jan 2024 11:19:32 -0800 Subject: [PATCH] Add define for GNU glibc extensions `fdopen`, `strdup`, and `mkstemp` are all extensions. `_DEFAULT_SOURCE` should be enough for this, but apparently not on older glibcs. --- api_test/harness.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api_test/harness.c b/api_test/harness.c index 6b7336f97..f561aeace 100644 --- a/api_test/harness.c +++ b/api_test/harness.c @@ -1,4 +1,7 @@ -#define _DEFAULT_SOURCE +// _GNU_SOURCE is all ISO/POSIX/XOPEN/BSD/SVID + GNU extensions. It also sets +// _DEFAULT_SOURCE on newer glibc. We need this for strdup/snprintf/fdopen/etc. +#define _GNU_SOURCE + #include #include #include