Products Support Documentation Download
pspplatdetect.h
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * Raima Database Manager
3  *
4  * Copyright (c) 2012 Raima Inc., All rights reserved.
5  *
6  * Use of this software, whether in source code format, or in executable,
7  * binary object code form, is governed by the Birdstep LICENSE which
8  * is fully described in the LICENSE.TXT file, included within this
9  * distribution of files.
10  * ----------------------------------------------------------------------------
11  */
12 
17 #ifndef RDM_DOXYGEN
18 #if !defined(PSPPLATDETECT_H_INCLUDED_)
19  #define PSPPLATDETECT_H_INCLUDED_
20  #if defined(SIZEOF_VOIDP) && (SIZEOF_VOIDP == 8)
21  #define RDM_64BIT
22  #endif
23 
24  #if defined(RDM_NO_OS)
25  #undef RDM_NO_OS
26  #if defined(RDM_64BIT)
27  #define RDM_NO_OS_64
28  #else
29  #define RDM_NO_OS_32
30  #endif
31  /* The following is compiled from:
32  http://sourceforge.net/p/predef/wiki/Home/ */
33  #elif defined(__ANDROID__)
34  #if defined(__arm__) /* GCC */
35  #define RDM_ANDROID_ARM
36  #else
37  #error No architecture defined for Android
38  #endif
39  #elif defined(__linux__)
40  #if defined(__arm__) /* GCC */
41  #define RDM_LINUX_ARM
42  #elif defined(__aarch64__) /* GCC */
43  #define RDM_LINUX_AARCH64
44  #elif defined(i386) || defined(__i386__) /* GCC */ || \
45  defined(__x86_64) || defined(__x86_64__) /* Intel C/C++ */
46  #if defined(RDM_64BIT)
47  #define RDM_LINUX_X64
48  #else
49  #define RDM_LINUX_X86
50  #endif
51  #elif defined(__ia64__) || defined(_IA64) || defined(__IA64__) /* GCC */
52  #define RDM_LINUX_ITANIUM_64
53  #elif defined (__powerpc) || defined (__powerpc__) || defined (__POWERPC__) || defined (__ppc__) /* GCC */
54  #define RDM_LINUX_POWERPC
55  #else
56  #error No architecture defined for Linux
57  #endif
58  #elif defined(__QNX__) /* QNX 4.x */ || \
59  defined(__QNXNTO__) /* QNX 6.x */
60  #if defined(__arm__) /* GCC */
61  #define RDM_NEUTRINO_ARM
62  #elif defined(__aarch64__) /* GCC */
63  #define RDM_NEUTRINO_ARM64
64  #elif defined(i386) || defined(__i386__) /* GCC */
65  #define RDM_NEUTRINO_X86
66  #elif defined (__x86_64__)
67  #define RDM_NEUTRINO_X86_64
68  #elif defined (__PPC__) /* GCC */
69  #define RDM_NEUTRINO_PPC
70  #else
71  #error No architecture defined for QNX Neutrino
72  #endif
73  #elif defined(__APPLE__) & defined(__MACH__)
74  #if defined(__arm__) /* GCC */
75  #define RDM_IPHONE_ARM
76  #elif defined(i386) || defined(__i386__) /* GCC */
77  #if defined(RDM_64BIT)
78  #define RDM_OSX_X64
79  #else
80  #define RDM_OSX_X86
81  #endif
82  #elif defined(__x86_64) || defined(__x86_64__ ) /* GCC */
83  #define RDM_OSX_X64
84  #else
85  #error No architecture defined for Apple OSX/IOS
86  #endif
87  #elif defined(sun) || defined(__sun)
88  #if defined(__SVR4) || defined(__svr4__) /* Solaris */
89  #if defined(__sparc) /* Sun Studio */ || \
90  defined(__x86_64) || defined(__x86_64__) /* Intel C/C++ */ || \
91  defined(__sparc__) /* GCC */
92  #if defined(RDM_64BIT)
93  #define RDM_SOLARIS_SPARC_64
94  #else
95  #define RDM_SOLARIS_SPARC_32
96  #endif
97  #elif defined(__i386) /* Sun Studio */ || \
98  defined(__i386__) || defined(i386)
99  #if defined(RDM_64BIT)
100  #define RDM_SOLARIS_X64
101  #else
102  #define RDM_SOLARIS_X86
103  #endif
104  #else
105  #error No architecture defined for Solaris
106  #endif
107  #else
108  #error SunOS not supported
109  #endif
110  #elif defined(_AIX)
111  #if defined(RDM_64BIT)
112  #define RDM_AIX_POWERPC_64
113  #else
114  #define RDM_AIX_POWERPC_32
115  #endif
116  #elif defined(hpux) || defined(__hpux) || \
117  defined(_hpux) /* HP UPC */
118  #if defined(__ia64) /* HP aCC */
119  #if defined(RDM_64BIT)
120  #define RDM_HPUX_ITANIUM_64
121  #else
122  #define RDM_HPUX_ITANIUM_32
123  #endif
124  #elif defined(__hppa__) /* GCC */ || \
125  defined(__hppa)
126  #if defined(RDM_64BIT)
127  #define RDM_HPUX_PARISC_64
128  #else
129  #define RDM_HPUX_PARISC_32
130  #endif
131  #else
132  #error No architecture defined for HPUX
133  #endif
134  #elif defined(_WIN32_WCE)
135  #define RDM_WINCE
136  #elif defined(_WIN32)
137  #if defined (_WIN64)
138  #define RDM_WINDOWS_X64
139  #else
140  #define RDM_WINDOWS_X86
141  #endif
142  #elif defined(__FreeBSD__)
143  #if defined(RDM_64BIT)
144  #define RDM_FREEBSD_X64
145  #else
146  #define RDM_FREEBSD_X86
147  #endif
148  #elif defined(__NetBSD__)
149  #if defined(RDM_64BIT)
150  #define RDM_NETBSD_X64
151  #else
152  #define RDM_NETBSD_X86
153  #endif
154  #elif defined(__OpenBSD__)
155  #if defined(RDM_64BIT)
156  #define RDM_OPENBSD_X64
157  #else
158  #define RDM_OPENBSD_X86
159  #endif
160  #elif defined(__INTEGRITY)
161  #if defined(__i386) || defined(__i386__)
162  #define RDM_INTEGRITY_X86
163  #elif defined (__x86_64__)
164  #define RDM_INTEGRITY_X64
165  #elif defined (__ARM) || defined (__ARM__)
166  #define RDM_INTEGRITY_ARM
167  #elif defined (__ppc__) || defined (__ppc) || defined (__PPC__)
168  #define RDM_INTEGRITY_POWERPC
169  #else
170  #error No architecture defined for INTEGRITY
171  #endif
172  #elif defined(__VXWORKS__)
173  #if defined(_WRS_KERNEL)
174  #if defined (__DCC__) /* Diab */
175  #error RDM have not been ported to VxWorks Kernel modules using the Diab Compiler
176  #elif defined(i386) || defined(__i386__) /* GCC */
177  #define RDM_VXWORKS_X86
178  #elif defined (__powerpc) || defined (__powerpc__) || defined (__POWERPC__) || defined (__ppc__) || defined (__ppc) /* GCC */
179  #define RDM_VXWORKS_POWERPC
180  #elif defined(__sh__) /* GCC */
181  #if defined(__SH4__)
182  #define RDM_VXWORKS_SH4 /* We should really redefine this to SH4 or SH */
183  #endif
184  #elif defined(__arm__) /* GCC */
185  #define RDM_VXWORKS_ARM
186  #else
187  #error No architecture defined for VxWorks Kernel Modules using the GNU compiler
188  #endif
189  #elif defined (__RTP__)
190  #if defined (__DCC__) /* Diab */
191  #if defined (__ppc) /* Diab */
192  #define RDM_VXWORKS_RTP_POWERPC
193  #elif defined(__386) /* Diab */
194  #define RDM_VXWORKS_RTP_X86
195  #else
196  #error No architecture defined for VxWorks RTP using the Diab compiler
197  #endif
198  #elif defined(i386) || defined(__i386__) /* GCC */
199  #define RDM_VXWORKS_RTP_X86
200  #elif defined (__powerpc) || defined (__powerpc__) || defined (__POWERPC__) || defined (__ppc__) || defined (__ppc) /* GCC */
201  #define RDM_VXWORKS_RTP_POWERPC
202  #elif defined(__sh__) /* GCC */
203  #if defined(__SH4__)
204  #define RDM_VXWORKS_RTP_SH4 /* We should really redefine this to SH4 or SH */
205  #endif
206  #elif defined(__arm__) /* GCC */
207  #define RDM_VXWORKS_RTP_ARM
208  #else
209  #error No architecture defined for VxWorks RTP using the GNU compiler
210  #endif
211  #endif
212  #else
213  #error No architecture defined for unknown OS
214  #endif
215  #undef RDM_64BIT
216 #endif /* PSPPLATDETECT_H_INCLUDED_ */
217 #endif