From 4f55b360ac0ad3e2e66d7e7c79a04d11ef69f8f8 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 16 Nov 2015 04:17:13 +0100 Subject: [PATCH] Create HAVE_BTSTACK ifdef --- griffin/griffin.c | 6 ++++-- input/input_hid_driver.c | 2 +- .../RetroArch_iOS.xcodeproj/project.pbxproj | 6 ++++++ ui/drivers/ui_cocoatouch.m | 18 ++++++++++++------ 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/griffin/griffin.c b/griffin/griffin.c index 5de7e255a2..f000811b2a 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -395,9 +395,11 @@ INPUT (HID) #include "../input/drivers_hid/libusb_hid.c" #endif -#if defined(__APPLE__) && defined(IOS) +#ifdef HAVE_BTSTACK #include "../input/drivers_hid/btstack_hid.c" -#elif defined(__APPLE__) && defined(HAVE_IOHIDMANAGER) +#endif + +#if defined(__APPLE__) && defined(HAVE_IOHIDMANAGER) #include "../input/drivers_hid/iohidmanager_hid.c" #endif diff --git a/input/input_hid_driver.c b/input/input_hid_driver.c index d86a305624..9ce7570387 100644 --- a/input/input_hid_driver.c +++ b/input/input_hid_driver.c @@ -23,7 +23,7 @@ #include "../string_list_special.h" static hid_driver_t *hid_drivers[] = { -#if defined(__APPLE__) && defined(IOS) +#if defined(HAVE_BTSTACK) &btstack_hid, #endif #if defined(__APPLE__) && defined(HAVE_IOHIDMANAGER) diff --git a/pkg/apple/RetroArch_iOS.xcodeproj/project.pbxproj b/pkg/apple/RetroArch_iOS.xcodeproj/project.pbxproj index bbfe82d7f3..d4fd077f1f 100644 --- a/pkg/apple/RetroArch_iOS.xcodeproj/project.pbxproj +++ b/pkg/apple/RetroArch_iOS.xcodeproj/project.pbxproj @@ -553,6 +553,7 @@ "-DHAVE_MEMMAP", "-D_LZMA_UINT32_IS_ULONG", "-DHAVE_MFI", + "-DHAVE_BTSTACK", "-DHAVE_AVFOUNDATION", ); PRODUCT_BUNDLE_IDENTIFIER = com.libretro.RetroArch9; @@ -627,6 +628,7 @@ "-DHAVE_MEMMAP", "-D_LZMA_UINT32_IS_ULONG", "-DHAVE_MFI", + "-DHAVE_BTSTACK", "-DHAVE_AVFOUNDATION", ); "OTHER_CFLAGS[arch=*]" = ( @@ -671,6 +673,7 @@ "-DHAVE_MEMMAP", "-D_LZMA_UINT32_IS_ULONG", "-DHAVE_MFI", + "-DHAVE_BTSTACK", "-DHAVE_AVFOUNDATION", ); PRODUCT_BUNDLE_IDENTIFIER = com.libretro.RetroArch9; @@ -1055,6 +1058,7 @@ "-DHAVE_MEMMAP", "-D_LZMA_UINT32_IS_ULONG", "-DHAVE_MFI", + "-DHAVE_BTSTACK", "-DHAVE_AVFOUNDATION", ); PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1128,6 +1132,7 @@ "-DHAVE_MEMMAP", "-D_LZMA_UINT32_IS_ULONG", "-DHAVE_MFI", + "-DHAVE_BTSTACK", "-DHAVE_AVFOUNDATION", ); "OTHER_CFLAGS[arch=*]" = ( @@ -1172,6 +1177,7 @@ "-DHAVE_MEMMAP", "-D_LZMA_UINT32_IS_ULONG", "-DHAVE_MFI", + "-DHAVE_BTSTACK", "-DHAVE_AVFOUNDATION", ); PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/ui/drivers/ui_cocoatouch.m b/ui/drivers/ui_cocoatouch.m index 0bbc1ddeab..d293c33b76 100644 --- a/ui/drivers/ui_cocoatouch.m +++ b/ui/drivers/ui_cocoatouch.m @@ -28,10 +28,13 @@ #include "../../menu/menu_setting.h" #include "../../retroarch.h" -#include "../../input/drivers_hid/btstack_hid.h" #include "../../frontend/frontend.h" #include "../../runloop_data.h" +#ifdef HAVE_BTSTACK +#include "../../input/drivers_hid/btstack_hid.h" +#endif + static char msg_old[PATH_MAX_LENGTH]; static id apple_platform; static CFRunLoopObserverRef iterate_observer; @@ -280,7 +283,9 @@ enum self.mainmenu.last_menu = self.mainmenu; [self pushViewController:self.mainmenu animated:NO]; +#ifdef HAVE_BTSTACK btpad_set_inquiry_state(false); +#endif [self refreshSystemConfig]; [self showGameView]; @@ -385,8 +390,6 @@ enum - (void)refreshSystemConfig { - bool is_btstack; - /* Get enabled orientations */ apple_frontend_settings.orientation_flags = UIInterfaceOrientationMaskAll; @@ -395,10 +398,11 @@ enum else if (!strcmp(apple_frontend_settings.orientations, "portrait")) apple_frontend_settings.orientation_flags = UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown; +#ifdef HAVE_BTSTACK /* Set bluetooth mode */ - is_btstack = !(strcmp(apple_frontend_settings.bluetooth_mode, "btstack")); - - btstack_set_poweron(is_btstack); + if (!(strcmp(apple_frontend_settings.bluetooth_mode, "btstack"))) + btstack_set_poweron(is_btstack); +#endif } - (void)mainMenuRefresh @@ -457,7 +461,9 @@ void apple_rarch_exited(void) if (!ap) return; [ap showPauseMenu:ap]; +#ifdef HAVE_BTSTACK btpad_set_inquiry_state(true); +#endif } typedef struct ui_companion_cocoatouch