[Cmake-commits] CMake branch, next, updated. v3.5.0-635-gac8c02a

Brad King brad.king at kitware.com
Wed Mar 23 16:01:51 EDT 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  ac8c02adc3ac2cb6596600af6d1f92e39eca99ab (commit)
       via  1fd339a32f194d946e873fc95be4d496b35f1df6 (commit)
      from  3fb51b5a58099c929e090d58b8765e881a3d901d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ac8c02adc3ac2cb6596600af6d1f92e39eca99ab
commit ac8c02adc3ac2cb6596600af6d1f92e39eca99ab
Merge: 3fb51b5 1fd339a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Mar 23 16:01:50 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Mar 23 16:01:50 2016 -0400

    Merge topic 'improve-K_R-C-support' into next
    
    1fd339a3 Revert topic 'improve-K_R-C-support'


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1fd339a32f194d946e873fc95be4d496b35f1df6
commit 1fd339a32f194d946e873fc95be4d496b35f1df6
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Mar 23 16:01:04 2016 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Mar 23 16:01:04 2016 -0400

    Revert topic 'improve-K_R-C-support'
    
    The __STDC__ macro is not defined by some Visual Studio compilers.

diff --git a/Modules/CMakeCCompilerABI.c b/Modules/CMakeCCompilerABI.c
index 405599e..e6a07f4 100644
--- a/Modules/CMakeCCompilerABI.c
+++ b/Modules/CMakeCCompilerABI.c
@@ -2,7 +2,7 @@
 # error "A C++ compiler has been selected for C."
 #endif
 
-#if !defined(__STDC__) || __STDC__ == 0
+#ifdef __CLASSIC_C__
 # define const
 #endif
 
@@ -12,7 +12,7 @@
 
 /*--------------------------------------------------------------------------*/
 
-#if !defined(__STDC__) || __STDC__ == 0
+#ifdef __CLASSIC_C__
 int main(argc, argv) int argc; char *argv[];
 #else
 int main(int argc, char *argv[])
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index 1ec9939..c107dfd 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -5,7 +5,7 @@
 #if defined(__18CXX)
 # define ID_VOID_MAIN
 #endif
-#if !defined(__STDC__) || __STDC__ == 0
+#if defined(__CLASSIC_C__)
 /* cv-qualifiers did not exist in K&R C */
 # define const
 # define volatile
@@ -33,7 +33,7 @@ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
 @CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@
 @CMAKE_C_COMPILER_ID_ERROR_FOR_TEST@
 
-#if !defined(__STDC__) || __STDC__ == 0
+#if !defined(__STDC__)
 # define C_DIALECT
 #elif __STDC_VERSION__ >= 201000L
 # define C_DIALECT "11"
@@ -50,7 +50,7 @@ const char* info_language_dialect_default =
 #ifdef ID_VOID_MAIN
 void main() {}
 #else
-# if !defined(__STDC__) || __STDC__ == 0
+# if defined(__CLASSIC_C__)
 int main(argc, argv) int argc; char *argv[];
 # else
 int main(int argc, char* argv[])
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index e0b5468..f8c6303 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -87,6 +87,9 @@ else()
 
     # Try enabling ANSI mode on HP.
     "-Aa"
+
+    # Try compiling K&R-compatible code (needed by Bruce C Compiler).
+    "-D__CLASSIC_C__"
     )
 endif()
 
diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake
index 0d1f43e..29a58bd 100644
--- a/Modules/CMakeTestCCompiler.cmake
+++ b/Modules/CMakeTestCCompiler.cmake
@@ -36,7 +36,7 @@ if(NOT CMAKE_C_COMPILER_WORKS)
     "#ifdef __cplusplus\n"
     "# error \"The CMAKE_C_COMPILER is set to a C++ compiler\"\n"
     "#endif\n"
-    "#if !defined(__STDC__) || __STDC__ == 0\n"
+    "#if defined(__CLASSIC_C__)\n"
     "int main(argc, argv)\n"
     "  int argc;\n"
     "  char* argv[];\n"
diff --git a/Modules/CheckForPthreads.c b/Modules/CheckForPthreads.c
index cddb2b1..344c81b 100644
--- a/Modules/CheckForPthreads.c
+++ b/Modules/CheckForPthreads.c
@@ -5,14 +5,13 @@
 void* runner(void*);
 
 int res = 0;
