7ac79f3bbeb2f43ab13376aa12b414a0e21abbe5
[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 keywords for supported main platforms (Unix, DOS and Windows)      */
19 /* ========================================================================= */
20
21 #if defined(MSDOS)
22 #define PLATFORM_MSDOS
23 #define PLATFORM_STRING "DOS"
24 #elif 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 keywords for MS-DOS platform                            */
35 /* ========================================================================= */
36
37 #if defined(PLATFORM_MSDOS)
38
39 #ifndef TARGET_ALLEGRO
40 #define TARGET_ALLEGRO
41 #endif
42
43 #ifndef TARGET_X11
44 #define TARGET_X11
45 #endif
46
47 #endif
48
49
50 /* ========================================================================= */
51 /* define additional keywords for several Unix platforms                     */
52 /* ========================================================================= */
53
54 #if defined(PLATFORM_UNIX) && defined(TARGET_X11)
55 #define TARGET_X11_NATIVE
56 #endif
57
58 #if defined(linux)
59 #define PLATFORM_LINUX
60 #undef  PLATFORM_STRING
61 #define PLATFORM_STRING "Linux"
62 #endif
63
64 #if defined(__FreeBSD__)
65 #define PLATFORM_FREEBSD
66 #define PLATFORM_BSD
67 #undef  PLATFORM_STRING
68 #define PLATFORM_STRING "FreeBSD"
69 #endif
70
71 #if defined(__NetBSD__)
72 #define PLATFORM_NETBSD
73 #define PLATFORM_BSD
74 #undef  PLATFORM_STRING
75 #define PLATFORM_STRING "NetBSD"
76 #endif
77
78 #if defined(__bsdi__)
79 #define PLATFORM_BSDI
80 #define PLATFORM_BSD
81 #undef  PLATFORM_STRING
82 #define PLATFORM_STRING "BSDI"
83 #endif
84
85 #if defined(sparc) && defined(sun)
86 #define PLATFORM_SUNOS
87 #undef  PLATFORM_STRING
88 #define PLATFORM_STRING "Solaris"
89 #endif
90
91 #if defined(__APPLE__) && defined(__MACH__)
92 #define PLATFORM_MACOSX
93 #undef  PLATFORM_STRING
94 #define PLATFORM_STRING "Mac OS X"
95 #endif
96
97 #if defined(NeXT)
98 #define PLATFORM_NEXT
99 #undef  PLATFORM_STRING
100 #define PLATFORM_STRING "NeXT"
101 #endif
102
103 /* detecting HP-UX by the following compiler keyword definitions:
104    - in K&R mode (the default), the HP C compiler defines "hpux"
105    - in ANSI mode (-Aa or -Ae), the HP C compiler defines "__hpux"
106    - the gcc (Gnu) C compiler defines "__hpux__"
107    Thanks to Jarkko Hietaniemi  for this note. */
108
109 #if defined(__hpux__) || defined(__hpux) || defined(hpux)
110 #define PLATFORM_HPUX
111 #undef  PLATFORM_STRING
112 #define PLATFORM_STRING "HP-UX"
113 #endif
114
115
116 /* ========================================================================= */
117 /* this should better go into "system.h" or "features.h" (yet to be created) */
118 /* ========================================================================= */
119
120 #if defined(PLATFORM_UNIX) || defined(TARGET_SDL)
121 #define NETWORK_AVALIABLE
122 #endif
123
124 #endif /* PLATFORM_H */