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.
This commit is contained in:
Ben Barham
2024-01-26 11:19:32 -08:00
parent 6a97b58477
commit 8c5c74b2f1

View File

@@ -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 <stdarg.h>
#include <stdio.h>
#include <stdlib.h>