2007-04-28 09:35:01 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
# error "A C++ compiler has been selected for C."
|
|
|
|
#endif
|
|
|
|
|
2008-02-25 18:47:19 -05:00
|
|
|
#if defined(__18CXX)
|
|
|
|
# define ID_VOID_MAIN
|
|
|
|
#endif
|
2016-03-20 10:42:19 +01:00
|
|
|
#if defined(__CLASSIC_C__)
|
|
|
|
/* cv-qualifiers did not exist in K&R C */
|
|
|
|
# define const
|
|
|
|
# define volatile
|
|
|
|
#endif
|
2007-04-28 09:35:01 -04:00
|
|
|
|
2014-05-07 12:25:39 +02:00
|
|
|
@CMAKE_C_COMPILER_ID_CONTENT@
|
2007-05-22 12:48:16 -04:00
|
|
|
|
2008-03-10 09:32:25 -04:00
|
|
|
/* Construct the string literal in pieces to prevent the source from
|
|
|
|
getting matched. Store it in a pointer rather than an array
|
|
|
|
because some compilers will just produce instructions to fill the
|
|
|
|
array rather than assigning a pointer to a static array. */
|
2010-12-29 15:35:15 -05:00
|
|
|
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
|
2013-10-04 10:10:22 -04:00
|
|
|
#ifdef SIMULATE_ID
|
|
|
|
char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
|
|
|
|
#endif
|
2007-04-28 09:35:01 -04:00
|
|
|
|
2014-01-20 17:57:40 +01:00
|
|
|
#ifdef __QNXNTO__
|
2015-01-14 10:28:59 -05:00
|
|
|
char const* qnxnto = "INFO" ":" "qnxnto[]";
|
2014-01-20 17:57:40 +01:00
|
|
|
#endif
|
|
|
|
|
2015-12-02 09:59:47 -06:00
|
|
|
#if defined(__CRAYXE) || defined(__CRAYXC)
|
|
|
|
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
|
|
|
|
#endif
|
|
|
|
|
2008-02-25 09:23:14 -05:00
|
|
|
@CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@
|
2013-10-24 13:04:24 -04:00
|
|
|
@CMAKE_C_COMPILER_ID_ERROR_FOR_TEST@
|
2008-08-07 09:09:45 -04:00
|
|
|
|
2016-03-20 10:42:19 +01:00
|
|
|
#if !defined(__STDC__)
|
2016-04-15 16:06:41 -04:00
|
|
|
# if defined(_MSC_VER) && !defined(__clang__)
|
|
|
|
# define C_DIALECT "90"
|
|
|
|
# else
|
|
|
|
# define C_DIALECT
|
|
|
|
# endif
|
2015-09-15 19:42:26 +02:00
|
|
|
#elif __STDC_VERSION__ >= 201000L
|
2016-03-20 10:42:19 +01:00
|
|
|
# define C_DIALECT "11"
|
2015-09-15 19:42:26 +02:00
|
|
|
#elif __STDC_VERSION__ >= 199901L
|
2016-03-20 10:42:19 +01:00
|
|
|
# define C_DIALECT "99"
|
2015-09-15 19:42:26 +02:00
|
|
|
#else
|
2016-03-20 10:42:19 +01:00
|
|
|
# define C_DIALECT "90"
|
2015-09-15 19:42:26 +02:00
|
|
|
#endif
|
2016-03-20 10:42:19 +01:00
|
|
|
const char* info_language_dialect_default =
|
|
|
|
"INFO" ":" "dialect_default[" C_DIALECT "]";
|
2015-09-15 19:42:26 +02:00
|
|
|
|
2008-08-07 09:09:45 -04:00
|
|
|
/*--------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
#ifdef ID_VOID_MAIN
|
|
|
|
void main() {}
|
|
|
|
#else
|
2016-03-20 10:42:19 +01:00
|
|
|
# if defined(__CLASSIC_C__)
|
|
|
|
int main(argc, argv) int argc; char *argv[];
|
|
|
|
# else
|
2008-08-07 09:09:45 -04:00
|
|
|
int main(int argc, char* argv[])
|
2016-03-20 10:42:19 +01:00
|
|
|
# endif
|
2008-08-07 09:09:45 -04:00
|
|
|
{
|
|
|
|
int require = 0;
|
|
|
|
require += info_compiler[argc];
|
|
|
|
require += info_platform[argc];
|
2009-11-19 21:58:42 -05:00
|
|
|
require += info_arch[argc];
|
2011-12-05 09:44:09 -05:00
|
|
|
#ifdef COMPILER_VERSION_MAJOR
|
|
|
|
require += info_version[argc];
|
2013-10-04 10:10:22 -04:00
|
|
|
#endif
|
|
|
|
#ifdef SIMULATE_ID
|
|
|
|
require += info_simulate[argc];
|
|
|
|
#endif
|
|
|
|
#ifdef SIMULATE_VERSION_MAJOR
|
|
|
|
require += info_simulate_version[argc];
|
2015-12-02 09:59:47 -06:00
|
|
|
#endif
|
|
|
|
#if defined(__CRAYXE) || defined(__CRAYXC)
|
|
|
|
require += info_cray[argc];
|
2011-12-05 09:44:09 -05:00
|
|
|
#endif
|
2015-11-18 10:12:25 -05:00
|
|
|
require += info_language_dialect_default[argc];
|
2008-08-07 09:09:45 -04:00
|
|
|
(void)argv;
|
|
|
|
return require;
|
|
|
|
}
|
|
|
|
#endif
|