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