From: nhmall Date: Sat, 18 Feb 2023 16:35:40 +0000 (-0500) Subject: expand C99=1 with macOS.370 and linux.370 hints X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=84390fa6008df4ead320979320194530501e16e3;p=nethack expand C99=1 with macOS.370 and linux.370 hints 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). --- diff --git a/sys/unix/hints/include/compiler.370 b/sys/unix/hints/include/compiler.370 index 0c1233bcc..fe4b3ed0d 100755 --- a/sys/unix/hints/include/compiler.370 +++ b/sys/unix/hints/include/compiler.370 @@ -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