shithub: rgbds

Download patch

ref: b936ca27abf52b33fc4eba0c2d20692ce374a868
parent: e050803ed1acab5e378647d66c5da00f4f5fee09
author: ISSOtm <[email protected]>
date: Fri Apr 23 13:02:38 EDT 2021

Enable _ISOC11_SOURCE

See #789

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,6 +35,7 @@
   add_definitions(/D_CRT_SECURE_NO_WARNINGS)
 else()
   add_compile_options(-Wall -pedantic)
+  add_definitions(-D_POSIX_C_SOURCE=200809L -D_ISOC11_SOURCE)
   if(SANITIZERS)
     set(SAN_FLAGS -fsanitize=shift -fsanitize=integer-divide-by-zero
                   -fsanitize=unreachable -fsanitize=vla-bound
--- a/Makefile
+++ b/Makefile
@@ -35,8 +35,9 @@
 # Overridable CFLAGS
 CFLAGS		?= -O3 -flto -DNDEBUG
 # Non-overridable CFLAGS
-REALCFLAGS	:= ${CFLAGS} ${WARNFLAGS} -std=gnu11 -D_POSIX_C_SOURCE=200809L \
-		   -Iinclude
+# _ISOC11_SOURCE is required on certain platforms to get C11 on top of the C99-based POSIX 2008
+REALCFLAGS	:= ${CFLAGS} ${WARNFLAGS} -std=gnu11 -I include \
+		   -D_POSIX_C_SOURCE=200809L -D_ISOC11_SOURCE
 # Overridable LDFLAGS
 LDFLAGS		?=
 # Non-overridable LDFLAGS