Subversion Repositories svnkaklik

Rev

Go to most recent revision | Details | Last modification | View Log

Rev Author Line No. Line
556 kaklik 1
#ifdef __cplusplus
2
# error "A C++ compiler has been selected for C."
3
#endif
4
 
5
#if defined(__18CXX)
6
# define ID_VOID_MAIN
7
#endif
8
 
9
#if defined(__INTEL_COMPILER) || defined(__ICC)
10
# define COMPILER_ID "Intel"
11
 
12
#elif defined(__BORLANDC__)
13
# define COMPILER_ID "Borland"
14
 
15
#elif defined(__WATCOMC__)
16
# define COMPILER_ID "Watcom"
17
 
18
#elif defined(__SUNPRO_C)
19
# define COMPILER_ID "SunPro"
20
 
21
#elif defined(__HP_cc)
22
# define COMPILER_ID "HP"
23
 
24
#elif defined(__DECC)
25
# define COMPILER_ID "Compaq"
26
 
27
#elif defined(__IBMC__)
28
# define COMPILER_ID "VisualAge"
29
 
30
#elif defined(__PGI)
31
# define COMPILER_ID "PGI"
32
 
33
#elif defined(__GNUC__)
34
# define COMPILER_ID "GNU"
35
 
36
#elif defined(_MSC_VER)
37
# define COMPILER_ID "MSVC"
38
 
39
#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
40
/* Analog Devices C++ compiler for Blackfin, TigerSHARC and
41
   SHARC (21000) DSPs */
42
# define COMPILER_ID "ADSP"
43
 
44
/* IAR Systems compiler for embedded systems.
45
   http://www.iar.com
46
   Not supported yet by CMake
47
#elif defined(__IAR_SYSTEMS_ICC__)
48
# define COMPILER_ID "IAR" */
49
 
50
/* sdcc, the small devices C compiler for embedded systems,
51
   http://sdcc.sourceforge.net  */
52
#elif defined(SDCC)
53
# define COMPILER_ID "SDCC"
54
 
55
#elif defined(_COMPILER_VERSION)
56
# define COMPILER_ID "MIPSpro"
57
 
58
/* This compiler is either not known or is too old to define an
59
   identification macro.  Try to identify the platform and guess that
60
   it is the native compiler.  */
61
#elif defined(__sgi)
62
# define COMPILER_ID "MIPSpro"
63
 
64
#elif defined(__hpux) || defined(__hpua)
65
# define COMPILER_ID "HP"
66
 
67
#else /* unknown compiler */
68
# define COMPILER_ID ""
69
 
70
#endif
71
 
72
/* Construct the string literal in pieces to prevent the source from
73
   getting matched.  Store it in a pointer rather than an array
74
   because some compilers will just produce instructions to fill the
75
   array rather than assigning a pointer to a static array.  */
76
char* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
77
 
78
/* Identify known platforms by name.  */
79
#if defined(__linux) || defined(__linux__) || defined(linux)
80
# define PLATFORM_ID "Linux"
81
 
82
#elif defined(__CYGWIN__)
83
# define PLATFORM_ID "Cygwin"
84
 
85
#elif defined(__MINGW32__)
86
# define PLATFORM_ID "MinGW"
87
 
88
#elif defined(__APPLE__)
89
# define PLATFORM_ID "Darwin"
90
 
91
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
92
# define PLATFORM_ID "Windows"
93
 
94
#elif defined(__FreeBSD__) || defined(__FreeBSD)
95
# define PLATFORM_ID "FreeBSD"
96
 
97
#elif defined(__NetBSD__) || defined(__NetBSD)
98
# define PLATFORM_ID "NetBSD"
99
 
100
#elif defined(__OpenBSD__) || defined(__OPENBSD)
101
# define PLATFORM_ID "OpenBSD"
102
 
103
#elif defined(__sun) || defined(sun)
104
# define PLATFORM_ID "SunOS"
105
 
106
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
107
# define PLATFORM_ID "AIX"
108
 
109
#elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
110
# define PLATFORM_ID "IRIX"
111
 
112
#elif defined(__hpux) || defined(__hpux__)
113
# define PLATFORM_ID "HP-UX"
114
 
115
#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
116
# define PLATFORM_ID "BeOS"
117
 
118
#elif defined(__QNX__) || defined(__QNXNTO__)
119
# define PLATFORM_ID "QNX"
120
 
121
#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
122
# define PLATFORM_ID "Tru64"
123
 
124
#elif defined(__riscos) || defined(__riscos__)
125
# define PLATFORM_ID "RISCos"
126
 
127
#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
128
# define PLATFORM_ID "SINIX"
129
 
130
#elif defined(__UNIX_SV__)
131
# define PLATFORM_ID "UNIX_SV"
132
 
133
#elif defined(__bsdos__)
134
# define PLATFORM_ID "BSDOS"
135
 
136
#elif defined(_MPRAS) || defined(MPRAS)
137
# define PLATFORM_ID "MP-RAS"
138
 
139
#elif defined(__osf) || defined(__osf__)
140
# define PLATFORM_ID "OSF1"
141
 
142
#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
143
# define PLATFORM_ID "SCO_SV"
144
 
145
#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
146
# define PLATFORM_ID "ULTRIX"
147
 
148
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
149
# define PLATFORM_ID "Xenix"
150
 
151
#else /* unknown platform */
152
# define PLATFORM_ID ""
153
 
154
#endif
155
 
156
/* Construct the string literal in pieces to prevent the source from
157
   getting matched.  Store it in a pointer rather than an array
158
   because some compilers will just produce instructions to fill the
159
   array rather than assigning a pointer to a static array.  */
160
char* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
161
 
162
 
163
/*--------------------------------------------------------------------------*/
164
 
165
#ifdef ID_VOID_MAIN
166
void main() {}
167
#else
168
int main(int argc, char* argv[])
169
{
170
  int require = 0;
171
  require += info_compiler[argc];
172
  require += info_platform[argc];
173
  (void)argv;
174
  return require;
175
}
176
#endif