CMakeCCompilerId.c
Go to the documentation of this file.
00001 #ifdef __cplusplus
00002 # error "A C++ compiler has been selected for C."
00003 #endif
00004 
00005 #if defined(__18CXX)
00006 # define ID_VOID_MAIN
00007 #endif
00008 
00009 #if defined(__INTEL_COMPILER) || defined(__ICC)
00010 # define COMPILER_ID "Intel"
00011 
00012 #elif defined(__clang__)
00013 # define COMPILER_ID "Clang"
00014 
00015 #elif defined(__BORLANDC__)
00016 # define COMPILER_ID "Borland"
00017 
00018 #elif defined(__WATCOMC__)
00019 # define COMPILER_ID "Watcom"
00020 
00021 #elif defined(__SUNPRO_C)
00022 # define COMPILER_ID "SunPro"
00023 
00024 #elif defined(__HP_cc)
00025 # define COMPILER_ID "HP"
00026 
00027 #elif defined(__DECC)
00028 # define COMPILER_ID "Compaq"
00029 
00030 #elif defined(__IBMC__)
00031 # if defined(__COMPILER_VER__)
00032 #  define COMPILER_ID "zOS"
00033 # elif __IBMC__ >= 800
00034 #  define COMPILER_ID "XL"
00035 # else
00036 #  define COMPILER_ID "VisualAge"
00037 # endif
00038 
00039 #elif defined(__PGI)
00040 # define COMPILER_ID "PGI"
00041 
00042 #elif defined(__PATHSCALE__)
00043 # define COMPILER_ID "PathScale"
00044 
00045 #elif defined(_CRAYC)
00046 # define COMPILER_ID "Cray"
00047 
00048 #elif defined(__TI_COMPILER_VERSION__)
00049 # define COMPILER_ID "TI_DSP"
00050 
00051 #elif defined(__TINYC__)
00052 # define COMPILER_ID "TinyCC"
00053 
00054 #elif defined(__SCO_VERSION__)
00055 # define COMPILER_ID "SCO"
00056 
00057 #elif defined(__GNUC__)
00058 # define COMPILER_ID "GNU"
00059 
00060 #elif defined(_MSC_VER)
00061 # define COMPILER_ID "MSVC"
00062 
00063 #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
00064 /* Analog Devices C++ compiler for Blackfin, TigerSHARC and
00065    SHARC (21000) DSPs */
00066 # define COMPILER_ID "ADSP"
00067 
00068 /* IAR Systems compiler for embedded systems.
00069    http://www.iar.com
00070    Not supported yet by CMake
00071 #elif defined(__IAR_SYSTEMS_ICC__)
00072 # define COMPILER_ID "IAR" */
00073 
00074 /* sdcc, the small devices C compiler for embedded systems,
00075    http://sdcc.sourceforge.net  */
00076 #elif defined(SDCC)
00077 # define COMPILER_ID "SDCC"
00078 
00079 #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
00080 # define COMPILER_ID "MIPSpro"
00081 
00082 /* This compiler is either not known or is too old to define an
00083    identification macro.  Try to identify the platform and guess that
00084    it is the native compiler.  */
00085 #elif defined(__sgi)
00086 # define COMPILER_ID "MIPSpro"
00087 
00088 #elif defined(__hpux) || defined(__hpua)
00089 # define COMPILER_ID "HP"
00090 
00091 #else /* unknown compiler */
00092 # define COMPILER_ID ""
00093 
00094 #endif
00095 
00096 /* Construct the string literal in pieces to prevent the source from
00097    getting matched.  Store it in a pointer rather than an array
00098    because some compilers will just produce instructions to fill the
00099    array rather than assigning a pointer to a static array.  */
00100 char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
00101 
00102 /* Identify known platforms by name.  */
00103 #if defined(__linux) || defined(__linux__) || defined(linux)
00104 # define PLATFORM_ID "Linux"
00105 
00106 #elif defined(__CYGWIN__)
00107 # define PLATFORM_ID "Cygwin"
00108 
00109 #elif defined(__MINGW32__)
00110 # define PLATFORM_ID "MinGW"
00111 
00112 #elif defined(__APPLE__)
00113 # define PLATFORM_ID "Darwin"
00114 
00115 #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
00116 # define PLATFORM_ID "Windows"
00117 
00118 #elif defined(__FreeBSD__) || defined(__FreeBSD)
00119 # define PLATFORM_ID "FreeBSD"
00120 
00121 #elif defined(__NetBSD__) || defined(__NetBSD)
00122 # define PLATFORM_ID "NetBSD"
00123 
00124 #elif defined(__OpenBSD__) || defined(__OPENBSD)
00125 # define PLATFORM_ID "OpenBSD"
00126 
00127 #elif defined(__sun) || defined(sun)
00128 # define PLATFORM_ID "SunOS"
00129 
00130 #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
00131 # define PLATFORM_ID "AIX"
00132 
00133 #elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
00134 # define PLATFORM_ID "IRIX"
00135 
00136 #elif defined(__hpux) || defined(__hpux__)
00137 # define PLATFORM_ID "HP-UX"
00138 
00139 #elif defined(__HAIKU) || defined(__HAIKU__) || defined(_HAIKU)
00140 # define PLATFORM_ID "Haiku"
00141 /* Haiku also defines __BEOS__ so we must 
00142    put it prior to the check for __BEOS__
00143 */
00144 
00145 #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
00146 # define PLATFORM_ID "BeOS"
00147 
00148 #elif defined(__QNX__) || defined(__QNXNTO__)
00149 # define PLATFORM_ID "QNX"
00150 
00151 #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
00152 # define PLATFORM_ID "Tru64"
00153 
00154 #elif defined(__riscos) || defined(__riscos__)
00155 # define PLATFORM_ID "RISCos"
00156 
00157 #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
00158 # define PLATFORM_ID "SINIX"
00159 
00160 #elif defined(__UNIX_SV__)
00161 # define PLATFORM_ID "UNIX_SV"
00162 
00163 #elif defined(__bsdos__)
00164 # define PLATFORM_ID "BSDOS"
00165 
00166 #elif defined(_MPRAS) || defined(MPRAS)
00167 # define PLATFORM_ID "MP-RAS"
00168 
00169 #elif defined(__osf) || defined(__osf__)
00170 # define PLATFORM_ID "OSF1"
00171 
00172 #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
00173 # define PLATFORM_ID "SCO_SV"
00174 
00175 #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
00176 # define PLATFORM_ID "ULTRIX"
00177 
00178 #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
00179 # define PLATFORM_ID "Xenix"
00180 
00181 #else /* unknown platform */
00182 # define PLATFORM_ID ""
00183 
00184 #endif
00185 
00186 /* For windows compilers MSVC and Intel we can determine
00187    the architecture of the compiler being used.  This is because
00188    the compilers do not have flags that can change the architecture,
00189    but rather depend on which compiler is being used
00190 */
00191 #if defined(_WIN32) && defined(_MSC_VER)
00192 # if defined(_M_IA64)
00193 #  define ARCHITECTURE_ID "IA64"
00194 
00195 # elif defined(_M_X64) || defined(_M_AMD64)
00196 #  define ARCHITECTURE_ID "x64" 
00197 
00198 # elif defined(_M_IX86)
00199 #  define ARCHITECTURE_ID "X86"
00200 
00201 # else /* unknown architecture */
00202 #  define ARCHITECTURE_ID ""
00203 # endif
00204 
00205 #else
00206 #  define ARCHITECTURE_ID ""
00207 #endif
00208 
00209 /* Construct the string literal in pieces to prevent the source from
00210    getting matched.  Store it in a pointer rather than an array
00211    because some compilers will just produce instructions to fill the
00212    array rather than assigning a pointer to a static array.  */
00213 char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
00214 char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
00215 
00216 
00217 
00218 /*--------------------------------------------------------------------------*/
00219 
00220 #ifdef ID_VOID_MAIN
00221 void main() {}
00222 #else
00223 int main(int argc, char* argv[])
00224 {
00225   int require = 0;
00226   require += info_compiler[argc];
00227   require += info_platform[argc];
00228   require += info_arch[argc];
00229   (void)argv;
00230   return require;
00231 }
00232 #endif


razor_imu_9dof
Author(s): Tang Tiong Yew
autogenerated on Mon Oct 6 2014 04:01:09