From 84390fa6008df4ead320979320194530501e16e3 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 18 Feb 2023 11:35:40 -0500 Subject: [PATCH] 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). --- sys/unix/hints/include/compiler.370 | 33 +++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) 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 "$(c99)" "1" -WANT_C99=1 +ifeq "$(c89)" "1" +HAVECSTD=c89 endif -ifeq "$(C99)" "1" -WANT_C99=1 +ifeq "$(C89)" "1" +HAVECSTD=c89 endif -ifeq "$(WANT_C99)" "1" -CSTD = -std=c99 +ifeq "$(c99)" "1" +HAVECSTD=c99 +endif +ifeq "$(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 + +ifneq "$(HAVECSTD)" "" +CSTD = -std=$(HAVECSTD) endif #end of compiler.370