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