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