summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeCCompilerId.c.in
diff options
context:
space:
mode:
authorPaweł Stankowski <aambitny@gmail.com>2016-03-20 09:42:19 (GMT)
committerBrad King <brad.king@kitware.com>2016-03-21 14:51:50 (GMT)
commit53c0dc2dd2216b7927787e6d819a9a734be2c0eb (patch)
tree0c84d992128fba6794d04a613c648e503552874f /Modules/CMakeCCompilerId.c.in
parenta9cb00cd50b518656053a5da4147a7106a8bfa78 (diff)
downloadCMake-53c0dc2dd2216b7927787e6d819a9a734be2c0eb.zip
CMake-53c0dc2dd2216b7927787e6d819a9a734be2c0eb.tar.gz
CMake-53c0dc2dd2216b7927787e6d819a9a734be2c0eb.tar.bz2
Add support for Bruce C Compiler (BCC)
Revise C compiler detection code to be K&R compatible.
Diffstat (limited to 'Modules/CMakeCCompilerId.c.in')
-rw-r--r--Modules/CMakeCCompilerId.c.in22
1 files changed, 16 insertions, 6 deletions
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index 5bfe0fd..c107dfd 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -5,6 +5,11 @@
#if defined(__18CXX)
# define ID_VOID_MAIN
#endif
+#if defined(__CLASSIC_C__)
+/* cv-qualifiers did not exist in K&R C */
+# define const
+# define volatile
+#endif
@CMAKE_C_COMPILER_ID_CONTENT@
@@ -28,23 +33,28 @@ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
@CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@
@CMAKE_C_COMPILER_ID_ERROR_FOR_TEST@
-const char* info_language_dialect_default = "INFO" ":" "dialect_default["
-#if !defined(__STDC_VERSION__)
- "90"
+#if !defined(__STDC__)
+# define C_DIALECT
#elif __STDC_VERSION__ >= 201000L
- "11"
+# define C_DIALECT "11"
#elif __STDC_VERSION__ >= 199901L
- "99"
+# define C_DIALECT "99"
#else
+# define C_DIALECT "90"
#endif
-"]";
+const char* info_language_dialect_default =
+ "INFO" ":" "dialect_default[" C_DIALECT "]";
/*--------------------------------------------------------------------------*/
#ifdef ID_VOID_MAIN
void main() {}
#else
+# if defined(__CLASSIC_C__)
+int main(argc, argv) int argc; char *argv[];
+# else
int main(int argc, char* argv[])
+# endif
{
int require = 0;
require += info_compiler[argc];