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