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 /* clang-format off */
18 
19 #ifndef RDM_DOXYGEN
20 #if !defined(PSPPLATDETECT_H_INCLUDED_)
21  #define PSPPLATDETECT_H_INCLUDED_
22  #if defined(SIZEOF_VOIDP) && (SIZEOF_VOIDP == 8)
23  #define RDM_64BIT
24  #endif
25 
26  #if defined(RDM_NO_OS)
27  #undef RDM_NO_OS
28  #if defined(RDM_64BIT)
29  #define RDM_NO_OS_64
30  #else
31  #define RDM_NO_OS_32
32  #endif
33  /* The following is compiled from:
34  http://sourceforge.net/p/predef/wiki/Home/ */
35  #elif defined(__ANDROID__)
36  #if defined(__arm__) /* GCC */
37  #define RDM_ANDROID_ARM
38  #else
39  #error No architecture defined for Android
40  #endif
41  #elif defined(__linux__)
42  #if defined(__arm__) /* GCC */
43  #define RDM_LINUX_ARM
44  #elif defined(__aarch64__) /* GCC */
45  #define RDM_LINUX_AARCH64
46  #elif defined(i386) || defined(__i386__) /* GCC */ || \
47  defined(__x86_64) || defined(__x86_64__) /* Intel C/C++ */
48  #if defined(RDM_64BIT)
49  #define RDM_LINUX_X64
50  #else
51  #define RDM_LINUX_X86
52  #endif
53  #elif defined(__ia64__) || defined(_IA64) || defined(__IA64__) /* GCC */
54  #define RDM_LINUX_ITANIUM_64
55  #elif defined (__powerpc) || defined (__powerpc__) || defined (__POWERPC__) || defined (__ppc__) /* GCC */
56  #define RDM_LINUX_POWERPC
57  #else
58  #error No architecture defined for Linux
59  #endif
60  #elif defined(__QNX__) /* QNX 4.x */ || \
61  defined(__QNXNTO__) /* QNX 6.x */
62  #if defined(__arm__) /* GCC */
63  #define RDM_NEUTRINO_ARM
64  #elif defined(__aarch64__) /* GCC */
65  #define RDM_NEUTRINO_ARM64
66  #elif defined(i386) || defined(__i386__) /* GCC */
67  #define RDM_NEUTRINO_X86
68  #elif defined (__x86_64__)
69  #define RDM_NEUTRINO_X86_64
70  #elif defined (__PPC__) /* GCC */
71  #define RDM_NEUTRINO_PPC
72  #else
73  #error No architecture defined for QNX Neutrino
74  #endif
75  #elif defined(__APPLE__) & defined(__MACH__)
76  #if defined(__arm__) /* GCC */
77  #define RDM_IPHONE_ARM
78  #elif defined(i386) || defined(__i386__) /* GCC */
79  #if defined(RDM_64BIT)
80  #define RDM_OSX_X64
81  #else
82  #define RDM_OSX_X86
83  #endif
84  #elif defined(__x86_64) || defined(__x86_64__ ) /* GCC */
85  #define RDM_OSX_X64
86  #else
87  #error No architecture defined for Apple OSX/IOS
88  #endif
89  #elif defined(sun) || defined(__sun)
90  #if defined(__SVR4) || defined(__svr4__) /* Solaris */
91  #if defined(__sparc) /* Sun Studio */ || \
92  defined(__x86_64) || defined(__x86_64__) /* Intel C/C++ */ || \
93  defined(__sparc__) /* GCC */
94  #if defined(RDM_64BIT)
95  #define RDM_SOLARIS_SPARC_64
96  #else
97  #define RDM_SOLARIS_SPARC_32
98  #endif
99  #elif defined(__i386) /* Sun Studio */ || \
100  defined(__i386__) || defined(i386)
101  #if defined(RDM_64BIT)
102  #define RDM_SOLARIS_X64
103  #else
104  #define RDM_SOLARIS_X86
105  #endif
106  #else
107  #error No architecture defined for Solaris
108  #endif
109  #else
110  #error SunOS not supported
111  #endif
112  #elif defined(_WIN32)
113  #if defined (_WIN64)
114  #define RDM_WINDOWS_X64
115  #else
116  #define RDM_WINDOWS_X86
117  #endif
118  #elif defined(__FreeBSD__)
119  #if defined(RDM_64BIT)
120  #define RDM_FREEBSD_X64
121  #else
122  #define RDM_FREEBSD_X86
123  #endif
124  #elif defined(__INTEGRITY)
125  #if defined(__i386) || defined(__i386__)
126  #define RDM_INTEGRITY_X86
127  #elif defined (__x86_64__)
128  #define RDM_INTEGRITY_X64
129  #elif defined (__ARM) || defined (__ARM__)
130  #define RDM_INTEGRITY_ARM
131  #elif defined (__ppc__) || defined (__ppc) || defined (__PPC__)
132  #define RDM_INTEGRITY_POWERPC
133  #else
134  #error No architecture defined for INTEGRITY
135  #endif
136  #elif defined(__VXWORKS__)
137  #if defined(_WRS_KERNEL)
138  #if defined (__DCC__) /* Diab */
139  #error RDM have not been ported to VxWorks Kernel modules using the Diab Compiler
140  #elif defined(i386) || defined(__i386__) /* GCC */
141  #define RDM_VXWORKS_X86
142  #elif defined (__powerpc) || defined (__powerpc__) || defined (__POWERPC__) || defined (__ppc__) || defined (__ppc) /* GCC */
143  #define RDM_VXWORKS_POWERPC
144  #elif defined(__sh__) /* GCC */
145  #if defined(__SH4__)
146  #define RDM_VXWORKS_SH4 /* We should really redefine this to SH4 or SH */
147  #endif
148  #elif defined(__arm__) /* GCC */
149  #define RDM_VXWORKS_ARM
150  #else
151  #error No architecture defined for VxWorks Kernel Modules using the GNU compiler
152  #endif
153  #elif defined (__RTP__)
154  #if defined (__DCC__) /* Diab */
155  #if defined (__ppc) /* Diab */
156  #define RDM_VXWORKS_RTP_POWERPC
157  #elif defined(__386) /* Diab */
158  #define RDM_VXWORKS_RTP_X86
159  #else
160  #error No architecture defined for VxWorks RTP using the Diab compiler
161  #endif
162  #elif defined(i386) || defined(__i386__) /* GCC */
163  #define RDM_VXWORKS_RTP_X86
164  #elif defined (__powerpc) || defined (__powerpc__) || defined (__POWERPC__) || defined (__ppc__) || defined (__ppc) /* GCC */
165  #define RDM_VXWORKS_RTP_POWERPC
166  #elif defined(__sh__) /* GCC */
167  #if defined(__SH4__)
168  #define RDM_VXWORKS_RTP_SH4 /* We should really redefine this to SH4 or SH */
169  #endif
170  #elif defined(__arm__) /* GCC */
171  #define RDM_VXWORKS_RTP_ARM
172  #else
173  #error No architecture defined for VxWorks RTP using the GNU compiler
174  #endif
175  #endif
176  #else
177  #error No architecture defined for unknown OS
178  #endif
179  #undef RDM_64BIT
180 #endif /* PSPPLATDETECT_H_INCLUDED_ */
181 #endif