OpenTTD Source 20260505-master-g275ba48eea
osx_stdafx.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * 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.
4 * 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.
5 * 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 <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
9
10#ifndef MACOS_STDAFX_H
11#define MACOS_STDAFX_H
12
13
14#include <AvailabilityMacros.h>
15
16#define __STDC_LIMIT_MACROS
17#include <stdint.h>
18
19/* Some gcc versions include assert.h via this header. As this would interfere
20 * with our own assert redefinition, include this header first. */
21#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
22# include <debug/debug.h>
23#endif
24
25/* Check for mismatching 'architectures' */
26#if !defined(STRGEN) && !defined(SETTINGSGEN) && ((defined(__LP64__) && !defined(POINTER_IS_64BIT)) || (!defined(__LP64__) && defined(POINTER_IS_64BIT)))
27# error "Compiling 64 bits without POINTER_IS_64BIT set! (or vice versa)"
28#endif
29
30/* Name conflict */
31#define Rect OTTDRect
32#define Point OTTDPoint
33#define WindowClass OTTDWindowClass
34#define ScriptOrder OTTDScriptOrder
35#define Palette OTTDPalette
36#define GlyphID OTTDGlyphID
37
38#include <CoreServices/CoreServices.h>
39#include <ApplicationServices/ApplicationServices.h>
40
41#undef Rect
42#undef Point
43#undef WindowClass
44#undef ScriptOrder
45#undef Palette
46#undef GlyphID
47
48/* remove the variables that CoreServices defines, but we define ourselves too */
49#undef bool
50#undef false
51#undef true
52
53/* Name conflict */
54#define GetTime OTTD_GetTime
55
56/* NSInteger and NSUInteger are part of 10.5 and higher. */
57#ifndef NSInteger
58#ifdef __LP64__
59typedef long NSInteger;
60typedef unsigned long NSUInteger;
61#else
62typedef int NSInteger;
63typedef unsigned int NSUInteger;
64#endif /* __LP64__ */
65#endif /* NSInteger */
66
67#ifndef CGFLOAT_DEFINED
68#ifdef __LP64__
69typedef double CGFloat;
70#else
71typedef float CGFloat;
72#endif /* __LP64__ */
73#endif /* CGFLOAT_DEFINED */
74
76#define HAVE_NON_CONST_ICONV
77
78#endif /* MACOS_STDAFX_H */