Use std=gnu11 instead of std=c11. (#12253)

Adding this as it's required by the latest version of libmusl (but not
clear if it's a regression or an intentional change).
This commit is contained in:
Yossi Gottlieb 2023-06-05 12:11:30 +03:00 committed by GitHub
parent c2f1815bcb
commit 0bd1a3a4a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,10 +47,10 @@ OPT=$(OPTIMIZATION)
# NUMBER_SIGN_CHAR is a workaround to support both GNU Make 4.3 and older versions.
NUMBER_SIGN_CHAR := \#
C11_ATOMIC := $(shell sh -c 'echo "$(NUMBER_SIGN_CHAR)include <stdatomic.h>" > foo.c; \
$(CC) -std=c11 -c foo.c -o foo.o > /dev/null 2>&1; \
$(CC) -std=gnu11 -c foo.c -o foo.o > /dev/null 2>&1; \
if [ -f foo.o ]; then echo "yes"; rm foo.o; fi; rm foo.c')
ifeq ($(C11_ATOMIC),yes)
STD+=-std=c11
STD+=-std=gnu11
else
STD+=-std=c99
endif