From 4b6beeca17cd9b64fbf7d0036b441a8be5f855bf Mon Sep 17 00:00:00 2001 From: kanjitalk755 Date: Sun, 26 May 2024 12:25:13 +0900 Subject: [PATCH] Fix for SDL3 3.1.2 Preview (addition) --- BasiliskII/src/Unix/main_unix.cpp | 10 +++++----- SheepShaver/src/Unix/main_unix.cpp | 15 +++++++++------ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/BasiliskII/src/Unix/main_unix.cpp b/BasiliskII/src/Unix/main_unix.cpp index 32900546..b076f46e 100755 --- a/BasiliskII/src/Unix/main_unix.cpp +++ b/BasiliskII/src/Unix/main_unix.cpp @@ -30,7 +30,7 @@ # include # include #if !SDL_VERSION_ATLEAST(3, 0, 0) -#define __MACOS__ __MACOSX__ +#define SDL_PLATFORM_MACOS __MACOSX__ #endif #endif @@ -46,8 +46,8 @@ # include #endif -#if __MACOS__ -# include "utils_macosx.h" +#if SDL_PLATFORM_MACOS +#include "utils_macosx.h" #endif #if !EMULATED_68K && defined(__NetBSD__) @@ -571,7 +571,7 @@ int main(int argc, char **argv) } atexit(SDL_Quit); -#if __MACOS__ && SDL_VERSION_ATLEAST(2,0,0) +#if SDL_PLATFORM_MACOS && SDL_VERSION_ATLEAST(2,0,0) // On Mac OS X hosts, SDL2 will create its own menu bar. This is mostly OK, // except that it will also install keyboard shortcuts, such as Command + Q, // which can interfere with keyboard shortcuts in the guest OS. @@ -695,7 +695,7 @@ int main(int argc, char **argv) ROMBaseMac = Host2MacAddr(ROMBaseHost); #endif -#if __MACOS__ +#if SDL_PLATFORM_MACOS extern void set_current_directory(); set_current_directory(); #endif diff --git a/SheepShaver/src/Unix/main_unix.cpp b/SheepShaver/src/Unix/main_unix.cpp index 15fce115..d9dae957 100755 --- a/SheepShaver/src/Unix/main_unix.cpp +++ b/SheepShaver/src/Unix/main_unix.cpp @@ -125,12 +125,19 @@ #ifdef USE_SDL #include +#if !SDL_VERSION_ATLEAST(3, 0, 0) +#define SDL_PLATFORM_MACOS __MACOSX__ +#endif #endif #ifndef USE_SDL_VIDEO #include #endif +#if SDL_PLATFORM_MACOS +#include "utils_macosx.h" +#endif + #ifdef ENABLE_GTK #include #if !defined(GDK_WINDOWING_QUARTZ) && !defined(GDK_WINDOWING_WAYLAND) @@ -773,8 +780,7 @@ int main(int argc, char **argv) #endif #endif -#if __MACOSX__ - extern void set_current_directory(); +#if SDL_PLATFORM_MACOS set_current_directory(); #endif @@ -864,17 +870,14 @@ int main(int argc, char **argv) // Read preferences PrefsInit(vmdir, argc, argv); -#ifdef __MACOSX__ -#if SDL_VERSION_ATLEAST(2,0,0) +#if SDL_PLATFORM_MACOS && SDL_VERSION_ATLEAST(2,0,0) // On Mac OS X hosts, SDL2 will create its own menu bar. This is mostly OK, // except that it will also install keyboard shortcuts, such as Command + Q, // which can interfere with keyboard shortcuts in the guest OS. // // HACK: disable these shortcuts, while leaving all other pieces of SDL2's // menu bar in-place. - extern void disable_SDL2_macosx_menu_bar_keyboard_shortcuts(); disable_SDL2_macosx_menu_bar_keyboard_shortcuts(); -#endif #endif // Any command line arguments left?