mirror of https://github.com/OpenTTD/OpenTTD
(svn r3286) -Fix: [OSX] 10.2 works again and universal binaries got 10.2 as target by default
parent
be65f908c8
commit
42d8e8410b
|
@ -26,7 +26,6 @@
|
||||||
*/
|
*/
|
||||||
#include "../stdafx.h"
|
#include "../stdafx.h"
|
||||||
#include "../openttd.h"
|
#include "../openttd.h"
|
||||||
#include "../debug.h"
|
|
||||||
#include "qtmidi.h"
|
#include "qtmidi.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -52,6 +51,8 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
|
// we need to include debug.h after CoreServices because defining DEBUG will break CoreServices in OSX 10.2
|
||||||
|
#include "../debug.h"
|
||||||
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
|
|
@ -11,6 +11,14 @@
|
||||||
|
|
||||||
#ifdef ENABLE_NETWORK
|
#ifdef ENABLE_NETWORK
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#include <AvailabilityMacros.h>
|
||||||
|
#if (MAC_OS_X_VERSION_MAX_ALLOWED == MAC_OS_X_VERSION_10_2)
|
||||||
|
// OSX 10.2 don't have socklen_t defined, so we will define it here
|
||||||
|
typedef int socklen_t;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
// Windows stuff
|
// Windows stuff
|
||||||
#if defined(WIN32) || defined(WIN64)
|
#if defined(WIN32) || defined(WIN64)
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
|
|
|
@ -31,10 +31,10 @@ endif
|
||||||
|
|
||||||
# setup flags if none are defined
|
# setup flags if none are defined
|
||||||
ifndef CFLAGS_PPC
|
ifndef CFLAGS_PPC
|
||||||
CFLAGS_PPC:= -isysroot /Developer/SDKs/MacOSX10.3.9.sdk
|
CFLAGS_PPC:= -isysroot /Developer/SDKs/MacOSX10.2.8.sdk
|
||||||
endif
|
endif
|
||||||
ifndef LDFLAGS_PPC
|
ifndef LDFLAGS_PPC
|
||||||
LDFLAGS_PPC:= -Wl,-syslibroot,/Developer/SDKs/MacOSX10.3.9.sdk
|
LDFLAGS_PPC:= -Wl,-syslibroot,/Developer/SDKs/MacOSX10.2.8.sdk
|
||||||
endif
|
endif
|
||||||
ifndef PPC_CC
|
ifndef PPC_CC
|
||||||
PPC_CC:=powerpc-apple-darwin8-gcc-4.0.0
|
PPC_CC:=powerpc-apple-darwin8-gcc-4.0.0
|
||||||
|
@ -105,6 +105,7 @@ $(error no x86 SDL lib found)
|
||||||
CC_TARGET:=$(x86_CC)
|
CC_TARGET:=$(x86_CC)
|
||||||
# clear the cached list of PPC libs
|
# clear the cached list of PPC libs
|
||||||
LIBS:=
|
LIBS:=
|
||||||
|
OBJS:=
|
||||||
CFLAGS:= $(CFLAGS_x86) -arch i386
|
CFLAGS:= $(CFLAGS_x86) -arch i386
|
||||||
LDFLAGS:= $(LDFLAGS_x86)
|
LDFLAGS:= $(LDFLAGS_x86)
|
||||||
else
|
else
|
||||||
|
|
|
@ -17,7 +17,7 @@ void ShowMacAssertDialog ( const char *function, const char *file, const int lin
|
||||||
{
|
{
|
||||||
const char *buffer =
|
const char *buffer =
|
||||||
[[NSString stringWithFormat:@"An assertion has failed and OpenTTD must quit.\n%s in %s (line %d)\n\"%s\"\n\nYou should report this error the OpenTTD developers if you think you found a bug.",
|
[[NSString stringWithFormat:@"An assertion has failed and OpenTTD must quit.\n%s in %s (line %d)\n\"%s\"\n\nYou should report this error the OpenTTD developers if you think you found a bug.",
|
||||||
function, file, line, expression] cStringUsingEncoding:NSASCIIStringEncoding];
|
function, file, line, expression] cString];
|
||||||
NSLog(@"%s", buffer);
|
NSLog(@"%s", buffer);
|
||||||
ShowMacDialog( "Assertion Failed", buffer, "Quit" );
|
ShowMacDialog( "Assertion Failed", buffer, "Quit" );
|
||||||
|
|
||||||
|
|
|
@ -27,9 +27,11 @@ extern void ShowMenuBar(void);
|
||||||
extern void HideMenuBar(void);
|
extern void HideMenuBar(void);
|
||||||
|
|
||||||
/* Disables a warning. This is needed since the method exists but has been dropped from the header, supposedly as of 10.4. */
|
/* Disables a warning. This is needed since the method exists but has been dropped from the header, supposedly as of 10.4. */
|
||||||
|
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
|
||||||
@interface NSApplication(NSAppleMenu)
|
@interface NSApplication(NSAppleMenu)
|
||||||
- (void)setAppleMenu:(NSMenu *)menu;
|
- (void)setAppleMenu:(NSMenu *)menu;
|
||||||
@end
|
@end
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Name conflict */
|
/* Name conflict */
|
||||||
|
@ -1180,7 +1182,7 @@ static const char *QZ_SetVideoWindowed (uint width, uint height) {
|
||||||
return "Could not create the Cocoa window";
|
return "Could not create the Cocoa window";
|
||||||
|
|
||||||
snprintf(caption, sizeof(caption), "OpenTTD %s", _openttd_revision);
|
snprintf(caption, sizeof(caption), "OpenTTD %s", _openttd_revision);
|
||||||
nsscaption = [ [ NSString alloc ] initWithCString:caption encoding:NSASCIIStringEncoding ];
|
nsscaption = [ [ NSString alloc ] initWithCString:caption ];
|
||||||
[ _cocoa_video_data.window setTitle:nsscaption ];
|
[ _cocoa_video_data.window setTitle:nsscaption ];
|
||||||
[ _cocoa_video_data.window setMiniwindowTitle:nsscaption ];
|
[ _cocoa_video_data.window setMiniwindowTitle:nsscaption ];
|
||||||
[ nsscaption release ];
|
[ nsscaption release ];
|
||||||
|
|
Loading…
Reference in New Issue