]> granicus.if.org Git - nethack/commitdiff
expand C99=1 with macOS.370 and linux.370 hints
authornhmall <nhmall@nethack.org>
Sat, 18 Feb 2023 16:35:40 +0000 (11:35 -0500)
committernhmall <nhmall@nethack.org>
Sat, 18 Feb 2023 16:35:40 +0000 (11:35 -0500)
In addition to C99=1 on the make command line, also allow
C89=1 or C11=1 or C23=1.

NOTE: Those won't all lead to a successful build of NetHack,
and the use of C23=1 (-std=c2x) will only be valid on recent
compiler versions (clang-15, for one, accepts it).

sys/unix/hints/include/compiler.370

index 0c1233bcc87b4a909e05578c240a29030798f367..fe4b3ed0da9b45995c396b920c2ed15955ebe12f 100755 (executable)
@@ -151,15 +151,36 @@ CXX=$(CCXX)
 endif  # CPLUSPLUS_NEEDED
 endif   # MAKEFILE_SRC
 
+ifeq "$(c89)" "1"
+HAVECSTD=c89
+endif
+ifeq "$(C89)" "1"
+HAVECSTD=c89
+endif
+
 ifeq "$(c99)" "1"
-WANT_C99=1
+HAVECSTD=c99
 endif
 ifeq "$(C99)" "1"
-WANT_C99=1
+HAVECSTD=c99
+endif
+
+ifeq "$(c11)" "1"
+HAVECSTD=c11
+endif
+ifeq "$(C11)" "1"
+HAVECSTD=c11
+endif
+
+ifeq "$(c23)" "1"
+HAVECSTD=c2x
+endif
+ifeq "$(C23)" "1"
+HAVECSTD=c2x
 endif
 
-ifeq "$(WANT_C99)" "1"
-CSTD = -std=c99
+ifneq "$(HAVECSTD)" ""
+CSTD = -std=$(HAVECSTD)
 endif
 
 #end of compiler.370