1 /* $Id: osx_stdafx.h 25913 2013-10-26 17:20:48Z michi_cc $ */
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/>.
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
24 #ifdef MAC_OS_X_VERSION_10_11
25 #define HAVE_OSX_1011_SDK
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
33 #ifndef MAC_OS_X_VERSION_10_4
34 #define MAC_OS_X_VERSION_10_4 1040
37 #ifndef MAC_OS_X_VERSION_10_5
38 #define MAC_OS_X_VERSION_10_5 1050
41 #ifndef MAC_OS_X_VERSION_10_6
42 #define MAC_OS_X_VERSION_10_6 1060
45 #ifndef MAC_OS_X_VERSION_10_7
46 #define MAC_OS_X_VERSION_10_7 1070
49 #ifndef MAC_OS_X_VERSION_10_8
50 #define MAC_OS_X_VERSION_10_8 1080
53 #ifndef MAC_OS_X_VERSION_10_9
54 #define MAC_OS_X_VERSION_10_9 1090
58 #define __STDC_LIMIT_MACROS
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>
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)"
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>
90 /* remove the variables that CoreServices defines, but we define ourselves too */
96 #define GetTime OTTD_GetTime
98 #define SL_ERROR OSX_SL_ERROR
100 /* NSInteger and NSUInteger are part of 10.5 and higher. */
103 typedef long NSInteger
;
104 typedef unsigned long NSUInteger
;
106 typedef int NSInteger
;
107 typedef unsigned int NSUInteger
;
108 #endif /* __LP64__ */
109 #endif /* NSInteger */
111 #ifndef CGFLOAT_DEFINED
113 typedef double CGFloat
;
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
124 #endif /* MACOS_STDAFX_H */