annotate src/stdafx.h @ 9390:45c874394355 draft

(svn r13301) -Fix [FS#1997]: resolve more MSVC 9 x64 warnings.
author rubidium <rubidium@openttd.org>
date Tue, 27 May 2008 21:41:00 +0000
parents 8b6ba58e370c
children 47924a4b2ad4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
1 /* $Id$ */
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
2
9111
d48433370037 (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium <rubidium@openttd.org>
parents: 9072
diff changeset
3 /** @file stdafx.h Definition of base types and functions in a cross-platform compatible way. */
6420
080aae477331 (svn r9556) -Documentation: doxygen and comment-style changes. 'R', 'S'.. The end of the preliminary work is near
belugas <belugas@openttd.org>
parents: 6285
diff changeset
4
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
5 #ifndef STDAFX_H
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
6 #define STDAFX_H
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
7
8373
a6209668c216 (svn r11939) -Codechange: some type fixes and very initial steps into supporting NDS by default. Based on work by Dominik.
rubidium <rubidium@openttd.org>
parents: 8292
diff changeset
8 #if defined(__NDS__)
a6209668c216 (svn r11939) -Codechange: some type fixes and very initial steps into supporting NDS by default. Based on work by Dominik.
rubidium <rubidium@openttd.org>
parents: 8292
diff changeset
9 #include <nds/jtypes.h>
a6209668c216 (svn r11939) -Codechange: some type fixes and very initial steps into supporting NDS by default. Based on work by Dominik.
rubidium <rubidium@openttd.org>
parents: 8292
diff changeset
10 /* NDS' types for uint32/int32 are based on longs, which causes
a6209668c216 (svn r11939) -Codechange: some type fixes and very initial steps into supporting NDS by default. Based on work by Dominik.
rubidium <rubidium@openttd.org>
parents: 8292
diff changeset
11 * trouble all over the place in OpenTTD. */
a6209668c216 (svn r11939) -Codechange: some type fixes and very initial steps into supporting NDS by default. Based on work by Dominik.
rubidium <rubidium@openttd.org>
parents: 8292
diff changeset
12 #define uint32 uint32_ugly_hack
a6209668c216 (svn r11939) -Codechange: some type fixes and very initial steps into supporting NDS by default. Based on work by Dominik.
rubidium <rubidium@openttd.org>
parents: 8292
diff changeset
13 #define int32 int32_ugly_hack
a6209668c216 (svn r11939) -Codechange: some type fixes and very initial steps into supporting NDS by default. Based on work by Dominik.
rubidium <rubidium@openttd.org>
parents: 8292
diff changeset
14 typedef unsigned int uint32_ugly_hack;
a6209668c216 (svn r11939) -Codechange: some type fixes and very initial steps into supporting NDS by default. Based on work by Dominik.
rubidium <rubidium@openttd.org>
parents: 8292
diff changeset
15 typedef signed int int32_ugly_hack;
a6209668c216 (svn r11939) -Codechange: some type fixes and very initial steps into supporting NDS by default. Based on work by Dominik.
rubidium <rubidium@openttd.org>
parents: 8292
diff changeset
16 #endif /* __NDS__ */
a6209668c216 (svn r11939) -Codechange: some type fixes and very initial steps into supporting NDS by default. Based on work by Dominik.
rubidium <rubidium@openttd.org>
parents: 8292
diff changeset
17
5820
f2218210a022 (svn r8382) -Fix (r8374): moved the include of stdint.h to the front of stdafx.h
bjarni <bjarni@openttd.org>
parents: 5812
diff changeset
18 /* It seems that we need to include stdint.h before anything else
f2218210a022 (svn r8382) -Fix (r8374): moved the include of stdint.h to the front of stdafx.h
bjarni <bjarni@openttd.org>
parents: 5812
diff changeset
19 * We need INT64_MAX, which for most systems comes from stdint.h. However, MSVC
f2218210a022 (svn r8382) -Fix (r8374): moved the include of stdint.h to the front of stdafx.h
bjarni <bjarni@openttd.org>
parents: 5812
diff changeset
20 * does not have stdint.h and apparently neither does MorphOS, so define
7775
315b179cfa8c (svn r11325) -Fix (r11312)[FS#1357]: [OSX] fixed compilation on OSX
bjarni <bjarni@openttd.org>
parents: 7405
diff changeset
21 * INT64_MAX for them ourselves.
315b179cfa8c (svn r11325) -Fix (r11312)[FS#1357]: [OSX] fixed compilation on OSX
bjarni <bjarni@openttd.org>
parents: 7405
diff changeset
22 * Sometimes OSX headers manages to include stdint.h before this but without
315b179cfa8c (svn r11325) -Fix (r11312)[FS#1357]: [OSX] fixed compilation on OSX
bjarni <bjarni@openttd.org>
parents: 7405
diff changeset
23 * __STDC_LIMIT_MACROS so it will be without INT64_*. We need to define those
315b179cfa8c (svn r11325) -Fix (r11312)[FS#1357]: [OSX] fixed compilation on OSX
bjarni <bjarni@openttd.org>
parents: 7405
diff changeset
24 * too if this is the case. */
315b179cfa8c (svn r11325) -Fix (r11312)[FS#1357]: [OSX] fixed compilation on OSX
bjarni <bjarni@openttd.org>
parents: 7405
diff changeset
25 #if !defined(_MSC_VER) && !defined( __MORPHOS__) && !defined(_STDINT_H_)
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
26 #if defined(SUNOS)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
27 /* SunOS/Solaris does not have stdint.h, but inttypes.h defines everything
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
28 * stdint.h defines and we need. */
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
29 #include <inttypes.h>
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
30 # else
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
31 #define __STDC_LIMIT_MACROS
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
32 #include <stdint.h>
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
33 #endif
5820
f2218210a022 (svn r8382) -Fix (r8374): moved the include of stdint.h to the front of stdafx.h
bjarni <bjarni@openttd.org>
parents: 5812
diff changeset
34 #else
8825
1603ed357fcb (svn r12573) -Codechange: use defined constants instead of numbers in math_func.hpp
smatz <smatz@openttd.org>
parents: 8823
diff changeset
35 #define UINT64_MAX (18446744073709551615ULL)
1603ed357fcb (svn r12573) -Codechange: use defined constants instead of numbers in math_func.hpp
smatz <smatz@openttd.org>
parents: 8823
diff changeset
36 #define INT64_MAX (9223372036854775807LL)
1603ed357fcb (svn r12573) -Codechange: use defined constants instead of numbers in math_func.hpp
smatz <smatz@openttd.org>
parents: 8823
diff changeset
37 #define INT64_MIN (-INT64_MAX - 1)
1603ed357fcb (svn r12573) -Codechange: use defined constants instead of numbers in math_func.hpp
smatz <smatz@openttd.org>
parents: 8823
diff changeset
38 #define UINT32_MAX (4294967295U)
1603ed357fcb (svn r12573) -Codechange: use defined constants instead of numbers in math_func.hpp
smatz <smatz@openttd.org>
parents: 8823
diff changeset
39 #define INT32_MAX (2147483647)
1603ed357fcb (svn r12573) -Codechange: use defined constants instead of numbers in math_func.hpp
smatz <smatz@openttd.org>
parents: 8823
diff changeset
40 #define INT32_MIN (-INT32_MAX - 1)
1603ed357fcb (svn r12573) -Codechange: use defined constants instead of numbers in math_func.hpp
smatz <smatz@openttd.org>
parents: 8823
diff changeset
41 #define UINT16_MAX (65535U)
1603ed357fcb (svn r12573) -Codechange: use defined constants instead of numbers in math_func.hpp
smatz <smatz@openttd.org>
parents: 8823
diff changeset
42 #define INT16_MAX (32767)
1603ed357fcb (svn r12573) -Codechange: use defined constants instead of numbers in math_func.hpp
smatz <smatz@openttd.org>
parents: 8823
diff changeset
43 #define INT16_MIN (-INT16_MAX - 1)
5820
f2218210a022 (svn r8382) -Fix (r8374): moved the include of stdint.h to the front of stdafx.h
bjarni <bjarni@openttd.org>
parents: 5812
diff changeset
44 #endif
f2218210a022 (svn r8382) -Fix (r8374): moved the include of stdint.h to the front of stdafx.h
bjarni <bjarni@openttd.org>
parents: 5812
diff changeset
45
5933
ee0256366578 (svn r8572) -Fix: use the C++ version of the Standard C Library headers. This due to the fact that some stl headers will include them anyway and #undef several defines made in stdafx.h.
rubidium <rubidium@openttd.org>
parents: 5843
diff changeset
46 #include <cstdio>
ee0256366578 (svn r8572) -Fix: use the C++ version of the Standard C Library headers. This due to the fact that some stl headers will include them anyway and #undef several defines made in stdafx.h.
rubidium <rubidium@openttd.org>
parents: 5843
diff changeset
47 #include <cstddef>
ee0256366578 (svn r8572) -Fix: use the C++ version of the Standard C Library headers. This due to the fact that some stl headers will include them anyway and #undef several defines made in stdafx.h.
rubidium <rubidium@openttd.org>
parents: 5843
diff changeset
48 #include <cstring>
ee0256366578 (svn r8572) -Fix: use the C++ version of the Standard C Library headers. This due to the fact that some stl headers will include them anyway and #undef several defines made in stdafx.h.
rubidium <rubidium@openttd.org>
parents: 5843
diff changeset
49 #include <cstdlib>
ee0256366578 (svn r8572) -Fix: use the C++ version of the Standard C Library headers. This due to the fact that some stl headers will include them anyway and #undef several defines made in stdafx.h.
rubidium <rubidium@openttd.org>
parents: 5843
diff changeset
50 #include <climits>
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
51
5934
3af431a1ae93 (svn r8573) -Cleanup: obey the comment style in stdafx.h.
rubidium <rubidium@openttd.org>
parents: 5933
diff changeset
52 /* MacOS X will use an NSAlert to display failed assertaions since they're lost unless running from a terminal
3af431a1ae93 (svn r8573) -Cleanup: obey the comment style in stdafx.h.
rubidium <rubidium@openttd.org>
parents: 5933
diff changeset
53 * strgen always runs from terminal and don't need a window for asserts */
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
54 #if !defined(__APPLE__) || defined(STRGEN)
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
55 #include <cassert>
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
56 #else
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
57 #include "os/macosx/macos.h"
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
58 #endif
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
59
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
60 #if defined(UNIX) || defined(__MINGW32__)
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
61 #include <sys/types.h>
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
62 #endif
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
63
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
64 #if defined(__OS2__)
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
65 #include <types.h>
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
66 #define strcasecmp stricmp
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
67 #endif
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
68
5976
93a644e6044b (svn r8674) [PSP] -Add: added network code for PSP, based on the work of Turulo
truelight <truelight@openttd.org>
parents: 5967
diff changeset
69 #if defined(PSP)
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
70 #include <psptypes.h>
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
71 #include <pspdebug.h>
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
72 #include <pspthreadman.h>
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
73 #endif
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
74
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
75 #if defined(__BEOS__)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
76 #include <SupportDefs.h>
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
77 #endif
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
78
9072
e197fbb0bbb8 (svn r12930) -Add: build support for NetBSD and HP-UX. Patch by ahoka.
rubidium <rubidium@openttd.org>
parents: 8983
diff changeset
79 #if defined(SUNOS) || defined(HPUX)
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
80 #include <alloca.h>
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
81 #endif
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
82
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
83 #if defined(__MORPHOS__)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
84 /* MorphOS defines certain Amiga defines per default, we undefine them
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
85 * here to make the rest of source less messy and more clear what is
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
86 * required for morphos and what for AmigaOS */
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
87 #if defined(amigaos)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
88 #undef amigaos
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
89 #endif
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
90 #if defined(__amigaos__)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
91 #undef __amigaos__
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
92 # endif
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
93 #if defined(__AMIGA__)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
94 #undef __AMIGA__
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
95 #endif
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
96 #if defined(AMIGA)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
97 #undef AMIGA
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
98 #endif
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
99 #if defined(amiga)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
100 #undef amiga
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
101 #endif
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
102 /* Act like we already included this file, as it somehow gives linkage problems
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
103 * (mismatch linkage of C++ and C between this include and unistd.h). */
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
104 #define CLIB_USERGROUP_PROTOS_H
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
105 #endif /* __MORPHOS__ */
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
106
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
107 #if defined(__APPLE__)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
108 #include "os/macosx/osx_stdafx.h"
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
109 #endif /* __APPLE__ */
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
110
5967
0516aee3881f (svn r8647) -Codechange: add a general way to handle platforms who can only have a limited amount of file-descripters open at any given time.
truelight <truelight@openttd.org>
parents: 5947
diff changeset
111 #if defined(PSP)
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
112 /* PSP can only have 10 file-descriptors open at any given time, but this
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
113 * switch only limits reads via the Fio system. So keep 2 fds free for things
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
114 * like saving a game. */
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
115 #define LIMITED_FDS 8
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
116 #define printf pspDebugScreenPrintf
5967
0516aee3881f (svn r8647) -Codechange: add a general way to handle platforms who can only have a limited amount of file-descripters open at any given time.
truelight <truelight@openttd.org>
parents: 5947
diff changeset
117 #endif /* PSP */
0516aee3881f (svn r8647) -Codechange: add a general way to handle platforms who can only have a limited amount of file-descripters open at any given time.
truelight <truelight@openttd.org>
parents: 5947
diff changeset
118
5934
3af431a1ae93 (svn r8573) -Cleanup: obey the comment style in stdafx.h.
rubidium <rubidium@openttd.org>
parents: 5933
diff changeset
119 /* by default we use [] var arrays */
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
120 #define VARARRAY_SIZE
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
121
5934
3af431a1ae93 (svn r8573) -Cleanup: obey the comment style in stdafx.h.
rubidium <rubidium@openttd.org>
parents: 5933
diff changeset
122 /* Stuff for GCC */
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
123 #if defined(__GNUC__)
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
124 #define NORETURN __attribute__ ((noreturn))
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
125 #define FORCEINLINE inline
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
126 #define CDECL
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
127 #define __int64 long long
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
128 #define GCC_PACK __attribute__((packed))
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
129
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
130 #if (__GNUC__ == 2)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
131 #undef VARARRAY_SIZE
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
132 #define VARARRAY_SIZE 0
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
133 #endif
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
134 #endif /* __GNUC__ */
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
135
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
136 #if defined(__WATCOMC__)
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
137 #define NORETURN
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
138 #define FORCEINLINE inline
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
139 #define CDECL
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
140 #define GCC_PACK
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
141 #include <malloc.h>
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
142 #endif /* __WATCOMC__ */
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
143
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
144 #if defined(__MINGW32__) || defined(__CYGWIN__)
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
145 #include <malloc.h> // alloca()
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
146 #endif
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
147
9256
8b6ba58e370c (svn r13122) -Fix: WIN32_LEAN_AND_MEAN define is needed for all WIN32 compilers
glx <glx@openttd.org>
parents: 9117
diff changeset
148 #if defined(WIN32)
8b6ba58e370c (svn r13122) -Fix: WIN32_LEAN_AND_MEAN define is needed for all WIN32 compilers
glx <glx@openttd.org>
parents: 9117
diff changeset
149 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
8b6ba58e370c (svn r13122) -Fix: WIN32_LEAN_AND_MEAN define is needed for all WIN32 compilers
glx <glx@openttd.org>
parents: 9117
diff changeset
150 #endif
8b6ba58e370c (svn r13122) -Fix: WIN32_LEAN_AND_MEAN define is needed for all WIN32 compilers
glx <glx@openttd.org>
parents: 9117
diff changeset
151
5934
3af431a1ae93 (svn r8573) -Cleanup: obey the comment style in stdafx.h.
rubidium <rubidium@openttd.org>
parents: 5933
diff changeset
152 /* Stuff for MSVC */
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
153 #if defined(_MSC_VER)
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
154 #pragma once
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
155 /* Define a win32 target platform, to override defaults of the SDK
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
156 * We need to define NTDDI version for Vista SDK, but win2k is minimum */
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
157 #define NTDDI_VERSION NTDDI_WIN2K // Windows 2000
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
158 #define _WIN32_WINNT 0x0500 // Windows 2000
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
159 #define _WIN32_WINDOWS 0x400 // Windows 95
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
160 #if !defined(WINCE)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
161 #define WINVER 0x0400 // Windows NT 4.0 / Windows 95
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
162 #endif
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
163 #define _WIN32_IE_ 0x0401 // 4.01 (win98 and NT4SP5+)
6194
bf3c126349b4 (svn r8974) -Fix: [win32] Define a win32 target platform ourselves so that we don't conflict with Vista Platform SDK (boekabart)
Darkvater <Darkvater@openttd.org>
parents: 6083
diff changeset
164
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
165 #pragma warning(disable: 4244) // 'conversion' conversion from 'type1' to 'type2', possible loss of data
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
166 #pragma warning(disable: 4761) // integral size mismatch in argument : conversion supplied
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
167 #pragma warning(disable: 4200) // nonstandard extension used : zero-sized array in struct/union
6194
bf3c126349b4 (svn r8974) -Fix: [win32] Define a win32 target platform ourselves so that we don't conflict with Vista Platform SDK (boekabart)
Darkvater <Darkvater@openttd.org>
parents: 6083
diff changeset
168
8409
7c5e4180e2b1 (svn r11979) -Codechange: drop MSVC 2003 support because MSVC 2003 is broken in such a manner that it triggers an internal compiler error without any clue what of the code is wrong. Even trying to bisect the problem does not give a single line of code that causes the trouble.
rubidium <rubidium@openttd.org>
parents: 8373
diff changeset
169 #if (_MSC_VER < 1400) // MSVC 2005 safety checks
7c5e4180e2b1 (svn r11979) -Codechange: drop MSVC 2003 support because MSVC 2003 is broken in such a manner that it triggers an internal compiler error without any clue what of the code is wrong. Even trying to bisect the problem does not give a single line of code that causes the trouble.
rubidium <rubidium@openttd.org>
parents: 8373
diff changeset
170 #error "Only MSVC 2005 or higher are supported. MSVC 2003 and earlier are not!. Upgrade your compiler."
7c5e4180e2b1 (svn r11979) -Codechange: drop MSVC 2003 support because MSVC 2003 is broken in such a manner that it triggers an internal compiler error without any clue what of the code is wrong. Even trying to bisect the problem does not give a single line of code that causes the trouble.
rubidium <rubidium@openttd.org>
parents: 8373
diff changeset
171 #endif /* (_MSC_VER < 1400) */
7c5e4180e2b1 (svn r11979) -Codechange: drop MSVC 2003 support because MSVC 2003 is broken in such a manner that it triggers an internal compiler error without any clue what of the code is wrong. Even trying to bisect the problem does not give a single line of code that causes the trouble.
rubidium <rubidium@openttd.org>
parents: 8373
diff changeset
172 #pragma warning(disable: 4996) // 'strdup' was declared deprecated
7c5e4180e2b1 (svn r11979) -Codechange: drop MSVC 2003 support because MSVC 2003 is broken in such a manner that it triggers an internal compiler error without any clue what of the code is wrong. Even trying to bisect the problem does not give a single line of code that causes the trouble.
rubidium <rubidium@openttd.org>
parents: 8373
diff changeset
173 #define _CRT_SECURE_NO_DEPRECATE // all deprecated 'unsafe string functions
7c5e4180e2b1 (svn r11979) -Codechange: drop MSVC 2003 support because MSVC 2003 is broken in such a manner that it triggers an internal compiler error without any clue what of the code is wrong. Even trying to bisect the problem does not give a single line of code that causes the trouble.
rubidium <rubidium@openttd.org>
parents: 8373
diff changeset
174 #pragma warning(disable: 6308) // code analyzer: 'realloc' might return null pointer: assigning null pointer to 't_ptr', which is passed as an argument to 'realloc', will cause the original memory block to be leaked
7c5e4180e2b1 (svn r11979) -Codechange: drop MSVC 2003 support because MSVC 2003 is broken in such a manner that it triggers an internal compiler error without any clue what of the code is wrong. Even trying to bisect the problem does not give a single line of code that causes the trouble.
rubidium <rubidium@openttd.org>
parents: 8373
diff changeset
175 #pragma warning(disable: 6011) // code analyzer: Dereferencing NULL pointer 'pfGetAddrInfo': Lines: 995, 996, 998, 999, 1001
7c5e4180e2b1 (svn r11979) -Codechange: drop MSVC 2003 support because MSVC 2003 is broken in such a manner that it triggers an internal compiler error without any clue what of the code is wrong. Even trying to bisect the problem does not give a single line of code that causes the trouble.
rubidium <rubidium@openttd.org>
parents: 8373
diff changeset
176 #pragma warning(disable: 6326) // code analyzer: potential comparison of a constant with another constant
7c5e4180e2b1 (svn r11979) -Codechange: drop MSVC 2003 support because MSVC 2003 is broken in such a manner that it triggers an internal compiler error without any clue what of the code is wrong. Even trying to bisect the problem does not give a single line of code that causes the trouble.
rubidium <rubidium@openttd.org>
parents: 8373
diff changeset
177 #pragma warning(disable: 6031) // code analyzer: Return value ignored: 'ReadFile'
7c5e4180e2b1 (svn r11979) -Codechange: drop MSVC 2003 support because MSVC 2003 is broken in such a manner that it triggers an internal compiler error without any clue what of the code is wrong. Even trying to bisect the problem does not give a single line of code that causes the trouble.
rubidium <rubidium@openttd.org>
parents: 8373
diff changeset
178 #pragma warning(disable: 6255) // code analyzer: _alloca indicates failure by raising a stack overflow exception. Consider using _malloca instead
7c5e4180e2b1 (svn r11979) -Codechange: drop MSVC 2003 support because MSVC 2003 is broken in such a manner that it triggers an internal compiler error without any clue what of the code is wrong. Even trying to bisect the problem does not give a single line of code that causes the trouble.
rubidium <rubidium@openttd.org>
parents: 8373
diff changeset
179 #pragma warning(disable: 6246) // code analyzer: Local declaration of 'statspec' hides declaration of the same name in outer scope. For additional information, see previous declaration at ...
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
180
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
181 #include <malloc.h> // alloca()
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
182 #define NORETURN __declspec(noreturn)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
183 #define FORCEINLINE __forceinline
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
184 #define inline _inline
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
185
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
186 #if !defined(WINCE)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
187 #define CDECL _cdecl
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
188 #endif
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
189
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
190 int CDECL snprintf(char *str, size_t size, const char *format, ...);
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
191 #if (_MSC_VER < 1400) || defined(WINCE)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
192 int CDECL vsnprintf(char *str, size_t size, const char *format, va_list ap);
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
193 #endif
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
194
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
195 #if defined(WIN32) && !defined(_WIN64) && !defined(WIN64)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
196 #if !defined(_W64)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
197 #define _W64
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
198 #endif
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
199
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
200 typedef _W64 int INT_PTR, *PINT_PTR;
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
201 typedef _W64 unsigned int UINT_PTR, *PUINT_PTR;
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
202 #endif /* WIN32 && !_WIN64 && !WIN64 */
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
203
9390
45c874394355 (svn r13301) -Fix [FS#1997]: resolve more MSVC 9 x64 warnings.
rubidium <rubidium@openttd.org>
parents: 9256
diff changeset
204 #if defined(_WIN64) || defined(WIN64)
45c874394355 (svn r13301) -Fix [FS#1997]: resolve more MSVC 9 x64 warnings.
rubidium <rubidium@openttd.org>
parents: 9256
diff changeset
205 #define fseek _fseeki64
45c874394355 (svn r13301) -Fix [FS#1997]: resolve more MSVC 9 x64 warnings.
rubidium <rubidium@openttd.org>
parents: 9256
diff changeset
206 #endif /* _WIN64 || WIN64 */
45c874394355 (svn r13301) -Fix [FS#1997]: resolve more MSVC 9 x64 warnings.
rubidium <rubidium@openttd.org>
parents: 9256
diff changeset
207
45c874394355 (svn r13301) -Fix [FS#1997]: resolve more MSVC 9 x64 warnings.
rubidium <rubidium@openttd.org>
parents: 9256
diff changeset
208
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
209 #define GCC_PACK
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
210
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
211 /* This is needed to zlib uses the stdcall calling convention on visual studio */
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
212 #if defined(WITH_ZLIB) || defined(WITH_PNG)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
213 #if !defined(ZLIB_WINAPI)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
214 #define ZLIB_WINAPI
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
215 #endif
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
216 #endif
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
217
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
218 #if defined(WINCE)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
219 #define strcasecmp _stricmp
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
220 #define strncasecmp _strnicmp
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
221 #undef DEBUG
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
222 #else
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
223 #define strcasecmp stricmp
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
224 #define strncasecmp strnicmp
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
225 #endif
8051
ac548999eddf (svn r11611) -Codechange: it is now possible to use a define to enable asserts and show them in crash.log for MSVC release builds
glx <glx@openttd.org>
parents: 8050
diff changeset
226
ac548999eddf (svn r11611) -Codechange: it is now possible to use a define to enable asserts and show them in crash.log for MSVC release builds
glx <glx@openttd.org>
parents: 8050
diff changeset
227 void SetExceptionString(const char* s, ...);
ac548999eddf (svn r11611) -Codechange: it is now possible to use a define to enable asserts and show them in crash.log for MSVC release builds
glx <glx@openttd.org>
parents: 8050
diff changeset
228
ac548999eddf (svn r11611) -Codechange: it is now possible to use a define to enable asserts and show them in crash.log for MSVC release builds
glx <glx@openttd.org>
parents: 8050
diff changeset
229 #if defined(NDEBUG) && defined(WITH_ASSERT)
ac548999eddf (svn r11611) -Codechange: it is now possible to use a define to enable asserts and show them in crash.log for MSVC release builds
glx <glx@openttd.org>
parents: 8050
diff changeset
230 #undef assert
ac548999eddf (svn r11611) -Codechange: it is now possible to use a define to enable asserts and show them in crash.log for MSVC release builds
glx <glx@openttd.org>
parents: 8050
diff changeset
231 #define assert(expression) if (!(expression)) { SetExceptionString("Assertion failed at %s:%d: %s", __FILE__, __LINE__, #expression); *(byte*)0 = 0; }
ac548999eddf (svn r11611) -Codechange: it is now possible to use a define to enable asserts and show them in crash.log for MSVC release builds
glx <glx@openttd.org>
parents: 8050
diff changeset
232 #endif
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
233 #endif /* defined(_MSC_VER) */
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
234
5755
81b21aaedc57 (svn r8306) [WinCE] -Fix: some functions don't exists in WinCE, so give an alternative where possible
truelight <truelight@openttd.org>
parents: 5671
diff changeset
235 #if defined(WINCE)
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
236 #define strdup _strdup
5755
81b21aaedc57 (svn r8306) [WinCE] -Fix: some functions don't exists in WinCE, so give an alternative where possible
truelight <truelight@openttd.org>
parents: 5671
diff changeset
237 #endif /* WINCE */
81b21aaedc57 (svn r8306) [WinCE] -Fix: some functions don't exists in WinCE, so give an alternative where possible
truelight <truelight@openttd.org>
parents: 5671
diff changeset
238
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
239 /* NOTE: the string returned by these functions is only valid until the next
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
240 * call to the same function and is not thread- or reentrancy-safe */
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
241 #if !defined(STRGEN)
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
242 #if defined(WIN32) || defined(WIN64)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
243 char *getcwd(char *buf, size_t size);
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
244 #include <tchar.h>
6251
9953c75f16bc (svn r9055) -Codechange: Change windows unicode handling and allow a pure non-unicode build to function. Win9x binaries will be possible with mingw/nightly system.
Darkvater <Darkvater@openttd.org>
parents: 6233
diff changeset
245
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
246 /* XXX - WinCE without MSVCRT doesn't support wfopen, so it seems */
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
247 #if !defined(WINCE)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
248 #define fopen(file, mode) _tfopen(OTTD2FS(file), _T(mode))
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
249 #endif /* WINCE */
6251
9953c75f16bc (svn r9055) -Codechange: Change windows unicode handling and allow a pure non-unicode build to function. Win9x binaries will be possible with mingw/nightly system.
Darkvater <Darkvater@openttd.org>
parents: 6233
diff changeset
250
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
251 const char *FS2OTTD(const TCHAR *name);
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
252 const TCHAR *OTTD2FS(const char *name);
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
253 #else
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
254 #define fopen(file, mode) fopen(OTTD2FS(file), mode)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
255 const char *FS2OTTD(const char *name);
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
256 const char *OTTD2FS(const char *name);
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
257 #endif /* WIN32 */
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
258 #endif /* STRGEN */
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
259
5591
cf00a1ba52bc (svn r8042) - Fix: OS/2 compilation with GCC (thanks to Paul Smedley and TrueBrain for their help)
orudge <orudge@openttd.org>
parents: 5587
diff changeset
260 #if defined(WIN32) || defined(WIN64) || defined(__OS2__) && !defined(__INNOTEK_LIBC__)
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
261 #define PATHSEP "\\"
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
262 #define PATHSEPCHAR '\\'
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
263 #else
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
264 #define PATHSEP "/"
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
265 #define PATHSEPCHAR '/'
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
266 #endif
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
267
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
268 typedef unsigned char byte;
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
269
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
270 /* This is already defined in unix, but not in QNX Neutrino (6.x)*/
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
271 #if (!defined(UNIX) && !defined(__CYGWIN__) && !defined(__BEOS__) && !defined(__MORPHOS__)) || defined(__QNXNTO__)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
272 typedef unsigned int uint;
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
273 #endif
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
274
8373
a6209668c216 (svn r11939) -Codechange: some type fixes and very initial steps into supporting NDS by default. Based on work by Dominik.
rubidium <rubidium@openttd.org>
parents: 8292
diff changeset
275 #if !defined(__BEOS__) && !defined(__NDS__) /* Already defined on BEOS and NDS */
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
276 typedef unsigned char uint8;
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
277 typedef signed char int8;
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
278 typedef unsigned short uint16;
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
279 typedef signed short int16;
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
280 typedef unsigned int uint32;
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
281 typedef signed int int32;
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
282 typedef unsigned __int64 uint64;
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
283 typedef signed __int64 int64;
8373
a6209668c216 (svn r11939) -Codechange: some type fixes and very initial steps into supporting NDS by default. Based on work by Dominik.
rubidium <rubidium@openttd.org>
parents: 8292
diff changeset
284 #endif /* !__BEOS__ && !__NDS__ */
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
285
6929
bb43858bed10 (svn r10182) -Codechange: rewrite most part of the file loading/searching to be more flexible.
rubidium <rubidium@openttd.org>
parents: 6834
diff changeset
286 #if !defined(WITH_PERSONAL_DIR)
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
287 #define PERSONAL_DIR ""
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
288 #endif
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
289
5934
3af431a1ae93 (svn r8573) -Cleanup: obey the comment style in stdafx.h.
rubidium <rubidium@openttd.org>
parents: 5933
diff changeset
290 /* Compile time assertions */
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
291 #if defined(__OS2__)
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
292 #define assert_compile(expr)
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
293 #else
9117
453c3d26f4bc (svn r12977) -Codechange: remove quite some redundant (duplicate) function declarations.
rubidium <rubidium@openttd.org>
parents: 9111
diff changeset
294 #define assert_compile(expr) extern const int __ct_assert__[1 - 2 * !(expr)]
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
295 #endif /* __OS2__ */
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
296
8678
c662110e3c06 (svn r12344) -Codechange: Check uint64 bitsize on compiletime too.
skidd13 <skidd13@openttd.org>
parents: 8409
diff changeset
297 /* Check if the types have the bitsizes like we are using them */
c662110e3c06 (svn r12344) -Codechange: Check uint64 bitsize on compiletime too.
skidd13 <skidd13@openttd.org>
parents: 8409
diff changeset
298 assert_compile(sizeof(uint64) == 8);
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
299 assert_compile(sizeof(uint32) == 4);
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
300 assert_compile(sizeof(uint16) == 2);
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
301 assert_compile(sizeof(uint8) == 1);
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
302
9117
453c3d26f4bc (svn r12977) -Codechange: remove quite some redundant (duplicate) function declarations.
rubidium <rubidium@openttd.org>
parents: 9111
diff changeset
303 #define lengthof(x) (sizeof(x) / sizeof(x[0]))
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
304 #define endof(x) (&x[lengthof(x)])
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
305 #define lastof(x) (&x[lengthof(x) - 1])
5671
025a6bc5e2e5 (svn r8131) -Fix (r8125): g++ warning: 'invalid access to non-static data member ‘<class>::<member>’ of NULL object'. It is weird, but renaming the 'offsetof' macro helped.
KUDr <KUDr@openttd.org>
parents: 5591
diff changeset
306
8969
01cc3ee6ecb1 (svn r12761) -Codechange: lots of minor whitespace coding style fixes around operators.
rubidium <rubidium@openttd.org>
parents: 8825
diff changeset
307 #define cpp_offsetof(s, m) (((size_t)&reinterpret_cast<const volatile char&>((((s*)(char*)8)->m))) - 8)
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
308 #if !defined(offsetof)
8969
01cc3ee6ecb1 (svn r12761) -Codechange: lots of minor whitespace coding style fixes around operators.
rubidium <rubidium@openttd.org>
parents: 8825
diff changeset
309 #define offsetof(s, m) cpp_offsetof(s, m)
6083
37a5650e8596 (svn r8818) -Codechange: remove the #ifdef _cplusplus remnants.
rubidium <rubidium@openttd.org>
parents: 5976
diff changeset
310 #endif /* offsetof */
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
311
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
312
5934
3af431a1ae93 (svn r8573) -Cleanup: obey the comment style in stdafx.h.
rubidium <rubidium@openttd.org>
parents: 5933
diff changeset
313 /* take care of some name clashes on MacOS */
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
314 #if defined(__APPLE__)
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
315 #define GetString OTTD_GetString
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
316 #define DrawString OTTD_DrawString
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
317 #define CloseConnection OTTD_CloseConnection
8126
357c22303fd6 (svn r11687) -Codechange: move some defines to a better place
skidd13 <skidd13@openttd.org>
parents: 8123
diff changeset
318 #endif /* __APPLE__ */
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
319
8983
7feb6db6fe79 (svn r12777) -Codechange: rename fatal() and error() in strgen, so it can always have the NORETURN attribute
smatz <smatz@openttd.org>
parents: 8969
diff changeset
320 void NORETURN CDECL error(const char *str, ...);
6622
8bb80527a9e8 (svn r9842) -Codechange: now NOT_REACHED is also triggered when debugging is disabled.
rubidium <rubidium@openttd.org>
parents: 6524
diff changeset
321 #define NOT_REACHED() error("NOT_REACHED triggered at line %i of %s", __LINE__, __FILE__)
8bb80527a9e8 (svn r9842) -Codechange: now NOT_REACHED is also triggered when debugging is disabled.
rubidium <rubidium@openttd.org>
parents: 6524
diff changeset
322
8373
a6209668c216 (svn r11939) -Codechange: some type fixes and very initial steps into supporting NDS by default. Based on work by Dominik.
rubidium <rubidium@openttd.org>
parents: 8292
diff changeset
323 #if defined(MORPHOS) || defined(__NDS__)
a6209668c216 (svn r11939) -Codechange: some type fixes and very initial steps into supporting NDS by default. Based on work by Dominik.
rubidium <rubidium@openttd.org>
parents: 8292
diff changeset
324 /* MorphOS and NDS don't have C++ conformant _stricmp... */
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
325 #define _stricmp stricmp
7275
0657179a042c (svn r10605) -Fix [FS#1046]: also OpenBSD does not know wchar. Patch by Matthias.
rubidium <rubidium@openttd.org>
parents: 7266
diff changeset
326 #elif defined(OPENBSD)
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
327 /* OpenBSD uses strcasecmp(3) */
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
328 #define _stricmp strcasecmp
7275
0657179a042c (svn r10605) -Fix [FS#1046]: also OpenBSD does not know wchar. Patch by Matthias.
rubidium <rubidium@openttd.org>
parents: 7266
diff changeset
329 #endif
0657179a042c (svn r10605) -Fix [FS#1046]: also OpenBSD does not know wchar. Patch by Matthias.
rubidium <rubidium@openttd.org>
parents: 7266
diff changeset
330
8373
a6209668c216 (svn r11939) -Codechange: some type fixes and very initial steps into supporting NDS by default. Based on work by Dominik.
rubidium <rubidium@openttd.org>
parents: 8292
diff changeset
331 #if !defined(MORPHOS) && !defined(OPENBSD) && !defined(__NDS__)
a6209668c216 (svn r11939) -Codechange: some type fixes and very initial steps into supporting NDS by default. Based on work by Dominik.
rubidium <rubidium@openttd.org>
parents: 8292
diff changeset
332 /* NDS, MorphOS & OpenBSD don't know wchars, the rest does :( */
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
333 #define HAS_WCHAR
8373
a6209668c216 (svn r11939) -Codechange: some type fixes and very initial steps into supporting NDS by default. Based on work by Dominik.
rubidium <rubidium@openttd.org>
parents: 8292
diff changeset
334 #endif /* !defined(MORPHOS) && !defined(OPENBSD) && !defined(__NDS__) */
7255
8ab9b7eee23a (svn r10562) -Fix: most of the MorphOS issues; MorphOS doesn't know about wchars, so disable all code that has to use wchars for MorphOS.
rubidium <rubidium@openttd.org>
parents: 7154
diff changeset
335
7266
550b96f71f7f (svn r10587) -Codechange: move the string/dparam related stuff from variables.h to strings.h
rubidium <rubidium@openttd.org>
parents: 7255
diff changeset
336 #if !defined(MAX_PATH)
8004
3624827ca78b (svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
skidd13 <skidd13@openttd.org>
parents: 7927
diff changeset
337 #define MAX_PATH 260
7266
550b96f71f7f (svn r10587) -Codechange: move the string/dparam related stuff from variables.h to strings.h
rubidium <rubidium@openttd.org>
parents: 7255
diff changeset
338 #endif
550b96f71f7f (svn r10587) -Codechange: move the string/dparam related stuff from variables.h to strings.h
rubidium <rubidium@openttd.org>
parents: 7255
diff changeset
339
8123
c26c28875749 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium <rubidium@openttd.org>
parents: 8051
diff changeset
340 /**
c26c28875749 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium <rubidium@openttd.org>
parents: 8051
diff changeset
341 * The largest value that can be entered in a variable
c26c28875749 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium <rubidium@openttd.org>
parents: 8051
diff changeset
342 * @param type the type of the variable
c26c28875749 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium <rubidium@openttd.org>
parents: 8051
diff changeset
343 */
c26c28875749 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium <rubidium@openttd.org>
parents: 8051
diff changeset
344 #define MAX_UVALUE(type) ((type)~(type)0)
c26c28875749 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium <rubidium@openttd.org>
parents: 8051
diff changeset
345
5475
eabf4b86aed6 (svn r7759) -Merge: makefile rewrite. This merge features:
rubidium <rubidium@openttd.org>
parents:
diff changeset
346 #endif /* STDAFX_H */