Rework the trip history window layout.
[openttd-joker.git] / src / os / macosx / osx_stdafx.h
blobdc855ed2b8831cc74c10a4273828807f2902448d
1 /* $Id: osx_stdafx.h 25913 2013-10-26 17:20:48Z michi_cc $ */
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 */
10 /** @file osx_stdafx.h OSX is different on some places. */
12 #ifndef MACOS_STDAFX_H
13 #define MACOS_STDAFX_H
15 #define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
17 #include <AvailabilityMacros.h>
19 /* We assume if these macros are defined, the SDK is also at least this version or later. */
20 #ifdef MAC_OS_X_VERSION_10_7
21 #define HAVE_OSX_107_SDK
22 #endif
24 #ifdef MAC_OS_X_VERSION_10_11
25 #define HAVE_OSX_1011_SDK
26 #endif
28 /* It would seem that to ensure backward compability we have to ensure that we have defined MAC_OS_X_VERSION_10_x everywhere */
29 #ifndef MAC_OS_X_VERSION_10_3
30 #define MAC_OS_X_VERSION_10_3 1030
31 #endif
33 #ifndef MAC_OS_X_VERSION_10_4
34 #define MAC_OS_X_VERSION_10_4 1040
35 #endif
37 #ifndef MAC_OS_X_VERSION_10_5
38 #define MAC_OS_X_VERSION_10_5 1050
39 #endif
41 #ifndef MAC_OS_X_VERSION_10_6
42 #define MAC_OS_X_VERSION_10_6 1060
43 #endif
45 #ifndef MAC_OS_X_VERSION_10_7
46 #define MAC_OS_X_VERSION_10_7 1070
47 #endif
49 #ifndef MAC_OS_X_VERSION_10_8
50 #define MAC_OS_X_VERSION_10_8 1080
51 #endif
53 #ifndef MAC_OS_X_VERSION_10_9
54 #define MAC_OS_X_VERSION_10_9 1090
55 #endif
58 #define __STDC_LIMIT_MACROS
59 #include <stdint.h>
61 /* Some gcc versions include assert.h via this header. As this would interfere
62 * with our own assert redefinition, include this header first. */
63 #if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
64 # include <debug/debug.h>
65 #endif
67 /* Check for mismatching 'architectures' */
68 #if !defined(STRGEN) && !defined(SETTINGSGEN) && ((defined(__LP64__) && !defined(_SQ64)) || (!defined(__LP64__) && defined(_SQ64)))
69 # error "Compiling 64 bits without _SQ64 set! (or vice versa)"
70 #endif
72 /* Name conflict */
73 #define Rect OTTDRect
74 #define Point OTTDPoint
75 #define WindowClass OTTDWindowClass
76 #define ScriptOrder OTTDScriptOrder
77 #define Palette OTTDPalette
78 #define GlyphID OTTDGlyphID
80 #include <CoreServices/CoreServices.h>
81 #include <ApplicationServices/ApplicationServices.h>
83 #undef Rect
84 #undef Point
85 #undef WindowClass
86 #undef ScriptOrder
87 #undef Palette
88 #undef GlyphID
90 /* remove the variables that CoreServices defines, but we define ourselves too */
91 #undef bool
92 #undef false
93 #undef true
95 /* Name conflict */
96 #define GetTime OTTD_GetTime
98 #define SL_ERROR OSX_SL_ERROR
100 /* NSInteger and NSUInteger are part of 10.5 and higher. */
101 #ifndef NSInteger
102 #ifdef __LP64__
103 typedef long NSInteger;
104 typedef unsigned long NSUInteger;
105 #else
106 typedef int NSInteger;
107 typedef unsigned int NSUInteger;
108 #endif /* __LP64__ */
109 #endif /* NSInteger */
111 #ifndef CGFLOAT_DEFINED
112 #ifdef __LP64__
113 typedef double CGFloat;
114 #else
115 typedef float CGFloat;
116 #endif /* __LP64__ */
117 #endif /* CGFLOAT_DEFINED */
119 /* OS X SDK versions >= 10.5 have a non-const iconv. */
120 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
121 # define HAVE_NON_CONST_ICONV
122 #endif
124 #endif /* MACOS_STDAFX_H */