a908fc7caec0b7077bbdb3f6cff107475f3ea893
[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(WIN32) || defined(_WIN32)
22 #define PLATFORM_WIN32
23 #define PLATFORM_STRING "Windows"
24 #else
25 #define PLATFORM_UNIX
26 #define PLATFORM_STRING "Unix"
27 #endif
28
29
30 /* ========================================================================= */
31 /* define additional platform keywords                                       */
32 /* ========================================================================= */
33
34 #if defined(_AIX)
35 #define PLATFORM_AIX
36 #undef  PLATFORM_STRING
37 #define PLATFORM_STRING "AIX"
38 #endif
39
40 #if defined(AMIGA) || defined(__AMIGA) || defined(__amigados__)
41 #define PLATFORM_AMIGA
42 #undef  PLATFORM_STRING
43 #define PLATFORM_STRING "AmigaOS"
44 #endif
45
46 #if defined(__BEOS__)
47 #define PLATFORM_BEOS
48 #undef  PLATFORM_STRING
49 #define PLATFORM_STRING "BeOS"
50 #endif
51
52 #if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
53 #define PLATFORM_BSDI
54 #define PLATFORM_BSD
55 #undef  PLATFORM_STRING
56 #define PLATFORM_STRING "BSDI"
57 #endif
58
59 #if defined(_arch_dreamcast)
60 #define PLATFORM_DREAMCAST
61 #undef  PLATFORM_STRING
62 #define PLATFORM_STRING "Dreamcast"
63 #endif
64
65 #if defined(__FreeBSD__) || defined(__DragonFly__)
66 #define PLATFORM_FREEBSD
67 #define PLATFORM_BSD
68 #undef  PLATFORM_STRING
69 #define PLATFORM_STRING "FreeBSD"
70 #endif
71
72 #if defined(hpux) || defined(__hpux) || defined(__hpux__)
73 #define PLATFORM_HPUX
74 #undef  PLATFORM_STRING
75 #define PLATFORM_STRING "HP-UX"
76 #endif
77
78 #if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
79 #define PLATFORM_IRIX
80 #undef  PLATFORM_STRING
81 #define PLATFORM_STRING "IRIX"
82 #endif
83
84 #if defined(linux) || defined(__linux) || defined(__linux__)
85 #define PLATFORM_LINUX
86 #undef  PLATFORM_STRING
87 #define PLATFORM_STRING "Linux"
88 #endif
89
90 #if defined(__APPLE__) && defined(__MACH__)
91 #define PLATFORM_MACOSX
92 #undef  PLATFORM_STRING
93 #define PLATFORM_STRING "Mac OS X"
94 #endif
95
96 #if defined(__NetBSD__)
97 #define PLATFORM_NETBSD
98 #define PLATFORM_BSD
99 #undef  PLATFORM_STRING
100 #define PLATFORM_STRING "NetBSD"
101 #endif
102
103 #if defined(NeXT)
104 #define PLATFORM_NEXT
105 #undef  PLATFORM_STRING
106 #define PLATFORM_STRING "NeXT"
107 #endif
108
109 #if defined(__OpenBSD__)
110 #define PLATFORM_OPENBSD
111 #define PLATFORM_BSD
112 #undef  PLATFORM_STRING
113 #define PLATFORM_STRING "OpenBSD"
114 #endif
115
116 #if defined(__OS2__)
117 #define PLATFORM_OS2
118 #undef  PLATFORM_STRING
119 #define PLATFORM_STRING "OS/2"
120 #endif
121
122 #if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
123 #define PLATFORM_OSF
124 #undef  PLATFORM_STRING
125 #define PLATFORM_STRING "OSF/1"
126 #endif
127
128 #if defined(__QNXNTO__)
129 #define PLATFORM_QNX
130 #undef  PLATFORM_STRING
131 #define PLATFORM_STRING "QNX"
132 #endif
133
134 #if defined(riscos) || defined(__riscos) || defined(__riscos__)
135 #define PLATFORM_RISCOS
136 #undef  PLATFORM_STRING
137 #define PLATFORM_STRING "RISC OS"
138 #endif
139
140 #if defined(sparc) || defined(sun) || defined(__SVR4)
141 #define PLATFORM_SOLARIS
142 #undef  PLATFORM_STRING
143 #define PLATFORM_STRING "Solaris"
144 #endif
145
146 #if defined(_WIN32_WCE)
147 #define PLATFORM_WINDOWS_CE
148 #undef  PLATFORM_STRING
149 #define PLATFORM_STRING "Windows CE"
150 #endif
151
152 #if defined(__ANDROID__)
153 #define PLATFORM_ANDROID
154 #undef  PLATFORM_STRING
155 #define PLATFORM_STRING "Android"
156 #endif
157
158
159 /* ========================================================================= */
160 /* define additional target keywords                                         */
161 /* ========================================================================= */
162
163 #if defined(TARGET_SDL2)
164 #ifndef TARGET_SDL
165 #define TARGET_SDL
166 #endif
167 #endif
168
169
170 /* ========================================================================= */
171 /* this should better go into "system.h" or "features.h" (yet to be created) */
172 /* ========================================================================= */
173
174 #if defined(PLATFORM_UNIX) || defined(TARGET_SDL)
175 #define NETWORK_AVALIABLE
176 #endif
177
178 #endif /* PLATFORM_H */