2006-02-12 15:31:33 +01:00
|
|
|
/* $Id$ */
|
|
|
|
|
2009-08-21 22:21:05 +02:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* 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.
|
|
|
|
* 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.
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2008-05-06 17:11:33 +02:00
|
|
|
/** @file osx_stdafx.h OSX is different on some places. */
|
|
|
|
|
2006-02-12 15:31:33 +01:00
|
|
|
#ifndef MACOS_STDAFX_H
|
|
|
|
#define MACOS_STDAFX_H
|
|
|
|
|
2013-07-31 20:50:01 +02:00
|
|
|
|
2016-10-31 20:29:01 +01:00
|
|
|
#include <AvailabilityMacros.h>
|
|
|
|
|
|
|
|
/* We assume if these macros are defined, the SDK is also at least this version or later. */
|
|
|
|
#ifdef MAC_OS_X_VERSION_10_7
|
|
|
|
#define HAVE_OSX_107_SDK
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef MAC_OS_X_VERSION_10_11
|
|
|
|
#define HAVE_OSX_1011_SDK
|
|
|
|
#endif
|
|
|
|
|
2019-09-29 22:27:32 +02:00
|
|
|
/* It would seem that to ensure backward compatibility we have to ensure that we have defined MAC_OS_X_VERSION_10_x everywhere */
|
2013-07-31 20:50:01 +02:00
|
|
|
#ifndef MAC_OS_X_VERSION_10_3
|
|
|
|
#define MAC_OS_X_VERSION_10_3 1030
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MAC_OS_X_VERSION_10_4
|
|
|
|
#define MAC_OS_X_VERSION_10_4 1040
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MAC_OS_X_VERSION_10_5
|
|
|
|
#define MAC_OS_X_VERSION_10_5 1050
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MAC_OS_X_VERSION_10_6
|
|
|
|
#define MAC_OS_X_VERSION_10_6 1060
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MAC_OS_X_VERSION_10_7
|
|
|
|
#define MAC_OS_X_VERSION_10_7 1070
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MAC_OS_X_VERSION_10_8
|
|
|
|
#define MAC_OS_X_VERSION_10_8 1080
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MAC_OS_X_VERSION_10_9
|
|
|
|
#define MAC_OS_X_VERSION_10_9 1090
|
|
|
|
#endif
|
|
|
|
|
2018-01-28 23:02:22 +01:00
|
|
|
#ifndef MAC_OS_X_VERSION_10_10
|
|
|
|
#define MAC_OS_X_VERSION_10_10 101000
|
|
|
|
#endif
|
2013-07-31 20:50:01 +02:00
|
|
|
|
2018-04-03 22:08:01 +02:00
|
|
|
#ifndef MAC_OS_X_VERSION_10_11
|
|
|
|
#define MAC_OS_X_VERSION_10_11 101100
|
|
|
|
#endif
|
|
|
|
|
2009-07-14 19:16:32 +02:00
|
|
|
#define __STDC_LIMIT_MACROS
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2009-10-04 23:08:30 +02:00
|
|
|
/* Some gcc versions include assert.h via this header. As this would interfere
|
|
|
|
* with our own assert redefinition, include this header first. */
|
2013-10-26 19:20:48 +02:00
|
|
|
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
|
2009-10-04 23:08:30 +02:00
|
|
|
# include <debug/debug.h>
|
|
|
|
#endif
|
|
|
|
|
2009-03-29 21:55:08 +02:00
|
|
|
/* Check for mismatching 'architectures' */
|
2014-07-30 22:19:29 +02:00
|
|
|
#if !defined(STRGEN) && !defined(SETTINGSGEN) && ((defined(__LP64__) && !defined(_SQ64)) || (!defined(__LP64__) && defined(_SQ64)))
|
2009-03-29 21:55:08 +02:00
|
|
|
# error "Compiling 64 bits without _SQ64 set! (or vice versa)"
|
|
|
|
#endif
|
|
|
|
|
2009-07-14 18:43:45 +02:00
|
|
|
/* Name conflict */
|
|
|
|
#define Rect OTTDRect
|
|
|
|
#define Point OTTDPoint
|
|
|
|
#define WindowClass OTTDWindowClass
|
2011-12-08 19:13:29 +01:00
|
|
|
#define ScriptOrder OTTDScriptOrder
|
|
|
|
#define Palette OTTDPalette
|
2013-06-26 17:02:16 +02:00
|
|
|
#define GlyphID OTTDGlyphID
|
2009-07-14 18:43:45 +02:00
|
|
|
|
2006-02-12 15:31:33 +01:00
|
|
|
#include <CoreServices/CoreServices.h>
|
2011-12-08 19:13:29 +01:00
|
|
|
#include <ApplicationServices/ApplicationServices.h>
|
2009-03-29 21:55:08 +02:00
|
|
|
|
2009-07-14 18:43:45 +02:00
|
|
|
#undef Rect
|
|
|
|
#undef Point
|
|
|
|
#undef WindowClass
|
2011-11-30 00:15:48 +01:00
|
|
|
#undef ScriptOrder
|
2011-12-08 19:13:29 +01:00
|
|
|
#undef Palette
|
2013-06-26 17:02:16 +02:00
|
|
|
#undef GlyphID
|
2009-07-14 18:43:45 +02:00
|
|
|
|
2009-03-15 01:32:18 +01:00
|
|
|
/* remove the variables that CoreServices defines, but we define ourselves too */
|
2006-02-12 15:31:33 +01:00
|
|
|
#undef bool
|
|
|
|
#undef false
|
|
|
|
#undef true
|
|
|
|
|
|
|
|
/* Name conflict */
|
2009-07-14 18:43:45 +02:00
|
|
|
#define GetTime OTTD_GetTime
|
2006-02-12 15:31:33 +01:00
|
|
|
|
|
|
|
#define SL_ERROR OSX_SL_ERROR
|
|
|
|
|
2009-03-29 21:55:08 +02:00
|
|
|
/* NSInteger and NSUInteger are part of 10.5 and higher. */
|
|
|
|
#ifndef NSInteger
|
2014-07-30 22:19:29 +02:00
|
|
|
#ifdef __LP64__
|
2009-03-29 21:55:08 +02:00
|
|
|
typedef long NSInteger;
|
|
|
|
typedef unsigned long NSUInteger;
|
|
|
|
#else
|
|
|
|
typedef int NSInteger;
|
|
|
|
typedef unsigned int NSUInteger;
|
|
|
|
#endif /* __LP64__ */
|
|
|
|
#endif /* NSInteger */
|
|
|
|
|
2013-08-05 22:36:17 +02:00
|
|
|
#ifndef CGFLOAT_DEFINED
|
2014-07-30 22:19:29 +02:00
|
|
|
#ifdef __LP64__
|
2013-08-05 22:36:17 +02:00
|
|
|
typedef double CGFloat;
|
|
|
|
#else
|
|
|
|
typedef float CGFloat;
|
|
|
|
#endif /* __LP64__ */
|
|
|
|
#endif /* CGFLOAT_DEFINED */
|
|
|
|
|
2013-06-26 23:17:09 +02:00
|
|
|
/* OS X SDK versions >= 10.5 have a non-const iconv. */
|
|
|
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
|
|
|
|
# define HAVE_NON_CONST_ICONV
|
|
|
|
#endif
|
|
|
|
|
2006-02-12 15:31:33 +01:00
|
|
|
#endif /* MACOS_STDAFX_H */
|