mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-12-24 10:32:32 +00:00
move NSAutoReleasePool_wrap() into its own file
This commit is contained in:
parent
c78c3046db
commit
dcf65b4d27
27
BasiliskII/src/MacOSX/utils_macosx.h
Normal file
27
BasiliskII/src/MacOSX/utils_macosx.h
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* utils_macosx.h - Mac OS X utility functions.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2011 Alexei Svitkine
|
||||||
|
*
|
||||||
|
* This program 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; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program 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 this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef UTILS_MACOSX_H
|
||||||
|
#define UTILS_MACOSX_H
|
||||||
|
|
||||||
|
// Invokes the specified function with an NSAutoReleasePool in place.
|
||||||
|
void NSAutoReleasePool_wrap(void (*fn)(void));
|
||||||
|
|
||||||
|
#endif
|
30
BasiliskII/src/MacOSX/utils_macosx.mm
Normal file
30
BasiliskII/src/MacOSX/utils_macosx.mm
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* utils_macosx.mm - Mac OS X utility functions.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2011 Alexei Svitkine
|
||||||
|
*
|
||||||
|
* This program 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; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program 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 this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <Cocoa/Cocoa.h>
|
||||||
|
#include "utils_macosx.h"
|
||||||
|
|
||||||
|
// This is used from video_sdl.cpp.
|
||||||
|
void NSAutoReleasePool_wrap(void (*fn)(void))
|
||||||
|
{
|
||||||
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||||
|
fn();
|
||||||
|
[pool release];
|
||||||
|
}
|
@ -346,13 +346,6 @@ static void CustomApplicationMain (int argc, char **argv)
|
|||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
// This is used from video_sdl.cpp.
|
|
||||||
void NSAutoReleasePool_wrap(void (*fn)(void))
|
|
||||||
{
|
|
||||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
|
||||||
fn();
|
|
||||||
[pool release];
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef main
|
#ifdef main
|
||||||
# undef main
|
# undef main
|
||||||
|
@ -63,15 +63,13 @@
|
|||||||
#include "video_blit.h"
|
#include "video_blit.h"
|
||||||
#include "vm_alloc.h"
|
#include "vm_alloc.h"
|
||||||
|
|
||||||
|
#if (defined(__APPLE__) && defined(__MACH__))
|
||||||
|
#include "utils_macosx.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define DEBUG 0
|
#define DEBUG 0
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
#if (defined(__APPLE__) && defined(__MACH__))
|
|
||||||
extern "C" {
|
|
||||||
void NSAutoReleasePool_wrap(void (*fn)(void));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Supported video modes
|
// Supported video modes
|
||||||
using std::vector;
|
using std::vector;
|
||||||
static vector<VIDEO_MODE> VideoModes;
|
static vector<VIDEO_MODE> VideoModes;
|
||||||
|
@ -711,6 +711,8 @@ if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
|
|||||||
KEYCODES="../SDL/keycodes"
|
KEYCODES="../SDL/keycodes"
|
||||||
if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
|
if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
|
||||||
EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
|
EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
|
||||||
|
EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/utils_macosx.mm"
|
||||||
|
CPPFLAGS="$CPPFLAGS -I../MacOSX"
|
||||||
else
|
else
|
||||||
case "$target_os" in
|
case "$target_os" in
|
||||||
cygwin*)
|
cygwin*)
|
||||||
|
@ -79,6 +79,7 @@ links:
|
|||||||
MacOSX/MacOSX_sound_if.cpp MacOSX/MacOSX_sound_if.h \
|
MacOSX/MacOSX_sound_if.cpp MacOSX/MacOSX_sound_if.h \
|
||||||
MacOSX/AudioBackEnd.cpp MacOSX/AudioBackEnd.h \
|
MacOSX/AudioBackEnd.cpp MacOSX/AudioBackEnd.h \
|
||||||
MacOSX/AudioDevice.cpp MacOSX/AudioDevice.h MacOSX/audio_macosx.cpp \
|
MacOSX/AudioDevice.cpp MacOSX/AudioDevice.h MacOSX/audio_macosx.cpp \
|
||||||
|
MacOSX/utils_macosx.mm MacOSX/utils_macosx.h \
|
||||||
Windows/cd_defs.h Windows/cdenable Windows/extfs_windows.cpp \
|
Windows/cd_defs.h Windows/cdenable Windows/extfs_windows.cpp \
|
||||||
Windows/posix_emu.cpp Windows/posix_emu.h Windows/sys_windows.cpp \
|
Windows/posix_emu.cpp Windows/posix_emu.h Windows/sys_windows.cpp \
|
||||||
Windows/timer_windows.cpp Windows/util_windows.cpp \
|
Windows/timer_windows.cpp Windows/util_windows.cpp \
|
||||||
|
@ -708,6 +708,8 @@ if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
|
|||||||
KEYCODES="../SDL/keycodes"
|
KEYCODES="../SDL/keycodes"
|
||||||
if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
|
if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
|
||||||
EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
|
EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
|
||||||
|
EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/utils_macosx.mm"
|
||||||
|
CPPFLAGS="$CPPFLAGS -I../MacOSX"
|
||||||
else
|
else
|
||||||
EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
|
EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user