summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeCCompilerId.c.in
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-02-25 23:47:19 (GMT)
committerBrad King <brad.king@kitware.com>2008-02-25 23:47:19 (GMT)
commit83c5f1b3f0941f6b817d3342b87ddb9a825c8174 (patch)
treeedda1a86eff66cb986fcb478d661eb2a93d66e80 /Modules/CMakeCCompilerId.c.in
parent0a9f041d2f8ecf5514640e451d758a4fa14c8bd5 (diff)
downloadCMake-83c5f1b3f0941f6b817d3342b87ddb9a825c8174.zip
CMake-83c5f1b3f0941f6b817d3342b87ddb9a825c8174.tar.gz
CMake-83c5f1b3f0941f6b817d3342b87ddb9a825c8174.tar.bz2
ENH: Add support to C compiler identification for void return type from main. Cross-compilers for embedded platforms may require it.
Diffstat (limited to 'Modules/CMakeCCompilerId.c.in')
-rw-r--r--Modules/CMakeCCompilerId.c.in7
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index e9675ca..d5ae00a 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/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"