From 3f47951d3dc9c14d79b08a35b52cd6caa878948d Mon Sep 17 00:00:00 2001 From: Squarepusher Date: Fri, 22 Nov 2013 01:10:35 +0100 Subject: [PATCH] (Apple) Build fix --- .../phoenix/libs/appcompat/project.properties | 2 +- android/phoenix/project.properties | 2 +- apple/common/RetroArch_Apple.h | 15 +------ apple/common/apple_export.h | 39 +++++++++++++++++++ apple/common/utility.m | 8 ---- frontend/platform/platform_apple.c | 12 +++++- 6 files changed, 53 insertions(+), 25 deletions(-) create mode 100644 apple/common/apple_export.h diff --git a/android/phoenix/libs/appcompat/project.properties b/android/phoenix/libs/appcompat/project.properties index 484dab0753..91d2b02460 100644 --- a/android/phoenix/libs/appcompat/project.properties +++ b/android/phoenix/libs/appcompat/project.properties @@ -11,5 +11,5 @@ #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt # Project target. -target=android-17 +target=android-19 android.library=true diff --git a/android/phoenix/project.properties b/android/phoenix/project.properties index f98403784c..92681cec61 100644 --- a/android/phoenix/project.properties +++ b/android/phoenix/project.properties @@ -11,6 +11,6 @@ #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt # Project target. -target=android-17 +target=android-19 android.library.reference.1=libs/appcompat android.library=false diff --git a/apple/common/RetroArch_Apple.h b/apple/common/RetroArch_Apple.h index 4850e060bb..b76d1a0cbd 100644 --- a/apple/common/RetroArch_Apple.h +++ b/apple/common/RetroArch_Apple.h @@ -20,6 +20,7 @@ #include #import #import "RAModuleInfo.h" +#include "apple_export.h" #define GSEVENT_TYPE_KEYDOWN 10 #define GSEVENT_TYPE_KEYUP 11 @@ -48,24 +49,10 @@ extern RAModuleInfo* apple_core; extern id apple_platform; // main.m -enum basic_event_t { - RESET = 1, - LOAD_STATE = 2, - SAVE_STATE = 3, - QUIT = 4 -}; -extern void apple_event_basic_command(void* userdata); -extern void apple_event_set_state_slot(void* userdata); -extern void apple_event_show_rgui(void* userdata); - -extern void apple_refresh_config(); -extern void apple_enter_stasis(); -extern void apple_exit_stasis(bool reload_config); extern void apple_run_core(RAModuleInfo* core, const char* file); // utility.m extern void apple_display_alert(NSString* message, NSString* title); -extern void objc_clear_config_hack(); extern bool path_make_and_check_directory(const char* path, mode_t mode, int amode); extern NSString* objc_get_value_from_config(config_file_t* config, NSString* name, NSString* defaultValue); diff --git a/apple/common/apple_export.h b/apple/common/apple_export.h new file mode 100644 index 0000000000..4a89e6f715 --- /dev/null +++ b/apple/common/apple_export.h @@ -0,0 +1,39 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2013 - Jason Fetters + * Copyright (C) 2011-2013 - Daniel De Matteis + * + * RetroArch 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 Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch 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 RetroArch. + * If not, see . + */ + +#ifndef __APPLE_EXPORT_H +#define __APPLE_EXPORT_H + +#include + +enum basic_event_t { + RESET = 1, + LOAD_STATE = 2, + SAVE_STATE = 3, + QUIT = 4 +}; +extern void apple_event_basic_command(void* userdata); +extern void apple_event_set_state_slot(void* userdata); +extern void apple_event_show_rgui(void* userdata); + +extern void apple_refresh_config(void); +extern void apple_enter_stasis(void); +extern void apple_exit_stasis(bool reload_config); +extern void objc_clear_config_hack(void); + +extern bool apple_is_running; + +#endif diff --git a/apple/common/utility.m b/apple/common/utility.m index cef3483e8a..fe084167af 100644 --- a/apple/common/utility.m +++ b/apple/common/utility.m @@ -42,14 +42,6 @@ void apple_display_alert(NSString* message, NSString* title) #endif } -// Little nudge to prevent stale values when reloading the confg file -void objc_clear_config_hack() -{ - g_extern.block_config_read = false; - memset(g_settings.input.overlay, 0, sizeof(g_settings.input.overlay)); - memset(g_settings.video.shader_path, 0, sizeof(g_settings.video.shader_path)); -} - // Fetch a value from a config file, returning defaultValue if the value is not present NSString* objc_get_value_from_config(config_file_t* config, NSString* name, NSString* defaultValue) { diff --git a/frontend/platform/platform_apple.c b/frontend/platform/platform_apple.c index 3bd517ec91..9a5e1d1b9b 100644 --- a/frontend/platform/platform_apple.c +++ b/frontend/platform/platform_apple.c @@ -17,6 +17,7 @@ #include #include #include "../../apple/common/rarch_wrapper.h" +#include "../../apple/common/apple_export.h" #include "../frontend_context.h" @@ -51,7 +52,8 @@ void apple_frontend_post_event(void (*fn)(void*), void* userdata) void apple_event_basic_command(void* userdata) { - switch ((enum basic_event_t)userdata) + int action = (int)userdata; + switch (action) { case RESET: rarch_game_reset(); @@ -80,6 +82,14 @@ void apple_event_show_rgui(void* userdata) g_extern.lifecycle_state |= (1ULL << (in_menu ? MODE_GAME : MODE_MENU)); } +// Little nudge to prevent stale values when reloading the confg file +void objc_clear_config_hack(void) +{ + g_extern.block_config_read = false; + memset(g_settings.input.overlay, 0, sizeof(g_settings.input.overlay)); + memset(g_settings.video.shader_path, 0, sizeof(g_settings.video.shader_path)); +} + static void event_reload_config(void* userdata) { objc_clear_config_hack();