mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-25 08:59:58 +00:00
(Apple) Build fix for platforms where we have ARC
enabled - can't use NSAutoreleasePool directly it seems
This commit is contained in:
parent
03495fdc3a
commit
223448d943
@ -242,6 +242,19 @@ static bool g_is_syncing = true;
|
||||
|
||||
static RAScreen* get_chosen_screen()
|
||||
{
|
||||
#if __has_feature(objc_arc)
|
||||
@autoreleasepool {
|
||||
if (g_settings.video.monitor_index >= RAScreen.screens.count)
|
||||
{
|
||||
RARCH_WARN("video_monitor_index is greater than the number of connected monitors; using main screen instead.\n");
|
||||
return RAScreen.mainScreen;
|
||||
}
|
||||
|
||||
NSArray *screens = [RAScreen screens];
|
||||
RAScreen *s = (RAScreen*)[screens objectAtIndex:g_settings.video.monitor_index];
|
||||
return s;
|
||||
}
|
||||
#else
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
if (g_settings.video.monitor_index >= RAScreen.screens.count)
|
||||
@ -255,6 +268,7 @@ static RAScreen* get_chosen_screen()
|
||||
RAScreen *s = (RAScreen*)[screens objectAtIndex:g_settings.video.monitor_index];
|
||||
[pool drain];
|
||||
return s;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool apple_gfx_ctx_init()
|
||||
|
2
gfx/gl.c
2
gfx/gl.c
@ -1199,6 +1199,7 @@ static void gl_init_textures(void *data, const video_info_t *video)
|
||||
static inline void gl_copy_frame(void *data, const void *frame, unsigned width, unsigned height, unsigned pitch)
|
||||
{
|
||||
unsigned h;
|
||||
(void)h;
|
||||
gl_t *gl = (gl_t*)data;
|
||||
#if defined(HAVE_OPENGLES2)
|
||||
#if defined(HAVE_EGL)
|
||||
@ -2335,6 +2336,7 @@ static bool gl_read_viewport(void *data, uint8_t *buffer)
|
||||
{
|
||||
unsigned i;
|
||||
gl_t *gl = (gl_t*)data;
|
||||
(void)i;
|
||||
|
||||
RARCH_PERFORMANCE_INIT(read_viewport);
|
||||
RARCH_PERFORMANCE_START(read_viewport);
|
||||
|
Loading…
Reference in New Issue
Block a user