set(CMAKE_MACOSX_RPATH 1)
-# If not specified on the command line, enable C99 as the default
+# If not specified on the command line, enable C11 as the default
# Configuration items that affect the global compiler environment standards
# should be issued before the "project" command.
if(NOT CMAKE_C_STANDARD)
- set(CMAKE_C_STANDARD 99) # The C standard whose features are requested to build this target
+ set(CMAKE_C_STANDARD 11) # The C standard whose features are requested to build this target
endif()
if(NOT CMAKE_C_STANDARD_REQUIRED)
set(CMAKE_C_STANDARD_REQUIRED ON) # Boolean describing whether the value of C_STANDARD is a requirement
endif()
set(VALID_C_STANDARDS "99" "11")
if(NOT CMAKE_C_STANDARD IN_LIST VALID_C_STANDARDS)
- MESSAGE(FATAL_ERROR "CMAKE_C_STANDARD:STRING=${CMAKE_C_STANDARD} not in know standards list\n ${VALID_C_STANDARDS}")
+ MESSAGE(FATAL_ERROR "CMAKE_C_STANDARD:STRING=${CMAKE_C_STANDARD} not in known standards list\n ${VALID_C_STANDARDS}")
endif()
# Parse the full version number from zlib.h and include in ZLIB_FULL_VERSION
* Zlib compatible API with support for dual-linking
* Modernized native API based on zlib API for ease of porting
-* Modern C99 syntax and a clean code layout
+* Modern C11 syntax and a clean code layout
* Deflate medium and quick algorithms based on Intels zlib fork
* Support for CPU intrinsics when available
* Adler32 implementation using SSSE3, AVX2, Neon & VSX
if test "$gcc" -eq 1 && ($cc $CFLAGS -c $test.c) >> configure.log 2>&1; then
echo "$cc" | tee -a configure.log
CC="$cc"
- CFLAGS="${CFLAGS} -std=c99"
+ CFLAGS="${CFLAGS} -std=c11"
# Re-check ARCH if the compiler is a cross-compiler.
if $CC -print-multiarch 1> /dev/null 2>&1 && test -n "$($CC -print-multiarch)" 1> /dev/null 2>&1; then
#ifndef _ZBUILD_H
#define _ZBUILD_H
+/* Determine compiler version of C Standard */
+#ifdef __STDC_VERSION__
+# if __STDC_VERSION__ >= 199901L
+# ifndef STDC99
+# define STDC99
+# endif
+# endif
+# if __STDC_VERSION__ >= 201112L
+# ifndef STDC11
+# define STDC11
+# endif
+# endif
+#endif
+
/* This has to be first include that defines any types */
#if defined(_MSC_VER)
# if defined(_WIN64)
# define _WIN32
#endif
-#ifdef __STDC_VERSION__
-# if __STDC_VERSION__ >= 199901L
-# ifndef STDC99
-# define STDC99
-# endif
-# endif
-#endif
-
/* Clang macro for detecting declspec support
* https://clang.llvm.org/docs/LanguageExtensions.html#has-declspec-attribute
*/
# define _WIN32
#endif
-#ifdef __STDC_VERSION__
-# if __STDC_VERSION__ >= 199901L
-# ifndef STDC99
-# define STDC99
-# endif
-# endif
-#endif
-
/* Clang macro for detecting declspec support
* https://clang.llvm.org/docs/LanguageExtensions.html#has-declspec-attribute
*/