From 47e77d1bb01d4f08322571ac81215125bc5a2e29 Mon Sep 17 00:00:00 2001 From: iphydf Date: Wed, 22 Nov 2023 19:55:28 +0000 Subject: [PATCH] chore: Use C99 on MSVC instead of C11. The windows sdk has buggy headers in C11. --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e5cdd9f351..e663432263 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,7 +80,12 @@ enable_testing() set(CMAKE_MACOSX_RPATH ON) # Set standard version for compiler. -set(CMAKE_C_STANDARD 11) +if(MSVC) + # https://developercommunity.visualstudio.com/t/older-winsdk-headers-are-incompatible-with-zcprepr/1593479 + set(CMAKE_C_STANDARD 99) +else() + set(CMAKE_C_STANDARD 11) +endif() set(CMAKE_CXX_STANDARD 17) set(CMAKE_C_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)