-#if !defined(__STDC__) || __STDC__ == 0
-int main(ac, av)
+#ifdef __CLASSIC_C__
+int main(){
   int ac;
   char*av[];
 #else
-int main(int ac, char*av[])
+int main(int ac, char*av[]){
 #endif
-{
   pthread_t tid[2];
   pthread_create(&tid[0], 0, runner, (void*)1);
   pthread_create(&tid[1], 0, runner, (void*)2);
diff --git a/Modules/CheckFunctionExists.c b/Modules/CheckFunctionExists.c
index 4805c6a..fd29618 100644
--- a/Modules/CheckFunctionExists.c
+++ b/Modules/CheckFunctionExists.c
@@ -4,14 +4,13 @@
 extern "C"
 #endif
 char CHECK_FUNCTION_EXISTS();
-#if !defined(__STDC__) || __STDC__ == 0
-int main(ac, av)
+#ifdef __CLASSIC_C__
+int main(){
   int ac;
   char*av[];
 #else
-int main(int ac, char*av[])
+int main(int ac, char*av[]){
 #endif
-{
   CHECK_FUNCTION_EXISTS();
   if(ac > 1000)
     {
diff --git a/Modules/CheckIncludeFile.c.in b/Modules/CheckIncludeFile.c.in
index de20e9a..ddfbee8 100644
--- a/Modules/CheckIncludeFile.c.in
+++ b/Modules/CheckIncludeFile.c.in
@@ -1,10 +1,13 @@
 #include <${CHECK_INCLUDE_FILE_VAR}>
 
-#if !defined(__STDC__) || __STDC__ == 0
+#ifdef __CLASSIC_C__
 int main()
+{
+  return 0;
+}
 #else
 int main(void)
-#endif
 {
   return 0;
 }
+#endif
diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake
index c0fe01a..843cd35 100644
--- a/Modules/CheckIncludeFiles.cmake
+++ b/Modules/CheckIncludeFiles.cmake
@@ -59,7 +59,7 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
         "${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n")
     endforeach()
     set(CMAKE_CONFIGURABLE_FILE_CONTENT
-      "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n\n#if !defined(__STDC__) || __STDC == 0\nint main()\n#else\n  int main(void)\n#endif\n  {return 0;}\n")
+      "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n\nint main(void){return 0;}\n")
     configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
       "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c" @ONLY)
 
diff --git a/Modules/CheckPrototypeDefinition.c.in b/Modules/CheckPrototypeDefinition.c.in
index 6a7f77d..a97344a 100644
--- a/Modules/CheckPrototypeDefinition.c.in
+++ b/Modules/CheckPrototypeDefinition.c.in
@@ -14,14 +14,13 @@ static void checkSymbol(void) {
   return @CHECK_PROTOTYPE_DEFINITION_RETURN@;
 }
 
-#if !defined(__STDC__) || __STDC__ == 0
-int main(ac , av)
+#ifdef __CLASSIC_C__
+int main() {
   int ac;
   char*av[];
 #else
-int main(int ac, char *av[])
+int main(int ac, char *av[]) {
 #endif
-{
   checkSymbol();
   if (ac > 1000) {
     return *av[0];
diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake
index cd91fce..c4dff3f 100644
--- a/Modules/CheckSymbolExists.cmake
+++ b/Modules/CheckSymbolExists.cmake
@@ -75,7 +75,7 @@ macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
         "${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n")
     endforeach()
     set(CMAKE_CONFIGURABLE_FILE_CONTENT
-      "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n#if !defined(__STDC__) || __STDC__ == 0\n  int main(argc, argv) int argc; char **argv;\n#else\n  int main(int argc, char** argv)\n#endif\n{\n  (void)argv;\n#ifndef ${SYMBOL}\n  return ((int*)(&${SYMBOL}))[argc];\n#else\n  (void)argc;\n  return 0;\n#endif\n}\n")
+      "${CMAKE_CONFIGURABLE_FILE_CONTENT}\nint main(int argc, char** argv)\n{\n  (void)argv;\n#ifndef ${SYMBOL}\n  return ((int*)(&${SYMBOL}))[argc];\n#else\n  (void)argc;\n  return 0;\n#endif\n}\n")
 
     configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
       "${SOURCEFILE}" @ONLY)
diff --git a/Modules/CheckTypeSize.c.in b/Modules/CheckTypeSize.c.in
index f42efd3..b6c3688 100644
--- a/Modules/CheckTypeSize.c.in
+++ b/Modules/CheckTypeSize.c.in
@@ -24,7 +24,7 @@ char info_size[] =  {'I', 'N', 'F', 'O', ':', 's','i','z','e','[',
 #endif
   '\0'};
 
-#if !defined(__STDC__) || __STDC__ == 0
+#ifdef __CLASSIC_C__
 int main(argc, argv) int argc; char *argv[];
 #else
 int main(int argc, char *argv[])
diff --git a/Modules/CheckVariableExists.c b/Modules/CheckVariableExists.c
index 7c3eb71..752f6e4 100644
--- a/Modules/CheckVariableExists.c
+++ b/Modules/CheckVariableExists.c
@@ -2,14 +2,13 @@
 
 extern int CHECK_VARIABLE_EXISTS;
 
-#if !defined(__STDC__) || __STDC__ == 0
-int main(ac, av)
+#ifdef __CLASSIC_C__
+int main(){
   int ac;
   char*av[];
 #else
-int main(int ac, char*av[])
+int main(int ac, char*av[]){
 #endif
-{
   if(ac > 1000){return *av[0];}
   return CHECK_VARIABLE_EXISTS;
 }
diff --git a/Modules/Compiler/Bruce-C.cmake b/Modules/Compiler/Bruce-C.cmake
index 387e27f..23676ec 100644
--- a/Modules/Compiler/Bruce-C.cmake
+++ b/Modules/Compiler/Bruce-C.cmake
@@ -1,6 +1,6 @@
 # Bruce C Compiler ignores "-g" flag and optimization cannot be
 # enabled here (it is implemented only for 8086 target).
-set (CMAKE_C_FLAGS_INIT "")
+set (CMAKE_C_FLAGS_INIT "-D__CLASSIC_C__")
 set (CMAKE_C_FLAGS_DEBUG_INIT "-g")
 set (CMAKE_C_FLAGS_MINSIZEREL_INIT "-DNDEBUG")
 set (CMAKE_C_FLAGS_RELEASE_INIT "-DNDEBUG")
diff --git a/Modules/TestEndianess.c.in b/Modules/TestEndianess.c.in
index b0cbbc6..c924f78 100644
--- a/Modules/TestEndianess.c.in
+++ b/Modules/TestEndianess.c.in
@@ -1,10 +1,6 @@
 /* A 16 bit integer is required. */
 typedef @CMAKE_16BIT_TYPE@ cmakeint16;
 
-#if !defined(__STDC__) || __STDC__ == 0
-# define const
-#endif
-
 /* On a little endian machine, these 16bit ints will give "THIS IS LITTLE ENDIAN."
    On a big endian machine the characters will be exchanged pairwise. */
 const cmakeint16 info_little[] =  {0x4854, 0x5349, 0x4920, 0x2053, 0x494c, 0x5454, 0x454c, 0x4520, 0x444e, 0x4149, 0x2e4e, 0x0000};
@@ -13,7 +9,7 @@ const cmakeint16 info_little[] =  {0x4854, 0x5349, 0x4920, 0x2053, 0x494c, 0x545
    On a little endian machine the characters will be exchanged pairwise. */
 const cmakeint16 info_big[] =     {0x5448, 0x4953, 0x2049, 0x5320, 0x4249, 0x4720, 0x454e, 0x4449, 0x414e, 0x2e2e, 0x0000};
 
-#if !defined(__STDC__) || __STDC__ == 0
+#ifdef __CLASSIC_C__
 int main(argc, argv) int argc; char *argv[];
 #else
 int main(int argc, char *argv[])
diff --git a/Tests/Assembler/main.c b/Tests/Assembler/main.c
index e88921e..95de0b5 100644
--- a/Tests/Assembler/main.c
+++ b/Tests/Assembler/main.c
@@ -1,13 +1,12 @@
 #include <stdio.h>
 
-#if !defined(__STDC__) || __STDC__ == 0
-int main(argc, argv)
+#ifdef __CLASSIC_C__
+int main(){
   int argc;
   char*argv[];
 #else
-int main(int argc, char*argv[])
+int main(int argc, char*argv[]){
 #endif
-{
   printf("hello assembler world, %d arguments  given\n", argc);
   return 0;
 }
diff --git a/Tests/MacroTest/CMakeLists.txt b/Tests/MacroTest/CMakeLists.txt
index 47ad9c5..6c6dfb6 100644
--- a/Tests/MacroTest/CMakeLists.txt
+++ b/Tests/MacroTest/CMakeLists.txt
@@ -51,14 +51,13 @@ include(CheckCSourceCompiles)
 Check_C_Source_Compiles(
 "
 #include <stdio.h>
-#if !defined(__STDC__) || __STDC__ == 0
-int main(ac, av)
+#ifdef __CLASSIC_C__
+int main(){
   int ac;
   char*av[];
 #else
-int main(int ac, char*av[])
+int main(int ac, char*av[]){
 #endif
-{
   if(ac > 1000){return *av[0];}
   return 0;
 }"
diff --git a/Tests/SimpleExclude/dirC/dirA/t4.c b/Tests/SimpleExclude/dirC/dirA/t4.c
index 0c01b8b..7c36ca9 100644
--- a/Tests/SimpleExclude/dirC/dirA/t4.c
+++ b/Tests/SimpleExclude/dirC/dirA/t4.c
@@ -1,13 +1,14 @@
 #include <stdio.h>
 
-#if !defined(__STDC__) || __STDC__ == 0
-int main(ac, av)
+#ifdef __CLASSIC_C__
+int main()
+{
   int ac;
   char*av[];
 #else
   int main(int ac, char*av[])
-#endif
     {
+#endif
     if(ac > 1000){return *av[0];}
     printf("This is T4. This one should work.\n");
     return 0;
diff --git a/Tests/SimpleExclude/dirD/t9.c b/Tests/SimpleExclude/dirD/t9.c
index 5e64ce5..321014b 100644
--- a/Tests/SimpleExclude/dirD/t9.c
+++ b/Tests/SimpleExclude/dirD/t9.c
@@ -2,14 +2,15 @@
 
 extern int tlib7func();
 
-#if !defined(__STDC__) || __STDC__ == 0
-int main(ac, av)
+#ifdef __CLASSIC_C__
+int main()
+{
   int ac;
   char*av[];
 #else
   int main(int ac, char*av[])
-#endif
     {
+#endif
     if(ac > 1000){return *av[0];}
     printf("This is T9. This one should work.\n");
 
diff --git a/Tests/Wrapping/Wrap.c b/Tests/Wrapping/Wrap.c
index ce07c7e..0a1ff50 100644
--- a/Tests/Wrapping/Wrap.c
+++ b/Tests/Wrapping/Wrap.c
@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-#if !defined(__STDC__) || __STDC__ == 0
+#ifdef __CLASSIC_C__
 int main(argc, argv)
   int argc;
   char ** argv;
diff --git a/bootstrap b/bootstrap
index f6c0c97..b3f06a1 100755
--- a/bootstrap
+++ b/bootstrap
@@ -839,7 +839,7 @@ echo '
 
 #include<stdio.h>
 
-#if !defined(__STDC__) || __STDC__ == 0
+#if defined(__CLASSIC_C__)
 int main(argc, argv)
   int argc;
   char* argv[];

-----------------------------------------------------------------------

Summary of changes:
 Modules/CMakeCCompilerABI.c           |    4 ++--
 Modules/CMakeCCompilerId.c.in         |    6 +++---
 Modules/CMakeDetermineCCompiler.cmake |    3 +++
 Modules/CMakeTestCCompiler.cmake      |    2 +-
 Modules/CheckForPthreads.c            |    7 +++----
 Modules/CheckFunctionExists.c         |    7 +++----
 Modules/CheckIncludeFile.c.in         |    7 +++++--
 Modules/CheckIncludeFiles.cmake       |    2 +-
 Modules/CheckPrototypeDefinition.c.in |    7 +++----
 Modules/CheckSymbolExists.cmake       |    2 +-
 Modules/CheckTypeSize.c.in            |    2 +-
 Modules/CheckVariableExists.c         |    7 +++----
 Modules/Compiler/Bruce-C.cmake        |    2 +-
 Modules/TestEndianess.c.in            |    6 +-----
 Tests/Assembler/main.c                |    7 +++----
 Tests/MacroTest/CMakeLists.txt        |    7 +++----
 Tests/SimpleExclude/dirC/dirA/t4.c    |    7 ++++---
 Tests/SimpleExclude/dirD/t9.c         |    7 ++++---
 Tests/Wrapping/Wrap.c                 |    2 +-
 bootstrap                             |    2 +-
 20 files changed, 47 insertions(+), 49 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list