Fix build on older glibc versions.

_POSIX_C_SOURCE is necessary for getopt(3), and _DEFAULT_SOURCE is
necessary for the d_type enumerations in struct dirent.

Since we are here, use the C11 standard explicitly.

These fixes only allow us to build with glibc>=2.28, which is when the
<threads.h> header was added [1], necessary to access the thread_local
macro.

[1] https://stackoverflow.com/a/22875599
This commit is contained in:
Érico Nogueira 2023-07-26 10:12:29 -03:00
parent e56abc9ff9
commit 90693c6d04
1 changed files with 1 additions and 1 deletions

View File

@ -1,5 +1,5 @@
OPT = -O2
CFLAGS = -Wall -Wextra $(OPT)
CFLAGS = -std=c11 -D_POSIX_C_SOURCE=200809UL -D_DEFAULT_SOURCE -Wall -Wextra $(OPT)
.PHONY: all