Browse Source

ENH: Add support to C compiler identification for void return type from main. Cross-compilers for embedded platforms may require it.

Brad King 18 years ago
parent
commit
83c5f1b3f0
1 changed files with 7 additions and 0 deletions
  1. 7 0
      Modules/CMakeCCompilerId.c.in

+ 7 - 0
Modules/CMakeCCompilerId.c.in

@@ -3,7 +3,14 @@
 #endif
 
 /* Provide main() so the program can link.  */
+#if defined(__18CXX)
+# define ID_VOID_MAIN
+#endif
+#ifdef ID_VOID_MAIN
+void main() {}
+#else
 int main() { return 0; }
+#endif
 
 #if defined(__INTEL_COMPILER) || defined(__ICC)
 # define COMPILER_ID "Intel"