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).
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