Fix STARTUP_WINDOW=0 on modern macOS

git-svn-id: https://svn.eduke32.com/eduke32@8351 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/sdlayer.cpp
#	source/build/src/startosx.editor.mm
#	source/platform/macos/osxbits.h
#	source/platform/macos/startosx.game.mm
This commit is contained in:
hendricks266 2019-12-03 09:45:05 +00:00 committed by Christoph Oelckers
parent c27616508e
commit 53e2a8297d
3 changed files with 18 additions and 8 deletions

View file

@ -2,6 +2,9 @@
#define osxbits_h_
#include <sys/types.h>
void osx_preopen(void);
void osx_postopen(void);
int osx_msgbox(const char *name, const char *msg);
int osx_ynbox(const char *name, const char *msg);

View file

@ -23,6 +23,20 @@
# define MAC_OS_VERSION_10_3 1030
#endif
id nsapp;
void osx_preopen(void)
{
// fix for "ld: absolute address to symbol _NSApp in a different linkage unit not supported"
// (OS X 10.6) when building for PPC
nsapp = [NSApplication sharedApplication];
}
void osx_postopen(void)
{
[nsapp finishLaunching];
}
int osx_msgbox(const char *name, const char *msg)
{
NSString *mmsg = [[NSString alloc] initWithUTF8String:msg];

View file

@ -11,6 +11,7 @@
#include "compat.h"
#include "baselayer.h"
#include "grpscan.h"
#include "osxbits.h"
#import "GrpFile.game.h"
#import "GameListSource.game.h"
@ -105,8 +106,6 @@ static NSPopUpButton * makeComboBox(void)
return comboBox;
}
static id nsapp;
/* setAppleMenu disappeared from the headers in 10.4 */
@interface NSApplication(NSAppleMenu)
- (void)setAppleMenu:(NSMenu *)menu;
@ -599,10 +598,6 @@ static StartupWindow *startwin = nil;
int startwin_open(void)
{
// fix for "ld: absolute address to symbol _NSApp in a different linkage unit not supported"
// (OS X 10.6) when building for PPC
nsapp = [NSApplication sharedApplication];
if (startwin != nil) return 1;
startwin = [[StartupWindow alloc] init];
@ -610,8 +605,6 @@ int startwin_open(void)
[startwin setupMessagesMode];
[nsapp finishLaunching];
[startwin center];
[startwin makeKeyAndOrderFront:nil];