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(_WIN32)
111  #if defined (_WIN64)
112  #define RDM_WINDOWS_X64
113  #else
114  #define RDM_WINDOWS_X86
115  #endif
116  #elif defined(__FreeBSD__)
117  #if defined(RDM_64BIT)
118  #define RDM_FREEBSD_X64
119  #else
120  #define RDM_FREEBSD_X86
121  #endif
122  #elif defined(__INTEGRITY)
123  #if defined(__i386) || defined(__i386__)
124  #define RDM_INTEGRITY_X86
125  #elif defined (__x86_64__)
126  #define RDM_INTEGRITY_X64
127  #elif defined (__ARM) || defined (__ARM__)
128  #define RDM_INTEGRITY_ARM
129  #elif defined (__ppc__) || defined (__ppc) || defined (__PPC__)
130  #define RDM_INTEGRITY_POWERPC
131  #else
132  #error No architecture defined for INTEGRITY
133  #endif
134  #elif defined(__VXWORKS__)
135  #if defined(_WRS_KERNEL)
136  #if defined (__DCC__) /* Diab */
137  #error RDM have not been ported to VxWorks Kernel modules using the Diab Compiler
138  #elif defined(i386) || defined(__i386__) /* GCC */
139  #define RDM_VXWORKS_X86
140  #elif defined (__powerpc) || defined (__powerpc__) || defined (__POWERPC__) || defined (__ppc__) || defined (__ppc) /* GCC */
141  #define RDM_VXWORKS_POWERPC
142  #elif defined(__sh__) /* GCC */
143  #if defined(__SH4__)
144  #define RDM_VXWORKS_SH4 /* We should really redefine this to SH4 or SH */
145  #endif
146  #elif defined(__arm__) /* GCC */
147  #define RDM_VXWORKS_ARM
148  #else
149  #error No architecture defined for VxWorks Kernel Modules using the GNU compiler
150  #endif
151  #elif defined (__RTP__)
152  #if defined (__DCC__) /* Diab */
153  #if defined (__ppc) /* Diab */
154  #define RDM_VXWORKS_RTP_POWERPC
155  #elif defined(__386) /* Diab */
156  #define RDM_VXWORKS_RTP_X86
157  #else
158  #error No architecture defined for VxWorks RTP using the Diab compiler
159  #endif
160  #elif defined(i386) || defined(__i386__) /* GCC */
161  #define RDM_VXWORKS_RTP_X86
162  #elif defined (__powerpc) || defined (__powerpc__) || defined (__POWERPC__) || defined (__ppc__) || defined (__ppc) /* GCC */
163  #define RDM_VXWORKS_RTP_POWERPC
164  #elif defined(__sh__) /* GCC */
165  #if defined(__SH4__)
166  #define RDM_VXWORKS_RTP_SH4 /* We should really redefine this to SH4 or SH */
167  #endif
168  #elif defined(__arm__) /* GCC */
169  #define RDM_VXWORKS_RTP_ARM
170  #else
171  #error No architecture defined for VxWorks RTP using the GNU compiler
172  #endif
173  #endif
174  #else
175  #error No architecture defined for unknown OS
176  #endif
177  #undef RDM_64BIT
178 #endif /* PSPPLATDETECT_H_INCLUDED_ */
179 #endif