Clean up forward declarations in favor of header files.

This commit is contained in:
asvitkine 2022-04-04 13:42:58 -04:00
parent f07b34a451
commit e069d84f5b
6 changed files with 18 additions and 6 deletions

View File

@ -101,6 +101,8 @@ extern void * vm_acquire(size_t size, int options = VM_MAP_DEFAULT);
extern void * vm_acquire_reserved(size_t size); extern void * vm_acquire_reserved(size_t size);
extern int vm_init_reserved(void * host_address);
/* Allocate zero-filled memory at exactly ADDR (which must be page-aligned). /* Allocate zero-filled memory at exactly ADDR (which must be page-aligned).
Returns 0 if successful, -1 on errors. */ Returns 0 if successful, -1 on errors. */

View File

@ -24,6 +24,17 @@
// Invokes the specified function with an NSAutoReleasePool in place. // Invokes the specified function with an NSAutoReleasePool in place.
void NSAutoReleasePool_wrap(void (*fn)(void)); void NSAutoReleasePool_wrap(void (*fn)(void));
#ifdef USE_SDL
#if SDL_VERSION_ATLEAST(2,0,0)
void disable_SDL2_macosx_menu_bar_keyboard_shortcuts();
bool is_fullscreen_osx(SDL_Window * window);
#endif
#endif
void set_menu_bar_visible_osx(bool visible);
void set_current_directory();
bool MetalIsAvailable(); bool MetalIsAvailable();
#endif #endif

View File

@ -20,8 +20,8 @@
#include <Cocoa/Cocoa.h> #include <Cocoa/Cocoa.h>
#include "sysdeps.h" #include "sysdeps.h"
#include "utils_macosx.h"
#include <SDL.h> #include <SDL.h>
#include "utils_macosx.h"
#if SDL_VERSION_ATLEAST(2,0,0) #if SDL_VERSION_ATLEAST(2,0,0)
#include <SDL_syswm.h> #include <SDL_syswm.h>

View File

@ -1718,7 +1718,6 @@ static bool is_fullscreen(SDL_Window * window)
// involves fullscreen/windowed toggles via window-manager UI controls). // involves fullscreen/windowed toggles via window-manager UI controls).
// Until it does, or adds a facility to do so, we'll use a platform-specific // Until it does, or adds a facility to do so, we'll use a platform-specific
// code path to detect fullscreen changes. // code path to detect fullscreen changes.
extern bool is_fullscreen_osx(SDL_Window * window);
return is_fullscreen_osx(sdl_window); return is_fullscreen_osx(sdl_window);
#else #else
if (!window) { if (!window) {
@ -2272,7 +2271,6 @@ static int SDLCALL on_sdl_event_generated(void *userdata, SDL_Event * event)
// cursor is near the top of the screen, lest the // cursor is near the top of the screen, lest the
// guest OS' menu bar be obscured. // guest OS' menu bar be obscured.
if (is_full) { if (is_full) {
extern void set_menu_bar_visible_osx(bool);
set_menu_bar_visible_osx(false); set_menu_bar_visible_osx(false);
} }
#endif #endif

View File

@ -43,6 +43,10 @@
# include <sys/mman.h> # include <sys/mman.h>
#endif #endif
#if __MACOSX__
# include "util_macosx.h"
#endif
#if !EMULATED_68K && defined(__NetBSD__) #if !EMULATED_68K && defined(__NetBSD__)
# include <m68k/sync_icache.h> # include <m68k/sync_icache.h>
# include <m68k/frame.h> # include <m68k/frame.h>
@ -579,7 +583,6 @@ int main(int argc, char **argv)
// //
// HACK: disable these shortcuts, while leaving all other pieces of SDL2's // HACK: disable these shortcuts, while leaving all other pieces of SDL2's
// menu bar in-place. // menu bar in-place.
extern void disable_SDL2_macosx_menu_bar_keyboard_shortcuts();
disable_SDL2_macosx_menu_bar_keyboard_shortcuts(); disable_SDL2_macosx_menu_bar_keyboard_shortcuts();
#endif #endif

View File

@ -2217,8 +2217,6 @@ rti:;
} }
#endif #endif
extern int vm_init_reserved(void *hostAddress);
/* /*
* Helpers to share 32-bit addressable data with MacOS * Helpers to share 32-bit addressable data with MacOS
*/ */