(macOS) The Metal project compiles C as gnu99, like the iOS one

The macOS build fails on IFF_UP being undeclared in net_ifinfo.c,
twice, with net/if.h included right above it.

Strict C99 is why. Darwin defines _POSIX_C_SOURCE for it and hides the
BSD names behind __DARWIN_C_FULL - IFF_UP among them - and this
project was the only Apple one still asking for c99 while
RetroArch_iOS13 already builds C as gnu99 and gnu17. That is also why
iOS did not fail here and macOS did.

Both configurations in the Metal project now say gnu99, which is what
the rest of the tree builds with. Demonstrated rather than assumed: a
file including net/if.h and printing IFF_UP does not compile under
-std=c99 and does under -std=gnu99, on a plain POSIX host.

This is the same root cause as the RTLD_DEFAULT failure fixed a few
commits ago, from the other side. That one is a local #ifndef and
stays - it defers to the platform where the platform provides the
symbol, so it costs nothing now that the namespace is open, and it
keeps that file building if a target ever tightens again.

No other Apple project asks for c99, checked.
This commit is contained in:
LibretroAdmin authored and libretroadmin committed 2026-09-14 01:26:36 +02:00
1 parent 7ce13980e9
commit d026a0cca0
1 file changed
+2 -2
@@ -1860,7 +1860,7 @@
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_MODEL_TUNING = G5;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
@@ -1940,7 +1940,7 @@
DEVELOPMENT_TEAM = UK699V5ZS8;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_MODEL_TUNING = G5;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 3;