author | tron |
Sun, 17 Jul 2005 20:14:58 +0000 | |
changeset 2116 | 23031555ff54 |
parent 2107 | c7eb140bf9bb |
child 2125 | edc17858f9f6 |
permissions | -rw-r--r-- |
0 | 1 |
#if !defined(_STDAFX_H) |
2 |
#define _STDAFX_H |
|
3 |
||
4 |
#if defined(_MSC_VER) |
|
5 |
#pragma once |
|
6 |
||
7 |
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers |
|
8 |
#pragma warning(disable: 4100) // parameter not used |
|
9 |
#pragma warning(disable: 4244) // conversion |
|
10 |
#pragma warning(disable: 4245) // conversion |
|
2051 | 11 |
#pragma warning(disable: 4305) // 'initializing' : truncation from 'const int ' to 'char ' |
2107
c7eb140bf9bb
(svn r2617) - Fix: fix some warnings, and reenable vs.net2003 signed/unsigned warnings
Darkvater
parents:
2051
diff
changeset
|
12 |
//#pragma warning(disable: 4018) // warning C4018: '==' : signed/unsigned mismatch |
0 | 13 |
#pragma warning(disable: 4201) // nameless union |
14 |
#pragma warning(disable: 4514) // removed unref inline |
|
15 |
#pragma warning(disable: 4127) // constant conditional expression |
|
16 |
#pragma warning(disable: 4276) // MSVC BUG??? Complains about function body not declared when using function pointers |
|
17 |
#pragma warning(disable: 4761) // warning C4761: integral size mismatch in argument; conversion supplied |
|
18 |
#endif |
|
19 |
||
20 |
#include <stdio.h> |
|
21 |
#include <assert.h> |
|
22 |
#include <string.h> |
|
23 |
#include <stdlib.h> |
|
24 |
||
858
9a3254670831
(svn r1339) -Fix: compilation with networking works on MinGW32 again (thx orudge).
darkvater
parents:
796
diff
changeset
|
25 |
#if defined(UNIX) || defined(__MINGW32__) |
0 | 26 |
# include <sys/types.h> |
27 |
#endif |
|
28 |
||
781
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
770
diff
changeset
|
29 |
#if defined(__OS2__) |
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
770
diff
changeset
|
30 |
# include <types.h> |
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
770
diff
changeset
|
31 |
#endif |
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
770
diff
changeset
|
32 |
|
0 | 33 |
#ifdef __BEOS__ |
34 |
#include <SupportDefs.h> |
|
35 |
#endif |
|
36 |
||
446
7a92ca9738e2
(svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents:
425
diff
changeset
|
37 |
#ifdef SUNOS |
7a92ca9738e2
(svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents:
425
diff
changeset
|
38 |
#include <alloca.h> |
7a92ca9738e2
(svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents:
425
diff
changeset
|
39 |
#endif |
7a92ca9738e2
(svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents:
425
diff
changeset
|
40 |
|
770
c2eacca29601
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
569
diff
changeset
|
41 |
#ifdef __MORPHOS__ |
915 | 42 |
// morphos defines certain amiga defines per default, we undefine them |
770
c2eacca29601
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
569
diff
changeset
|
43 |
// here to make the rest of source less messy and more clear what is |
c2eacca29601
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
569
diff
changeset
|
44 |
// required for morphos and what for amigaos |
c2eacca29601
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
569
diff
changeset
|
45 |
# ifdef amigaos |
c2eacca29601
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
569
diff
changeset
|
46 |
# undef amigaos |
c2eacca29601
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
569
diff
changeset
|
47 |
# endif |
c2eacca29601
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
569
diff
changeset
|
48 |
# ifdef __amigaos__ |
c2eacca29601
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
569
diff
changeset
|
49 |
# undef __amigaos__ |
c2eacca29601
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
569
diff
changeset
|
50 |
# endif |
c2eacca29601
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
569
diff
changeset
|
51 |
# ifdef __AMIGA__ |
c2eacca29601
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
569
diff
changeset
|
52 |
# undef __AMIGA__ |
c2eacca29601
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
569
diff
changeset
|
53 |
# endif |
c2eacca29601
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
569
diff
changeset
|
54 |
# ifdef AMIGA |
c2eacca29601
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
569
diff
changeset
|
55 |
# undef AMIGA |
c2eacca29601
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
569
diff
changeset
|
56 |
# endif |
c2eacca29601
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
569
diff
changeset
|
57 |
# ifdef amiga |
c2eacca29601
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
569
diff
changeset
|
58 |
# undef amiga |
c2eacca29601
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
569
diff
changeset
|
59 |
# endif |
c2eacca29601
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
569
diff
changeset
|
60 |
#endif /* __MORPHOS__ */ |
c2eacca29601
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
569
diff
changeset
|
61 |
|
0 | 62 |
#define BSWAP32(x) ((((x) >> 24) & 0xFF) | (((x) >> 8) & 0xFF00) | (((x) << 8) & 0xFF0000) | (((x) << 24) & 0xFF000000)) |
63 |
#define BSWAP16(x) ((x) >> 8 | (x) << 8) |
|
64 |
||
65 |
// by default we use [] var arrays |
|
66 |
#define VARARRAY_SIZE |
|
67 |
||
68 |
||
69 |
// Stuff for GCC |
|
70 |
#if defined(__GNUC__) |
|
71 |
# define NORETURN |
|
72 |
# define FORCEINLINE inline |
|
73 |
# define CDECL |
|
74 |
//#include <alloca.h> |
|
75 |
//#include <malloc.h> |
|
76 |
# define __int64 long long |
|
1881
435d39bd6ee0
(svn r2387) - CodeChange: made the saveload code more readable and also removed the 'byte' saveload arrays which means you can save an array of more than 255 elements, or bigger structs than 255 bytes. This doesn't yet solve the problem that a chunk can be a maximum of 16384 big.
Darkvater
parents:
1812
diff
changeset
|
77 |
# define NOT_REACHED() assert(0) |
0 | 78 |
# define GCC_PACK __attribute__((packed)) |
79 |
||
80 |
# if (__GNUC__ == 2) |
|
81 |
# undef VARARRAY_SIZE |
|
82 |
# define VARARRAY_SIZE 0 |
|
83 |
# endif |
|
84 |
#endif |
|
85 |
||
781
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
770
diff
changeset
|
86 |
#if defined(__WATCOMC__) |
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
770
diff
changeset
|
87 |
# define NORETURN |
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
770
diff
changeset
|
88 |
# define FORCEINLINE inline |
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
770
diff
changeset
|
89 |
# define CDECL |
1881
435d39bd6ee0
(svn r2387) - CodeChange: made the saveload code more readable and also removed the 'byte' saveload arrays which means you can save an array of more than 255 elements, or bigger structs than 255 bytes. This doesn't yet solve the problem that a chunk can be a maximum of 16384 big.
Darkvater
parents:
1812
diff
changeset
|
90 |
# define NOT_REACHED() assert(0) |
781
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
770
diff
changeset
|
91 |
# define GCC_PACK |
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
770
diff
changeset
|
92 |
# undef TTD_ALIGNMENT_4 |
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
770
diff
changeset
|
93 |
# undef TTD_ALIGNMENT_2 |
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
770
diff
changeset
|
94 |
|
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
770
diff
changeset
|
95 |
# include <malloc.h> |
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
770
diff
changeset
|
96 |
#endif |
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
770
diff
changeset
|
97 |
|
796 | 98 |
#if defined(__MINGW32__) || defined(__CYGWIN__) |
99 |
#include <malloc.h> // alloca() |
|
100 |
#endif |
|
101 |
||
0 | 102 |
// Stuff for MSVC |
103 |
#if defined(_MSC_VER) |
|
104 |
# include <malloc.h> // alloca() |
|
105 |
# define NORETURN __declspec(noreturn) |
|
106 |
# define FORCEINLINE __forceinline |
|
500
8e52f7797b48
(svn r793) Merge INLINE -> inline replacement (revision 376)
tron
parents:
446
diff
changeset
|
107 |
# define inline _inline |
0 | 108 |
# define CDECL _cdecl |
1881
435d39bd6ee0
(svn r2387) - CodeChange: made the saveload code more readable and also removed the 'byte' saveload arrays which means you can save an array of more than 255 elements, or bigger structs than 255 bytes. This doesn't yet solve the problem that a chunk can be a maximum of 16384 big.
Darkvater
parents:
1812
diff
changeset
|
109 |
# if defined(_DEBUG) |
435d39bd6ee0
(svn r2387) - CodeChange: made the saveload code more readable and also removed the 'byte' saveload arrays which means you can save an array of more than 255 elements, or bigger structs than 255 bytes. This doesn't yet solve the problem that a chunk can be a maximum of 16384 big.
Darkvater
parents:
1812
diff
changeset
|
110 |
# define NOT_REACHED() assert(0) |
435d39bd6ee0
(svn r2387) - CodeChange: made the saveload code more readable and also removed the 'byte' saveload arrays which means you can save an array of more than 255 elements, or bigger structs than 255 bytes. This doesn't yet solve the problem that a chunk can be a maximum of 16384 big.
Darkvater
parents:
1812
diff
changeset
|
111 |
# else |
435d39bd6ee0
(svn r2387) - CodeChange: made the saveload code more readable and also removed the 'byte' saveload arrays which means you can save an array of more than 255 elements, or bigger structs than 255 bytes. This doesn't yet solve the problem that a chunk can be a maximum of 16384 big.
Darkvater
parents:
1812
diff
changeset
|
112 |
# define NOT_REACHED() _assume(0) |
435d39bd6ee0
(svn r2387) - CodeChange: made the saveload code more readable and also removed the 'byte' saveload arrays which means you can save an array of more than 255 elements, or bigger structs than 255 bytes. This doesn't yet solve the problem that a chunk can be a maximum of 16384 big.
Darkvater
parents:
1812
diff
changeset
|
113 |
# endif |
1022
d5ec3467d2a4
(svn r1523) -Fix: somehow mousewheel was disabled on windows using SDL; reenabled again
darkvater
parents:
915
diff
changeset
|
114 |
int CDECL snprintf(char *str, size_t size, const char *format, ...); |
d5ec3467d2a4
(svn r1523) -Fix: somehow mousewheel was disabled on windows using SDL; reenabled again
darkvater
parents:
915
diff
changeset
|
115 |
int CDECL vsnprintf(char *str, size_t size, const char *format, va_list ap); |
0 | 116 |
# undef TTD_ALIGNMENT_4 |
117 |
# undef TTD_ALIGNMENT_2 |
|
118 |
# define GCC_PACK |
|
119 |
#endif |
|
120 |
||
157
dd017fa3bad8
(svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents:
0
diff
changeset
|
121 |
// Windows has always LITTLE_ENDIAN |
781
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
770
diff
changeset
|
122 |
#if defined(WIN32) || defined(__OS2__) |
157
dd017fa3bad8
(svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents:
0
diff
changeset
|
123 |
#define TTD_LITTLE_ENDIAN |
dd017fa3bad8
(svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents:
0
diff
changeset
|
124 |
#else |
1721
e2887b445ac0
(svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents:
1317
diff
changeset
|
125 |
// Else include endian[target/host].h, which has the endian-type, autodetected by the Makefile |
e2887b445ac0
(svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents:
1317
diff
changeset
|
126 |
#if defined(STRGEN) |
e2887b445ac0
(svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents:
1317
diff
changeset
|
127 |
#include "endian_host.h" |
e2887b445ac0
(svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents:
1317
diff
changeset
|
128 |
#else |
e2887b445ac0
(svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents:
1317
diff
changeset
|
129 |
#include "endian_target.h" |
e2887b445ac0
(svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents:
1317
diff
changeset
|
130 |
#endif |
0 | 131 |
#endif |
132 |
||
133 |
#if defined(UNIX) |
|
134 |
#define PATHSEP "/" |
|
135 |
#else |
|
136 |
#define PATHSEP "\\" |
|
137 |
#endif |
|
138 |
||
139 |
||
140 |
typedef unsigned char byte; |
|
141 |
#ifndef __BEOS__ // already defined |
|
142 |
typedef unsigned char uint8; |
|
143 |
typedef unsigned short uint16; |
|
144 |
typedef unsigned int uint32; |
|
145 |
#endif |
|
146 |
||
147 |
// This is already defined in unix |
|
1812
26b041a529e9
(svn r2316) - Fix: [ 1154454 ] Fix BeOS build on Trunk (myob)
Darkvater
parents:
1721
diff
changeset
|
148 |
#if !defined(UNIX) && !defined(__CYGWIN__) && !defined(__BEOS__) |
0 | 149 |
typedef unsigned int uint; |
150 |
#endif |
|
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
151 |
// Not defined in QNX Neutrino (6.x) |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
152 |
#if defined(__QNXNTO__) |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
153 |
typedef unsigned int uint; |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
154 |
#endif |
0 | 155 |
|
156 |
#ifndef __BEOS__ |
|
157 |
typedef signed char int8; |
|
158 |
typedef signed short int16; |
|
159 |
typedef signed int int32; |
|
160 |
#ifndef __cplusplus |
|
161 |
typedef unsigned char bool; |
|
162 |
#endif |
|
163 |
typedef signed __int64 int64; |
|
164 |
typedef unsigned __int64 uint64; |
|
165 |
#endif |
|
166 |
||
167 |
// Setup alignment and conversion macros |
|
168 |
#if defined(TTD_BIG_ENDIAN) |
|
275
9f810ad00b60
(svn r281) -Fix: some endian issues fixed in network code
signde
parents:
193
diff
changeset
|
169 |
|
0 | 170 |
# define TTD_ALIGNMENT_2 |
171 |
# define TTD_ALIGNMENT_4 |
|
275
9f810ad00b60
(svn r281) -Fix: some endian issues fixed in network code
signde
parents:
193
diff
changeset
|
172 |
|
500
8e52f7797b48
(svn r793) Merge INLINE -> inline replacement (revision 376)
tron
parents:
446
diff
changeset
|
173 |
static inline uint32 TO_LE32(uint32 x) { return BSWAP32(x); } |
8e52f7797b48
(svn r793) Merge INLINE -> inline replacement (revision 376)
tron
parents:
446
diff
changeset
|
174 |
static inline uint16 TO_LE16(uint16 x) { return BSWAP16(x); } |
8e52f7797b48
(svn r793) Merge INLINE -> inline replacement (revision 376)
tron
parents:
446
diff
changeset
|
175 |
static inline uint32 FROM_LE32(uint32 x) { return BSWAP32(x); } |
8e52f7797b48
(svn r793) Merge INLINE -> inline replacement (revision 376)
tron
parents:
446
diff
changeset
|
176 |
static inline uint16 FROM_LE16(uint16 x) { return BSWAP16(x); } |
275
9f810ad00b60
(svn r281) -Fix: some endian issues fixed in network code
signde
parents:
193
diff
changeset
|
177 |
#define TO_BE32(x) x |
9f810ad00b60
(svn r281) -Fix: some endian issues fixed in network code
signde
parents:
193
diff
changeset
|
178 |
#define TO_BE16(x) x |
9f810ad00b60
(svn r281) -Fix: some endian issues fixed in network code
signde
parents:
193
diff
changeset
|
179 |
#define FROM_BE32(x) x |
9f810ad00b60
(svn r281) -Fix: some endian issues fixed in network code
signde
parents:
193
diff
changeset
|
180 |
#define FROM_BE16(x) x |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
157
diff
changeset
|
181 |
#define TO_BE32X(x) x |
275
9f810ad00b60
(svn r281) -Fix: some endian issues fixed in network code
signde
parents:
193
diff
changeset
|
182 |
|
0 | 183 |
#else |
275
9f810ad00b60
(svn r281) -Fix: some endian issues fixed in network code
signde
parents:
193
diff
changeset
|
184 |
|
536 | 185 |
static inline uint32 TO_BE32(uint32 x) { return BSWAP32(x); } |
186 |
static inline uint16 TO_BE16(uint16 x) { return BSWAP16(x); } |
|
187 |
static inline uint32 FROM_BE32(uint32 x) { return BSWAP32(x); } |
|
188 |
static inline uint16 FROM_BE16(uint16 x) { return BSWAP16(x); } |
|
275
9f810ad00b60
(svn r281) -Fix: some endian issues fixed in network code
signde
parents:
193
diff
changeset
|
189 |
#define TO_LE32(x) x |
9f810ad00b60
(svn r281) -Fix: some endian issues fixed in network code
signde
parents:
193
diff
changeset
|
190 |
#define TO_LE16(x) x |
9f810ad00b60
(svn r281) -Fix: some endian issues fixed in network code
signde
parents:
193
diff
changeset
|
191 |
#define TO_BE32X(x) BSWAP32(x) |
9f810ad00b60
(svn r281) -Fix: some endian issues fixed in network code
signde
parents:
193
diff
changeset
|
192 |
#define FROM_LE32(x) x |
9f810ad00b60
(svn r281) -Fix: some endian issues fixed in network code
signde
parents:
193
diff
changeset
|
193 |
#define FROM_LE16(x) x |
9f810ad00b60
(svn r281) -Fix: some endian issues fixed in network code
signde
parents:
193
diff
changeset
|
194 |
|
0 | 195 |
#endif |
196 |
||
197 |
#if !defined(GAME_DATA_DIR) |
|
198 |
#define GAME_DATA_DIR "" |
|
199 |
#endif |
|
200 |
||
201 |
#if !defined(PERSONAL_DIR) |
|
202 |
#define PERSONAL_DIR "" |
|
203 |
#endif |
|
204 |
||
205 |
#ifndef __cplusplus |
|
206 |
#ifndef __BEOS__ |
|
207 |
enum { |
|
208 |
false = 0, |
|
209 |
true = 1, |
|
210 |
}; |
|
211 |
#endif |
|
212 |
#endif |
|
213 |
||
214 |
// Compile time assertions |
|
781
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
770
diff
changeset
|
215 |
#ifdef __OS2__ |
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
770
diff
changeset
|
216 |
# define assert_compile(expr) |
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
770
diff
changeset
|
217 |
#else |
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
770
diff
changeset
|
218 |
# define assert_compile(expr) void __ct_assert__(int a[1 - 2 * !(expr)]) |
4c9177888196
(svn r1248) -Add: initial OS/2 support (read docs/ReadMe_OS2.txt) (orudge)
truelight
parents:
770
diff
changeset
|
219 |
#endif |
0 | 220 |
|
221 |
assert_compile(sizeof(uint32) == 4); |
|
222 |
assert_compile(sizeof(uint16) == 2); |
|
223 |
assert_compile(sizeof(uint8) == 1); |
|
224 |
||
225 |
#define lengthof(x) (sizeof(x)/sizeof(x[0])) |
|
226 |
#define endof(x) (&x[lengthof(x)]) |
|
1317
3c90086ff34f
(svn r1821) Move generic string handling functions to string.[ch] and introduce stre{cpy,cat}, see string.h for their semantics
tron
parents:
1022
diff
changeset
|
227 |
#define lastof(x) (&x[lengthof(x) - 1]) |
0 | 228 |
#ifndef offsetof |
229 |
#define offsetof(s,m) (size_t)&(((s *)0)->m) |
|
230 |
#endif |
|
231 |
||
232 |
||
233 |
// take care of some name clashes on macos |
|
234 |
#if defined(__APPLE__) |
|
235 |
#define GetString OTTD_GetString |
|
236 |
#define DrawString OTTD_DrawString |
|
237 |
#define Random OTTD_Random |
|
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
536
diff
changeset
|
238 |
#define CloseConnection OTTD_CloseConnection |
0 | 239 |
#endif |
240 |
||
770
c2eacca29601
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
569
diff
changeset
|
241 |
#ifdef __AMIGA__ |
569
1e1755ba1572
(svn r980) Fixed issues where MorphOS would get problems if AmigaOS would get a port, since MorphOS also have the flag __AMIGA__ defined (Tokai)
bjarni
parents:
543
diff
changeset
|
242 |
// it seems AmigaOS already have a Point declared |
1e1755ba1572
(svn r980) Fixed issues where MorphOS would get problems if AmigaOS would get a port, since MorphOS also have the flag __AMIGA__ defined (Tokai)
bjarni
parents:
543
diff
changeset
|
243 |
#define Point OTTD_AMIGA_POINT |
1e1755ba1572
(svn r980) Fixed issues where MorphOS would get problems if AmigaOS would get a port, since MorphOS also have the flag __AMIGA__ defined (Tokai)
bjarni
parents:
543
diff
changeset
|
244 |
#endif |
1e1755ba1572
(svn r980) Fixed issues where MorphOS would get problems if AmigaOS would get a port, since MorphOS also have the flag __AMIGA__ defined (Tokai)
bjarni
parents:
543
diff
changeset
|
245 |
|
0 | 246 |
#endif // !defined(_STDAFX_H) |