re-enabled storing selection from "last played level set" menu
[rocksndiamonds.git] / src / libgame / platform.h
1 // ============================================================================
2 // Artsoft Retro-Game Library
3 // ----------------------------------------------------------------------------
4 // (c) 1995-2014 by Artsoft Entertainment
5 //                  Holger Schemel
6 //                  info@artsoft.org
7 //                  https://www.artsoft.org/
8 // ----------------------------------------------------------------------------
9 // platform.h
10 // ============================================================================
11
12 #ifndef PLATFORM_H
13 #define PLATFORM_H
14
15 // ============================================================================
16 // define main platform keywords
17 // ============================================================================
18
19 #if defined(WIN32) || defined(_WIN32)
20 #define PLATFORM_WIN32
21 #define PLATFORM_STRING "Windows"
22 #else
23 #define PLATFORM_UNIX
24 #define PLATFORM_STRING "Unix"
25 #endif
26
27
28 // ============================================================================
29 // define additional platform keywords
30 // ============================================================================
31
32 #if defined(_AIX)
33 #define PLATFORM_AIX
34 #undef  PLATFORM_STRING
35 #define PLATFORM_STRING "AIX"
36 #endif
37
38 #if defined(AMIGA) || defined(__AMIGA) || defined(__amigados__)
39 #define PLATFORM_AMIGA
40 #undef  PLATFORM_STRING
41 #define PLATFORM_STRING "AmigaOS"
42 #endif
43
44 #if defined(__BEOS__)
45 #define PLATFORM_BEOS
46 #undef  PLATFORM_STRING
47 #define PLATFORM_STRING "BeOS"
48 #endif
49
50 #if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
51 #define PLATFORM_BSDI
52 #define PLATFORM_BSD
53 #undef  PLATFORM_STRING
54 #define PLATFORM_STRING "BSDI"
55 #endif
56
57 #if defined(_arch_dreamcast)
58 #define PLATFORM_DREAMCAST
59 #undef  PLATFORM_STRING
60 #define PLATFORM_STRING "Dreamcast"
61 #endif
62
63 #if defined(__FreeBSD__) || defined(__DragonFly__)
64 #define PLATFORM_FREEBSD
65 #define PLATFORM_BSD
66 #undef  PLATFORM_STRING
67 #define PLATFORM_STRING "FreeBSD"
68 #endif
69
70 #if defined(hpux) || defined(__hpux) || defined(__hpux__)
71 #define PLATFORM_HPUX
72 #undef  PLATFORM_STRING
73 #define PLATFORM_STRING "HP-UX"
74 #endif
75
76 #if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
77 #define PLATFORM_IRIX
78 #undef  PLATFORM_STRING
79 #define PLATFORM_STRING "IRIX"
80 #endif
81
82 #if defined(linux) || defined(__linux) || defined(__linux__)
83 #define PLATFORM_LINUX
84 #undef  PLATFORM_STRING
85 #define PLATFORM_STRING "Linux"
86 #endif
87
88 #if defined(__APPLE__) && defined(__MACH__)
89 #define PLATFORM_MACOSX
90 #undef  PLATFORM_STRING
91 #define PLATFORM_STRING "Mac OS X"
92 #endif
93
94 #if defined(__NetBSD__)
95 #define PLATFORM_NETBSD
96 #define PLATFORM_BSD
97 #undef  PLATFORM_STRING
98 #define PLATFORM_STRING "NetBSD"
99 #endif
100
101 #if defined(NeXT)
102 #define PLATFORM_NEXT
103 #undef  PLATFORM_STRING
104 #define PLATFORM_STRING "NeXT"
105 #endif
106
107 #if defined(__OpenBSD__)
108 #define PLATFORM_OPENBSD
109 #define PLATFORM_BSD
110 #undef  PLATFORM_STRING
111 #define PLATFORM_STRING "OpenBSD"
112 #endif
113
114 #if defined(__OS2__)
115 #define PLATFORM_OS2
116 #undef  PLATFORM_STRING
117 #define PLATFORM_STRING "OS/2"
118 #endif
119
120 #if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
121 #define PLATFORM_OSF
122 #undef  PLATFORM_STRING
123 #define PLATFORM_STRING "OSF/1"
124 #endif
125
126 #if defined(__QNXNTO__)
127 #define PLATFORM_QNX
128 #undef  PLATFORM_STRING
129 #define PLATFORM_STRING "QNX"
130 #endif
131
132 #if defined(riscos) || defined(__riscos) || defined(__riscos__)
133 #define PLATFORM_RISCOS
134 #undef  PLATFORM_STRING
135 #define PLATFORM_STRING "RISC OS"
136 #endif
137
138 #if defined(sparc) || defined(sun) || defined(__SVR4)
139 #define PLATFORM_SOLARIS
140 #undef  PLATFORM_STRING
141 #define PLATFORM_STRING "Solaris"
142 #endif
143
144 #if defined(_WIN32_WCE)
145 #define PLATFORM_WINDOWS_CE
146 #undef  PLATFORM_STRING
147 #define PLATFORM_STRING "Windows CE"
148 #endif
149
150 #if defined(__ANDROID__)
151 #define PLATFORM_ANDROID
152 #undef  PLATFORM_STRING
153 #define PLATFORM_STRING "Android"
154 #endif
155
156 #if defined(__EMSCRIPTEN__)
157 #define PLATFORM_EMSCRIPTEN
158 #undef  PLATFORM_STRING
159 #define PLATFORM_STRING "Emscripten"
160 #endif
161
162
163 // ============================================================================
164 // define additional platform keywords for CPU architecture
165 // ============================================================================
166
167 #if defined(__x86_64__) || defined(__LP64__) || defined(_LP64)
168 #define PLATFORM_64_BIT
169 #define PLATFORM_XX_BIT_STRING "64-bit"
170 #else
171 #define PLATFORM_32_BIT
172 #define PLATFORM_XX_BIT_STRING "32-bit"
173 #endif
174
175
176 // ============================================================================
177 // define additional target keywords
178 // ============================================================================
179
180 #if defined(TARGET_SDL2)
181 #ifndef TARGET_SDL
182 #define TARGET_SDL
183 #endif
184 #endif
185
186
187 #endif // PLATFORM_H