summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeCCompilerId.c.in
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-04-15 20:06:41 (GMT)
committerBrad King <brad.king@kitware.com>2016-04-28 13:08:35 (GMT)
commit7f401ae43fafed8258659f2da204bc818fd693d3 (patch)
tree5fc59f44567fe0b85713ecbb36dc00ff609be4b2 /Modules/CMakeCCompilerId.c.in
parentfa4ae9fb12b61473f028a3ec38433f82a030c578 (diff)
downloadCMake-7f401ae43fafed8258659f2da204bc818fd693d3.zip
CMake-7f401ae43fafed8258659f2da204bc818fd693d3.tar.gz
CMake-7f401ae43fafed8258659f2da204bc818fd693d3.tar.bz2
Features: Detect C default dialect on MSVC-like compilers
These compilers default to C 90 but do not define __STDC__. While MSVC itself has no option to change the dialect, compilers that document compatibility with MSVC and define _MSC_VER may (e.g. Intel).
Diffstat (limited to 'Modules/CMakeCCompilerId.c.in')
-rw-r--r--Modules/CMakeCCompilerId.c.in6
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index c107dfd..95184c9 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -34,7 +34,11 @@ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
@CMAKE_C_COMPILER_ID_ERROR_FOR_TEST@
#if !defined(__STDC__)
-# define C_DIALECT
+# if defined(_MSC_VER) && !defined(__clang__)
+# define C_DIALECT "90"
+# else
+# define C_DIALECT
+# endif
#elif __STDC_VERSION__ >= 201000L
# define C_DIALECT "11"
#elif __STDC_VERSION__ >= 199901L