From 60008fe478236ab2459a561b005d64ea422233a1 Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Wed, 24 Feb 2021 22:00:02 -0700 Subject: [PATCH] Add OEFCBridging. Mark more symbols as static. --- Compatibility/OEFCBridging.h | 37 +++++++++++++++++++++++++++++++ Compatibility/nullDC.cpp | 5 ++--- Flycast.xcodeproj/project.pbxproj | 2 ++ FlycastGameCore.mm | 5 ++--- 4 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 Compatibility/OEFCBridging.h diff --git a/Compatibility/OEFCBridging.h b/Compatibility/OEFCBridging.h new file mode 100644 index 0000000..4051055 --- /dev/null +++ b/Compatibility/OEFCBridging.h @@ -0,0 +1,37 @@ +// Copyright (c) 2021, OpenEmu Team +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of the OpenEmu Team nor the +// names of its contributors may be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY OpenEmu Team ''AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL OpenEmu Team BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef OEFCBridging_h +#define OEFCBridging_h + +// This header is to make sure that symbols are the same +// in both FlycastGameCore.mm and nullDC.cpp + +#include + +extern char bios_dir[1024]; + +extern void dc_SetStateName (const std::string &fileName); + +#endif /* OEFCBridging_h */ diff --git a/Compatibility/nullDC.cpp b/Compatibility/nullDC.cpp index 29fb82e..ab6cc79 100755 --- a/Compatibility/nullDC.cpp +++ b/Compatibility/nullDC.cpp @@ -44,10 +44,9 @@ extern bool fast_forward_mode; //OpenEmu start +#include "OEFCBridging.h" #include -std::string OEStateFilePath; - -extern char bios_dir[1024]; +static std::string OEStateFilePath; void dc_SetStateName (const std::string &fileName) { diff --git a/Flycast.xcodeproj/project.pbxproj b/Flycast.xcodeproj/project.pbxproj index 57b5bd2..7b1f042 100644 --- a/Flycast.xcodeproj/project.pbxproj +++ b/Flycast.xcodeproj/project.pbxproj @@ -690,6 +690,7 @@ 08E24C2C1BA2437900EEA1A5 /* OEDCSystemResponderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OEDCSystemResponderClient.h; path = ../OpenEmu/SystemPlugins/Dreamcast/OEDCSystemResponderClient.h; sourceTree = ""; }; 08E24C2D1BA2489000EEA1A5 /* Flycast-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Flycast-Prefix.pch"; sourceTree = SOURCE_ROOT; }; 552EA8D625E47EA600879856 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; + 554395D325E763C600004D74 /* OEFCBridging.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OEFCBridging.h; sourceTree = ""; }; 554FCB7D25E6F4F6000B8B24 /* zip_algorithm_bzip2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_algorithm_bzip2.c; sourceTree = ""; }; 554FCB7E25E6F4F6000B8B24 /* zip_crypto_commoncrypto.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_crypto_commoncrypto.c; sourceTree = ""; }; 554FCB7F25E6F4F6000B8B24 /* zip_crypto_commoncrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zip_crypto_commoncrypto.h; sourceTree = ""; }; @@ -2658,6 +2659,7 @@ 5FEEDA8C25E46756000ABF02 /* deps_headers */, EE0D7176228F83CA00D721E9 /* version.h */, EE08144C21913448007FD1AB /* nullDC.cpp */, + 554395D325E763C600004D74 /* OEFCBridging.h */, ); path = Compatibility; sourceTree = ""; diff --git a/FlycastGameCore.mm b/FlycastGameCore.mm index 0e8f84b..10867c4 100644 --- a/FlycastGameCore.mm +++ b/FlycastGameCore.mm @@ -29,6 +29,7 @@ #import #include "audiobackend_openemu.h" +#include "OEFCBridging.h" #include "types.h" #include "emulator.h" @@ -102,7 +103,7 @@ __weak FlycastGameCore *_current; free(_soundBuffer); } -bool system_init; +static bool system_init; char bios_dir[1024]; # pragma mark - Reicast Execution functions @@ -113,8 +114,6 @@ extern void dc_start_game(const char *path); extern int screen_width,screen_height; -extern void dc_SetStateName (const std::string &fileName); - int darw_printf(const char* text,...) { va_list args;