OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

osx_stdafx.h
Go to the documentation of this file.
1 /* $Id: osx_stdafx.h 27675 2016-10-31 19:29:01Z michi_cc $ */
2
3 /*
4 * This file is part of OpenTTD.
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 */
9
12 #ifndef MACOS_STDAFX_H
13 #define MACOS_STDAFX_H
14
15
16 #include <AvailabilityMacros.h>
17
18 /* We assume if these macros are defined, the SDK is also at least this version or later. */
19 #ifdef MAC_OS_X_VERSION_10_7
20 #define HAVE_OSX_107_SDK
21 #endif
22
23 #ifdef MAC_OS_X_VERSION_10_11
24 #define HAVE_OSX_1011_SDK
25 #endif
26
27 /* It would seem that to ensure backward compability we have to ensure that we have defined MAC_OS_X_VERSION_10_x everywhere */
28 #ifndef MAC_OS_X_VERSION_10_3
29 #define MAC_OS_X_VERSION_10_3 1030
30 #endif
31
32 #ifndef MAC_OS_X_VERSION_10_4
33 #define MAC_OS_X_VERSION_10_4 1040
34 #endif
35
36 #ifndef MAC_OS_X_VERSION_10_5
37 #define MAC_OS_X_VERSION_10_5 1050
38 #endif
39
40 #ifndef MAC_OS_X_VERSION_10_6
41 #define MAC_OS_X_VERSION_10_6 1060
42 #endif
43
44 #ifndef MAC_OS_X_VERSION_10_7
45 #define MAC_OS_X_VERSION_10_7 1070
46 #endif
47
48 #ifndef MAC_OS_X_VERSION_10_8
49 #define MAC_OS_X_VERSION_10_8 1080
50 #endif
51
52 #ifndef MAC_OS_X_VERSION_10_9
53 #define MAC_OS_X_VERSION_10_9 1090
54 #endif
55
56
57 #define __STDC_LIMIT_MACROS
58 #include <stdint.h>
59
60 /* Some gcc versions include assert.h via this header. As this would interfere
61 * with our own assert redefinition, include this header first. */
62 #if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
63 # include <debug/debug.h>
64 #endif
65
66 /* Check for mismatching 'architectures' */
67 #if !defined(STRGEN) && !defined(SETTINGSGEN) && ((defined(__LP64__) && !defined(_SQ64)) || (!defined(__LP64__) && defined(_SQ64)))
68 # error "Compiling 64 bits without _SQ64 set! (or vice versa)"
69 #endif
70
71 /* Name conflict */
72 #define Rect OTTDRect
73 #define Point OTTDPoint
74 #define WindowClass OTTDWindowClass
75 #define ScriptOrder OTTDScriptOrder
76 #define Palette OTTDPalette
77 #define GlyphID OTTDGlyphID
78
79 #include <CoreServices/CoreServices.h>
80 #include <ApplicationServices/ApplicationServices.h>
81
82 #undef Rect
83 #undef Point
84 #undef WindowClass
85 #undef ScriptOrder
86 #undef Palette
87 #undef GlyphID
88
89 /* remove the variables that CoreServices defines, but we define ourselves too */
90 #undef bool
91 #undef false
92 #undef true
93
94 /* Name conflict */
95 #define GetTime OTTD_GetTime
96
97 #define SL_ERROR OSX_SL_ERROR
98
99 /* NSInteger and NSUInteger are part of 10.5 and higher. */
100 #ifndef NSInteger
101 #ifdef __LP64__
102 typedef long NSInteger;
103 typedef unsigned long NSUInteger;
104 #else
105 typedef int NSInteger;
106 typedef unsigned int NSUInteger;
107 #endif /* __LP64__ */
108 #endif /* NSInteger */
109
110 #ifndef CGFLOAT_DEFINED
111 #ifdef __LP64__
112 typedef double CGFloat;
113 #else
114 typedef float CGFloat;
115 #endif /* __LP64__ */
116 #endif /* CGFLOAT_DEFINED */
117
118 /* OS X SDK versions >= 10.5 have a non-const iconv. */
119 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
120 # define HAVE_NON_CONST_ICONV
121 #endif
122
123 #endif /* MACOS_STDAFX_H */