Go to the documentation of this file. 1 #ifndef MUTILS_PLATFORM_H
2 #define MUTILS_PLATFORM_H
28 typedef signed char int8;
29 typedef unsigned char uint8;
30 typedef signed short int int16;
31 typedef unsigned short int uint16;
34 #define INT_MAX 2147483647L
36 #if INT_MAX >= 2147483647L
37 typedef signed int int32;
38 typedef unsigned int uint32;
40 typedef signed long int int32;
41 typedef unsigned long int uint32;
45 #define LONG_MAX 2147483647L
47 #if LONG_MAX > 2147483647L
48 typedef signed long int int64;
49 typedef unsigned long int uint64;
51 typedef signed long long int int64;
52 typedef unsigned long long int uint64;
64 #define MU_MAKESTR(arg) #arg
65 #define MU_VERSTR(num) MU_MAKESTR(num)
68 #define mu_compiler_known
69 #if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
70 # define mu_compiler "sunpro"
71 # define mu_compiler_sunpro
73 # define mu_compiler "pgcc"
74 # define mu_compiler_pgcc
76 # define mu_compiler ("icc" MU_VERSTR(__ICC))
77 # define mu_compiler_icc
79 # define mu_compiler "decc"
80 # define mu_compiler_decc
81 #elif defined(__xlC__)
82 # define mu_compiler "xlc"
83 # define mu_compiler_xlc
84 #elif defined(__GNUC__)
85 # define mu_compiler ("gcc" MU_VERSTR(__GNUC__) "." MU_VERSTR(__GNUC_MINOR__))
86 # define mu_compiler_gcc
88 # define mu_compiler "unknown"
89 # undef mu_compiler_known
97 #elif defined(__UWIN__)
99 #elif defined(__MINGW32__) || defined(__CYGWIN32__) || defined(_MSC_VER) || \
100 defined(__WIN32) || defined(_WIN32) || defined(WIN32)
102 #elif defined(__APPLE__) && defined(__MACH__)
104 #elif defined(aix) || defined(__aix)
106 #elif defined(hpux) || defined(__hpux)
108 #elif defined(irix) || defined(sgi) || defined(__sgi) || defined(__irix)
110 #elif defined(linx) || defined(linux) || defined(__linux__) || defined(__linx)
112 #elif defined(osf1) || defined (__osf__) || \
113 (defined(__digital__) && defined(__unix__)) || defined(__osf1)
115 #elif defined(sun4) || defined(__sun4)
117 #elif defined(sun5) || defined(__sun5) || (defined(__PGI) && defined(sun))
119 #elif defined(sun) || defined(__sun)
120 # if defined(__SVR4) || defined(__svr4__) || defined(__sun5)
122 # elif (!defined(__SVR4) && !defined(__svr4__)) || defined(__sun4)
130 # error "OS not supported in platform.h."
136 #if defined(alpha) || defined(__alpha__) || defined(__alpha)
137 # define mu_cpu_alpha
138 #elif defined(hppa) || defined(__hppa)
140 #elif defined(__MIC__)
141 # define mu_cpu_x86_mic
142 #elif defined(i386) || defined(i486) || defined(i586) || \
143 defined(i686) || defined(i786) || defined(__i386) || defined(_X86_) || \
144 defined(__386__) || defined(__i386__) || defined(_M_IX86)
146 #elif defined(x86_64) || defined(__x86_64) || defined(__x86_64__) || \
147 defined(__amd64) || defined(__amd64__)
148 # define mu_cpu_x86_64
149 #elif defined(mips) || defined(host_mips) || \
150 defined(__host_mips) || defined(__mips)
152 #elif defined(__bgq__) && defined(__PPC64__)
154 #elif defined(__PPC64__) || defined(__ARCH_PPC64)
155 # define mu_cpu_ppc64
156 #elif defined(__ppc__) || defined(__PPC__) || defined(__ppc) || \
157 defined(__powerpc__) || defined(__powerpc)
159 #elif defined(rs6000) || defined(__rs6000__) || defined(__rs6000)
160 # define mu_cpu_rs6000
161 #elif defined(sparc) || defined(__sparc__) || defined(__sparc)
162 # define mu_cpu_sparc
168 # error "CPU not supported in platform.h."
174 #if (defined(mu_compiler_icc) || defined(mu_compiler_gcc) || \
175 defined(mu_compiler_sunpro)) && \
176 defined(mu_cpu_x86) && !defined(mu_os_macx)
177 # define mu_asm_att_x86
178 #elif (defined(mu_compiler_icc) || defined(mu_compiler_gcc) || \
179 defined(mu_compiler_sunpro)) && \
180 defined(mu_cpu_x86_64) && !defined(mu_os_macx)
181 # define mu_asm_att_x86_64
188 #if defined(mu_cpu_alpha) || defined(mu_cpu_x86) || defined(mu_cpu_x86_64) || \
189 defined(mu_cpu_x86_mic) || defined(mu_cpu_rs6000) || \
190 (defined(mu_cpu_mips) && !defined(_MIPSEB) && !defined(MIPSEB)) || \
193 #elif defined(mu_cpu_bgq) || defined(mu_cpu_hppa) || defined(mu_cpu_mips) || \
194 defined(mu_cpu_ppc) || defined(mu_cpu_ppc64) || defined(mu_cpu_sparc) || \
196 # define MU_BIGENDIAN
198 # error "Byte order unknown in platform.h; CPU type supported??"
202 #if defined(DLL_EXPORT)
203 # define DLLSPEC __declspec(dllexport)
204 #elif defined(DLL_IMPORT)
205 # define DLLSPEC __declspec(dllimport)