diff --git a/es-app/src/CollectionSystemManager.cpp b/es-app/src/CollectionSystemManager.cpp index f4e0aa1d2..11096e909 100644 --- a/es-app/src/CollectionSystemManager.cpp +++ b/es-app/src/CollectionSystemManager.cpp @@ -128,7 +128,7 @@ void CollectionSystemManager::saveCustomCollection(SystemData* sys) CollectionSystemData sysData = mCustomCollectionSystemsData.at(name); if (sysData.needsSave) { std::ofstream configFile; - #ifdef _WIN64 + #if defined(_WIN64) configFile.open(Utils::String:: stringToWideString(getCustomCollectionConfigPath(name)).c_str()); #else @@ -996,7 +996,7 @@ std::vector CollectionSystemManager::getSystemsFromConfig() return systems; pugi::xml_document doc; - #ifdef _WIN64 + #if defined(_WIN64) pugi::xml_parse_result res = doc.load_file(Utils::String::stringToWideString(path).c_str()); #else pugi::xml_parse_result res = doc.load_file(path.c_str()); diff --git a/es-app/src/Gamelist.cpp b/es-app/src/Gamelist.cpp index 0fa05c47b..aa3b62476 100644 --- a/es-app/src/Gamelist.cpp +++ b/es-app/src/Gamelist.cpp @@ -15,6 +15,7 @@ #include "Log.h" #include "Settings.h" #include "SystemData.h" + #include FileData* findOrCreateFile(SystemData* system, const std::string& path, FileType type) @@ -94,7 +95,7 @@ void parseGamelist(SystemData* system) LOG(LogInfo) << "Parsing XML file \"" << xmlpath << "\"..."; pugi::xml_document doc; - #ifdef _WIN64 + #if defined(_WIN64) pugi::xml_parse_result result = doc.load_file(Utils::String::stringToWideString(xmlpath).c_str()); #else @@ -204,7 +205,7 @@ void updateGamelist(SystemData* system) if (Utils::FileSystem::exists(xmlReadPath)) { // Parse an existing file first. - #ifdef _WIN64 + #if defined(_WIN64) pugi::xml_parse_result result = doc.load_file(Utils::String::stringToWideString(xmlReadPath).c_str()); #else @@ -288,7 +289,7 @@ void updateGamelist(SystemData* system) LOG(LogInfo) << "Added/Updated " << numUpdated << " entities in '" << xmlReadPath << "'"; - #ifdef _WIN64 + #if defined(_WIN64) if (!doc.save_file(Utils::String::stringToWideString(xmlWritePath).c_str())) { #else if (!doc.save_file(xmlWritePath.c_str())) { diff --git a/es-app/src/SystemData.cpp b/es-app/src/SystemData.cpp index fd21295c1..72212368c 100644 --- a/es-app/src/SystemData.cpp +++ b/es-app/src/SystemData.cpp @@ -226,7 +226,7 @@ bool SystemData::loadConfig() } pugi::xml_document doc; - #ifdef _WIN64 + #if defined(_WIN64) pugi::xml_parse_result res = doc.load_file(Utils::String::stringToWideString(path).c_str()); #else pugi::xml_parse_result res = doc.load_file(path.c_str()); @@ -307,7 +307,7 @@ bool SystemData::loadConfig() // Convert path to generic directory seperators. path = Utils::FileSystem::getGenericPath(path); - #ifdef _WIN64 + #if defined(_WIN64) if (!Settings::getInstance()->getBool("ShowHiddenFiles") && Utils::FileSystem::isHidden(path)) { LOG(LogWarning) << "Skipping hidden ROM folder " << path; diff --git a/es-app/src/SystemScreenSaver.cpp b/es-app/src/SystemScreenSaver.cpp index 6d4bc602f..82a3f4c9f 100644 --- a/es-app/src/SystemScreenSaver.cpp +++ b/es-app/src/SystemScreenSaver.cpp @@ -7,7 +7,7 @@ #include "SystemScreenSaver.h" -#ifdef _RPI_ +#if defined(_RPI_) #include "components/VideoPlayerComponent.h" #endif #include "components/VideoVlcComponent.h" @@ -24,7 +24,7 @@ #include #include -#ifdef _WIN64 +#if defined(_WIN64) #include #endif @@ -104,7 +104,7 @@ void SystemScreenSaver::startScreenSaver() } if (!path.empty() && Utils::FileSystem::exists(path)) { - #ifdef _RPI_ + #if defined(_RPI_) // Create the correct type of video component if (Settings::getInstance()->getBool("ScreenSaverOmxPlayer")) mVideoScreensaver = new VideoPlayerComponent(mWindow, getTitlePath()); @@ -330,7 +330,7 @@ void SystemScreenSaver::pickGameListNode(unsigned long index, mCurrentGame = (*itf); // End of getting FileData. - #ifdef _RPI_ + #if defined(_RPI_) if (Settings::getInstance()->getString("ScreenSaverGameInfo") != "never") writeSubtitle(mGameName.c_str(), mSystemName.c_str(), (Settings::getInstance()->getString("ScreenSaverGameInfo") == diff --git a/es-app/src/VolumeControl.cpp b/es-app/src/VolumeControl.cpp index 46ebd768f..2320fd5de 100644 --- a/es-app/src/VolumeControl.cpp +++ b/es-app/src/VolumeControl.cpp @@ -114,7 +114,7 @@ void VolumeControl::init() // Try to open mixer device. if (mixerHandle == nullptr) { // Allow user to override the AudioCard and AudioDevice in es_settings.cfg. - #ifdef _RPI_ + #if defined(_RPI_) mixerCard = Settings::getInstance()->getString("AudioCard").c_str(); mixerName = Settings::getInstance()->getString("AudioDevice").c_str(); #endif diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index 7f8c7059c..c533e93dc 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -93,12 +93,12 @@ void GuiMenu::openSoundSettings() // The code is still active for Raspberry Pi though as I'm not sure if this is // useful for that device. // #if defined(__linux__) - #ifdef _RPI_ + #if defined(_RPI_) // audio card auto audio_card = std::make_shared> (mWindow, getHelpStyle(), "AUDIO CARD", false); std::vector audio_cards; - #ifdef _RPI_ + #if defined(_RPI_) // RPi Specific Audio Cards audio_cards.push_back("local"); audio_cards.push_back("hdmi"); @@ -150,7 +150,7 @@ void GuiMenu::openSoundSettings() }); #endif - #ifdef _RPI_ + #if defined(_RPI_) // OMX player Audio Device auto omx_audio_dev = std::make_shared> (mWindow, getHelpStyle(), "OMX PLAYER AUDIO DEVICE", false); @@ -507,7 +507,7 @@ void GuiMenu::openOtherSettings() s->addSaveFunc([max_vram] { Settings::getInstance()->setInt("MaxVRAM", (int)Math::round(max_vram->getValue())); }); - #ifdef __unix__ + #if defined(__unix__) // Fullscreen mode. auto fullscreen_mode = std::make_shared> (mWindow, getHelpStyle(), "FULLSCREEN MODE", false); @@ -549,7 +549,7 @@ void GuiMenu::openOtherSettings() PowerSaver::init(); }); - #ifdef _RPI_ + #if defined(_RPI_) // Video Player - VideoOmxPlayer. auto omx_player = std::make_shared(mWindow); omx_player->setState(Settings::getInstance()->getBool("VideoOmxPlayer")); @@ -616,7 +616,7 @@ void GuiMenu::openOtherSettings() }); s->addRow(row); - #ifdef _WIN64 + #if defined(_WIN64) // Hide taskbar during ES program session. auto hide_taskbar = std::make_shared(mWindow); hide_taskbar->setState(Settings::getInstance()->getBool("HideTaskbar")); diff --git a/es-app/src/guis/GuiVideoScreensaverOptions.cpp b/es-app/src/guis/GuiVideoScreensaverOptions.cpp index 468990179..c1c321524 100644 --- a/es-app/src/guis/GuiVideoScreensaverOptions.cpp +++ b/es-app/src/guis/GuiVideoScreensaverOptions.cpp @@ -33,7 +33,7 @@ GuiVideoScreensaverOptions::GuiVideoScreensaverOptions(Window* window, const cha addSaveFunc([stretch_screensaver] { Settings::getInstance()-> setBool("ScreenSaverStretchVideos", stretch_screensaver->getState()); }); - #ifdef _RPI_ + #if defined(_RPI_) auto ss_omx = std::make_shared(mWindow); ss_omx->setState(Settings::getInstance()->getBool("ScreenSaverOmxPlayer")); addWithLabel("USE OMX PLAYER FOR SCREENSAVER", ss_omx); @@ -87,7 +87,7 @@ GuiVideoScreensaverOptions::GuiVideoScreensaverOptions(Window* window, const cha addSaveFunc([ss_video_audio] { Settings::getInstance()-> setBool("ScreenSaverVideoAudio", ss_video_audio->getState()); }); - #ifdef _RPI_ + #if defined(_RPI_) // Define subtitle font. auto ss_omx_font_file = std::make_shared(mWindow, "", Font::get(FONT_SIZE_SMALL), 0x777777FF); @@ -115,14 +115,14 @@ GuiVideoScreensaverOptions::~GuiVideoScreensaverOptions() void GuiVideoScreensaverOptions::save() { - #ifdef _RPI_ + #if defined(_RPI_) bool startingStatusNotRisky = (Settings::getInstance()-> getString("ScreenSaverGameInfo") == "never" || !Settings::getInstance()->getBool("ScreenSaverOmxPlayer")); #endif GuiScreensaverOptions::save(); - #ifdef _RPI_ + #if defined(_RPI_) bool endStatusRisky = (Settings::getInstance()->getString("ScreenSaverGameInfo") != "never" && Settings::getInstance()->getBool("ScreenSaverOmxPlayer")); if (startingStatusNotRisky && endStatusRisky) { diff --git a/es-app/src/main.cpp b/es-app/src/main.cpp index e3e93dd35..718035778 100644 --- a/es-app/src/main.cpp +++ b/es-app/src/main.cpp @@ -54,7 +54,7 @@ enum returnCode { NO_ROMS }; -#ifdef _WIN64 +#if defined(_WIN64) enum eConsoleType { NO_CONSOLE, PARENT_CONSOLE, @@ -137,7 +137,7 @@ bool parseArgs(int argc, char* argv[]) { Utils::FileSystem::setExePath(argv[0]); - #ifdef _WIN64 + #if defined(_WIN64) // Print any command line output to the console. if (argc > 1) eConsoleType ConsoleType = outputToConsole(false); @@ -151,7 +151,7 @@ bool parseArgs(int argc, char* argv[]) std::cerr << "Error: No home path supplied with \'--home'.\n"; return false; } - #ifdef _WIN64 + #if defined(_WIN64) if (!Utils::FileSystem::exists(argv[i + 1]) && (!Utils::FileSystem::driveExists(argv[i + 1]))) { #else @@ -378,7 +378,7 @@ returnCode loadSystemConfigFile(std::string& errorMsg) "THAT YOUR FILE EXTENSIONS AND SYSTEMS DIRECTORY\n" "NAMES ARE SUPPORTED BY EMULATIONSTATION-DE.\n" "THIS IS THE CURRENTLY CONFIGURED ROM DIRECTORY:\n"; - #ifdef _WIN64 + #if defined(_WIN64) errorMsg += Utils::String::replace(FileData::getROMDirectory(), "/", "\\"); #else errorMsg += FileData::getROMDirectory(); @@ -403,19 +403,19 @@ int main(int argc, char* argv[]) std::locale::global(std::locale("C")); if (!parseArgs(argc, argv)) { - #ifdef _WIN64 + #if defined(_WIN64) closeConsole(); #endif return 0; } - #ifdef _WIN64 + #if defined(_WIN64) // Send debug output to the console.. if (Settings::getInstance()->getBool("Debug")) outputToConsole(true); #endif - #ifdef _WIN64 + #if defined(_WIN64) // Hide taskbar if the setting for this is enabled. bool taskbarStateChanged = false; unsigned int taskbarState; @@ -428,7 +428,7 @@ int main(int argc, char* argv[]) #endif // Call this ONLY when linking with FreeImage as a static library. - #ifdef FREEIMAGE_LIB + #if defined(FREEIMAGE_LIB) FreeImage_Initialise(); #endif @@ -525,7 +525,7 @@ int main(int argc, char* argv[]) window.pushGui(new GuiMsgBox(&window, helpStyle, errorMsg.c_str(), "CHANGE ROM DIRECTORY", [&window, &helpStyle, updateVal] { std::string currentROMDirectory; - #ifdef _WIN64 + #if defined(_WIN64) currentROMDirectory = Utils::String::replace(FileData::getROMDirectory(), "/", "\\"); #else @@ -665,11 +665,11 @@ int main(int argc, char* argv[]) SystemData::deleteSystems(); // Call this ONLY when linking with FreeImage as a static library. - #ifdef FREEIMAGE_LIB + #if defined(FREEIMAGE_LIB) FreeImage_DeInitialise(); #endif - #ifdef _WIN64 + #if defined(_WIN64) // If the taskbar state was changed (taskbar was hidden), then revert it. if (taskbarStateChanged) revertTaskbarState(taskbarState); @@ -679,7 +679,7 @@ int main(int argc, char* argv[]) LOG(LogInfo) << "EmulationStation cleanly shutting down."; - #ifdef _WIN64 + #if defined(_WIN64) closeConsole(); #endif diff --git a/es-app/src/scrapers/Scraper.cpp b/es-app/src/scrapers/Scraper.cpp index d7253c58e..2fae09678 100644 --- a/es-app/src/scrapers/Scraper.cpp +++ b/es-app/src/scrapers/Scraper.cpp @@ -255,7 +255,7 @@ MDResolveHandle::MDResolveHandle(const ScraperSearchResult& result, return; } - #ifdef _WIN64 + #if defined(_WIN64) std::ofstream stream(Utils::String::stringToWideString(filePath).c_str(), std::ios_base::out | std::ios_base::binary); #else @@ -386,7 +386,7 @@ void MediaDownloadHandle::update() return; } - #ifdef _WIN64 + #if defined(_WIN64) std::ofstream stream(Utils::String::stringToWideString(mSavePath).c_str(), std::ios_base::out | std::ios_base::binary); #else diff --git a/es-app/src/views/ViewController.cpp b/es-app/src/views/ViewController.cpp index a8d2419aa..a5eb6c76f 100644 --- a/es-app/src/views/ViewController.cpp +++ b/es-app/src/views/ViewController.cpp @@ -433,7 +433,7 @@ bool ViewController::input(InputConfig* config, Input input) if (mLockInput) return true; - #ifdef _WIN64 + #if defined(_WIN64) // This code is only needed for Windows, where we may need to keep ES running while // the game/emulator is in use. It's basically used to pause any playing game video // and to keep the screensaver from activating. @@ -570,7 +570,7 @@ void ViewController::reloadGameListView(IGameListView* view, bool reloadTheme) } } - #ifdef _WIN64 + #if defined(_WIN64) // This code is only needed for Windows, where we may need to keep ES running while // the game/emulator is in use. It's basically used to pause any playing game video // and to keep the screensaver from activating. diff --git a/es-app/src/views/gamelist/GridGameListView.cpp b/es-app/src/views/gamelist/GridGameListView.cpp index 98a115d84..1ac245f77 100644 --- a/es-app/src/views/gamelist/GridGameListView.cpp +++ b/es-app/src/views/gamelist/GridGameListView.cpp @@ -13,7 +13,7 @@ #include "Settings.h" #include "SystemData.h" #include "Sound.h" -#ifdef _RPI_ +#if defined(_RPI_) #include "components/VideoPlayerComponent.h" #endif #include "components/VideoVlcComponent.h" @@ -54,7 +54,7 @@ GridGameListView::GridGameListView( const float padding = 0.01f; // Create the correct type of video window. - #ifdef _RPI_ + #if defined(_RPI_) if (Settings::getInstance()->getBool("VideoOmxPlayer")) mVideo = new VideoPlayerComponent(window, ""); else diff --git a/es-app/src/views/gamelist/VideoGameListView.cpp b/es-app/src/views/gamelist/VideoGameListView.cpp index 14b99e422..b8c5f1a54 100644 --- a/es-app/src/views/gamelist/VideoGameListView.cpp +++ b/es-app/src/views/gamelist/VideoGameListView.cpp @@ -7,13 +7,13 @@ #include "views/gamelist/VideoGameListView.h" #include "animations/LambdaAnimation.h" -#ifdef _RPI_ +#if defined(_RPI_) #include "components/VideoPlayerComponent.h" #endif #include "components/VideoVlcComponent.h" #include "utils/FileSystemUtil.h" #include "views/ViewController.h" -#ifdef _RPI_ +#if defined(_RPI_) #include "Settings.h" #endif @@ -52,7 +52,7 @@ VideoGameListView::VideoGameListView( const float padding = 0.01f; // Create the correct type of video window. - #ifdef _RPI_ + #if defined(_RPI_) if (Settings::getInstance()->getBool("VideoOmxPlayer")) mVideo = new VideoPlayerComponent(window, ""); else diff --git a/es-core/src/CECInput.cpp b/es-core/src/CECInput.cpp index 66496148c..05af0ad7e 100644 --- a/es-core/src/CECInput.cpp +++ b/es-core/src/CECInput.cpp @@ -6,7 +6,7 @@ #include "CECInput.h" -#ifdef HAVE_LIBCEC +#if defined(HAVE_LIBCEC) #include "Log.h" #include // Bad bad cecloader. @@ -30,7 +30,7 @@ extern int SDL_USER_CECBUTTONUP; CECInput* CECInput::sInstance = nullptr; -#ifdef HAVE_LIBCEC +#if defined(HAVE_LIBCEC) static void onAlert(void* /*cbParam*/, const CEC::libcec_alert type, const CEC::libcec_parameter param) { @@ -58,7 +58,7 @@ static void onLogMessage(void* /*cbParam*/, const CEC::cec_log_message* message) LOG(LogDebug) << "CECInput::onLogMessage message: " << message->message; } -#ifdef _RPI_ +#if defined(_RPI_) static void vchi_tv_and_cec_init() { VCHI_INSTANCE_T vchi_instance; @@ -94,8 +94,8 @@ void CECInput::deinit() CECInput::CECInput() : mlibCEC(nullptr) { - #ifdef HAVE_LIBCEC - #ifdef _RPI_ + #if defined(HAVE_LIBCEC) + #if defined(_RPI_) // Restart vchi tv and CEC in case we just came back from another app using CEC (like Kodi). vchi_tv_and_cec_deinit(); vchi_tv_and_cec_init(); @@ -150,14 +150,14 @@ CECInput::CECInput() : mlibCEC(nullptr) CECInput::~CECInput() { - #ifdef HAVE_LIBCEC + #if defined(HAVE_LIBCEC) if (mlibCEC) { mlibCEC->Close(); UnloadLibCec(mlibCEC); mlibCEC = nullptr; } - #ifdef _RPI_ + #if defined(_RPI_) // Deinit vchi tv and CEC in case we are going to launch another app using CEC (like Kodi). vchi_tv_and_cec_deinit(); #endif // _RPI_ @@ -167,7 +167,7 @@ CECInput::~CECInput() std::string CECInput::getAlertTypeString(const unsigned int _type) { switch (_type) { - #ifdef HAVE_LIBCEC + #if defined(HAVE_LIBCEC) case CEC::CEC_ALERT_SERVICE_DEVICE: { return "Service-Device"; } break; case CEC::CEC_ALERT_CONNECTION_LOST: { return "Connection-Lost"; } break; case CEC::CEC_ALERT_PERMISSION_ERROR: { return "Permission-Error"; } break; @@ -184,7 +184,7 @@ std::string CECInput::getAlertTypeString(const unsigned int _type) std::string CECInput::getOpCodeString(const unsigned int _opCode) { switch (_opCode) { - #ifdef HAVE_LIBCEC + #if defined(HAVE_LIBCEC) case CEC::CEC_OPCODE_ACTIVE_SOURCE: { return "Active-Source"; } break; case CEC::CEC_OPCODE_IMAGE_VIEW_ON: { return "Image-View-On"; } break; case CEC::CEC_OPCODE_TEXT_VIEW_ON: { return "Text-View-On"; } break; @@ -265,7 +265,7 @@ std::string CECInput::getOpCodeString(const unsigned int _opCode) std::string CECInput::getKeyCodeString(const unsigned int _keyCode) { switch (_keyCode) { - #ifdef HAVE_LIBCEC + #if defined(HAVE_LIBCEC) case CEC::CEC_USER_CONTROL_CODE_SELECT: { return "Select"; } break; case CEC::CEC_USER_CONTROL_CODE_UP: { return "Up"; } break; case CEC::CEC_USER_CONTROL_CODE_DOWN: { return "Down"; } break; diff --git a/es-core/src/CECInput.h b/es-core/src/CECInput.h index c41c1327f..fe2a4f704 100644 --- a/es-core/src/CECInput.h +++ b/es-core/src/CECInput.h @@ -25,7 +25,7 @@ private: CECInput(); ~CECInput(); - static CECInput* sInstance; + static CECInput* sInstance; CEC::ICECAdapter* mlibCEC; }; diff --git a/es-core/src/HttpReq.cpp b/es-core/src/HttpReq.cpp index bfb94385b..b6cc07276 100644 --- a/es-core/src/HttpReq.cpp +++ b/es-core/src/HttpReq.cpp @@ -54,7 +54,7 @@ HttpReq::HttpReq(const std::string& url) : mStatus(REQ_IN_PROGRESS), mHandle(nul // Mozilla project). There is a possibility to use the OS provided Schannel certificates // but I haven't been able to get this to work and it also seems to be problematic on // older Windows versions. - #ifdef _WIN64 + #if defined(_WIN64) curl_easy_setopt(mHandle, CURLOPT_CAINFO, ResourceManager::getInstance()-> getResourcePath(":/certificates/curl-ca-bundle.crt").c_str()); #endif diff --git a/es-core/src/InputManager.cpp b/es-core/src/InputManager.cpp index 1320e1905..1998bd538 100644 --- a/es-core/src/InputManager.cpp +++ b/es-core/src/InputManager.cpp @@ -198,7 +198,7 @@ int InputManager::getButtonCountByDevice(SDL_JoystickID id) if (id == DEVICE_KEYBOARD) return 120; // It's a lot, okay. else if (id == DEVICE_CEC) - #ifdef HAVE_CECLIB + #if defined(HAVE_CECLIB) return CEC::CEC_USER_CONTROL_CODE_MAX; #else // HAVE_LIBCEF return 0; @@ -331,7 +331,7 @@ bool InputManager::loadInputConfig(InputConfig* config) } pugi::xml_document doc; - #ifdef _WIN64 + #if defined(_WIN64) pugi::xml_parse_result res = doc.load_file(Utils::String::stringToWideString(path).c_str()); #else pugi::xml_parse_result res = doc.load_file(path.c_str()); @@ -410,7 +410,7 @@ void InputManager::writeDeviceConfig(InputConfig* config) if (Utils::FileSystem::exists(path)) { // Merge files. - #ifdef _WIN64 + #if defined(_WIN64) pugi::xml_parse_result result = doc.load_file(Utils::String::stringToWideString(path).c_str()); #else @@ -454,7 +454,7 @@ void InputManager::writeDeviceConfig(InputConfig* config) config->writeToXML(root); - #ifdef _WIN64 + #if defined(_WIN64) doc.save_file(Utils::String::stringToWideString(path).c_str()); #else doc.save_file(path.c_str()); @@ -475,7 +475,7 @@ void InputManager::doOnFinish() pugi::xml_document doc; if (Utils::FileSystem::exists(path)) { - #ifdef _WIN64 + #if defined(_WIN64) pugi::xml_parse_result result = doc.load_file(Utils::String::stringToWideString(path).c_str()); #else diff --git a/es-core/src/Log.cpp b/es-core/src/Log.cpp index d40cfb8b6..6c249dad8 100644 --- a/es-core/src/Log.cpp +++ b/es-core/src/Log.cpp @@ -42,7 +42,7 @@ void Log::init() void Log::open() { - #ifdef _WIN64 + #if defined(_WIN64) file.open(Utils::String::stringToWideString(getLogPath()).c_str()); #else file.open(getLogPath().c_str()); diff --git a/es-core/src/MameNames.cpp b/es-core/src/MameNames.cpp index 9029ceabc..2d82a110e 100644 --- a/es-core/src/MameNames.cpp +++ b/es-core/src/MameNames.cpp @@ -50,7 +50,7 @@ MameNames::MameNames() LOG(LogInfo) << "Parsing XML file \"" << xmlpath << "\"..."; pugi::xml_document doc; - #ifdef _WIN64 + #if defined(_WIN64) pugi::xml_parse_result result = doc.load_file(Utils::String::stringToWideString(xmlpath).c_str()); #else @@ -80,7 +80,7 @@ MameNames::MameNames() LOG(LogInfo) << "Parsing XML file \"" << xmlpath << "\"..."; - #ifdef _WIN64 + #if defined(_WIN64) result = doc.load_file(Utils::String::stringToWideString(xmlpath).c_str()); #else result = doc.load_file(xmlpath.c_str()); @@ -106,7 +106,7 @@ MameNames::MameNames() LOG(LogInfo) << "Parsing XML file \"" << xmlpath << "\"..."; - #ifdef _WIN64 + #if defined(_WIN64) result = doc.load_file(Utils::String::stringToWideString(xmlpath).c_str()); #else result = doc.load_file(xmlpath.c_str()); diff --git a/es-core/src/Platform.cpp b/es-core/src/Platform.cpp index 97a9da049..63f701e1a 100644 --- a/es-core/src/Platform.cpp +++ b/es-core/src/Platform.cpp @@ -30,7 +30,7 @@ int runRebootCommand() { -#ifdef _WIN64 // Windows. +#if defined(_WIN64) // Windows. return system("shutdown -r -t 0"); #else // macOS and Linux. return system("shutdown --reboot now"); @@ -39,7 +39,7 @@ int runRebootCommand() int runPoweroffCommand() { -#ifdef _WIN64 // Windows. +#if defined(_WIN64) // Windows. return system("shutdown -s -t 0"); #else // macOS and Linux. return system("shutdown --poweroff now"); @@ -48,7 +48,7 @@ int runPoweroffCommand() int runSystemCommand(const std::string& cmd_utf8) { - #ifdef _WIN64 + #if defined(_WIN64) // On Windows we use _wsystem to support non-ASCII paths // which requires converting from UTF-8 to a wstring. std::wstring wchar_str = Utils::String::stringToWideString(cmd_utf8); @@ -60,7 +60,7 @@ int runSystemCommand(const std::string& cmd_utf8) int runSystemCommand(const std::wstring& cmd_utf16) { - #ifdef _WIN64 + #if defined(_WIN64) return _wsystem(cmd_utf16.c_str()); #else return 0; @@ -118,7 +118,7 @@ int launchEmulatorUnix(const std::string& cmd_utf8) int launchEmulatorWindows(const std::wstring& cmd_utf16) { - #ifdef _WIN64 + #if defined(_WIN64) STARTUPINFOW si {}; PROCESS_INFORMATION pi; @@ -187,7 +187,7 @@ int launchEmulatorWindows(const std::wstring& cmd_utf16) unsigned int getTaskbarState() { - #ifdef _WIN64 + #if defined(_WIN64) APPBARDATA barData; barData.cbSize = sizeof(APPBARDATA); return (UINT) SHAppBarMessage(ABM_GETSTATE, &barData); @@ -198,7 +198,7 @@ unsigned int getTaskbarState() void hideTaskbar() { - #ifdef _WIN64 + #if defined(_WIN64) APPBARDATA barData; barData.cbSize = sizeof(APPBARDATA); barData.lParam = ABS_AUTOHIDE; @@ -208,7 +208,7 @@ void hideTaskbar() void revertTaskbarState(unsigned int& state) { - #ifdef _WIN64 + #if defined(_WIN64) APPBARDATA barData; barData.cbSize = sizeof(APPBARDATA); barData.lParam = state; @@ -243,7 +243,7 @@ void emergencyShutdown() void touch(const std::string& filename) { -#ifdef _WIN64 +#if defined(_WIN64) FILE* fp = fopen(filename.c_str(), "ab+"); if (fp != nullptr) fclose(fp); diff --git a/es-core/src/Platform.h b/es-core/src/Platform.h index 0c6a65dae..6734c2c47 100644 --- a/es-core/src/Platform.h +++ b/es-core/src/Platform.h @@ -11,7 +11,7 @@ #include // Why the hell this naming inconsistency exists is well beyond me. -#ifdef _WIN64 +#if defined(_WIN64) #define sleep Sleep #endif diff --git a/es-core/src/Settings.cpp b/es-core/src/Settings.cpp index e5d74fcba..172ca3be5 100644 --- a/es-core/src/Settings.cpp +++ b/es-core/src/Settings.cpp @@ -100,7 +100,7 @@ void Settings::setDefaults() // UI settings -> screensaver settings -> video screensaver settings. mIntMap["ScreenSaverSwapVideoTimeout"] = 25000; mBoolMap["ScreenSaverStretchVideos"] = false; - #ifdef _RPI_ + #if defined(_RPI_) mStringMap["ScreenSaverGameInfo"] = "never"; #endif mBoolMap["ScreenSaverVideoAudio"] = false; @@ -124,11 +124,11 @@ void Settings::setDefaults() // settings could be added later on, if needed. // The code is still active for Raspberry Pi though as I'm not sure if this is // useful for that device. - #ifdef _RPI_ + #if defined(_RPI_) mStringMap["AudioCard"] = "default"; // Audio out device for volume control. //#endif - //#ifdef _RPI_ + //#if defined(_RPI_) mStringMap["AudioDevice"] = "PCM"; // Audio out device for Video playback using OMX player. mStringMap["OMXAudioDev"] = "both"; @@ -167,7 +167,7 @@ void Settings::setDefaults() mBoolMap["ScrapeVideos"] = true; // Other settings. - #ifdef _RPI_ + #if defined(_RPI_) mIntMap["MaxVRAM"] = 80; #else mIntMap["MaxVRAM"] = 128; @@ -179,7 +179,7 @@ void Settings::setDefaults() // This setting only applies to raspberry pi but set it for all platforms so // we don't get a warning if we encounter it on a different platform. mBoolMap["VideoOmxPlayer"] = false; - #ifdef _RPI_ + #if defined(_RPI_) // We're defaulting to OMX Player for full screen video on the Pi. mBoolMap["ScreenSaverOmxPlayer"] = true; // Use OMX Player defaults. @@ -191,7 +191,7 @@ void Settings::setDefaults() mBoolMap["ScreenSaverOmxPlayer"] = false; #endif mStringMap["SaveGamelistsMode"] = "always"; - #ifdef _WIN64 + #if defined(_WIN64) mBoolMap["HideTaskbar"] = false; // Set this to true as default as it's unreliable to suspend ES during game launches // on some Windows versions/installations. @@ -289,7 +289,7 @@ void Settings::saveFile() node.append_attribute("value").set_value(iter->second.c_str()); } - #ifdef _WIN64 + #if defined(_WIN64) doc.save_file(Utils::String::stringToWideString(path).c_str()); #else doc.save_file(path.c_str()); @@ -308,7 +308,7 @@ void Settings::loadFile() return; pugi::xml_document doc; - #ifdef _WIN64 + #if defined(_WIN64) pugi::xml_parse_result result = doc.load_file(Utils::String::stringToWideString(path).c_str()); #else pugi::xml_parse_result result = doc.load_file(path.c_str()); diff --git a/es-core/src/ThemeData.cpp b/es-core/src/ThemeData.cpp index 0764ffe6b..afdeade9e 100644 --- a/es-core/src/ThemeData.cpp +++ b/es-core/src/ThemeData.cpp @@ -260,7 +260,7 @@ void ThemeData::loadFile(std::map sysDataMap, const st mVariables.insert(sysDataMap.cbegin(), sysDataMap.cend()); pugi::xml_document doc; - #ifdef _WIN64 + #if defined(_WIN64) pugi::xml_parse_result res = doc.load_file(Utils::String::stringToWideString(path).c_str()); #else pugi::xml_parse_result res = doc.load_file(path.c_str()); @@ -306,7 +306,7 @@ void ThemeData::parseIncludes(const pugi::xml_node& root) mPaths.push_back(path); pugi::xml_document includeDoc; - #ifdef _WIN64 + #if defined(_WIN64) pugi::xml_parse_result result = includeDoc.load_file(Utils::String::stringToWideString(path).c_str()); #else diff --git a/es-core/src/components/VideoPlayerComponent.cpp b/es-core/src/components/VideoPlayerComponent.cpp index aada37351..940e8edf4 100644 --- a/es-core/src/components/VideoPlayerComponent.cpp +++ b/es-core/src/components/VideoPlayerComponent.cpp @@ -4,7 +4,7 @@ // OMXPlayer video playing for Raspberry Pi. // -#ifdef _RPI_ +#if defined(_RPI_) #include "components/VideoPlayerComponent.h" #include "renderers/Renderer.h" diff --git a/es-core/src/components/VideoPlayerComponent.h b/es-core/src/components/VideoPlayerComponent.h index 871570cd7..2cac10afe 100644 --- a/es-core/src/components/VideoPlayerComponent.h +++ b/es-core/src/components/VideoPlayerComponent.h @@ -4,7 +4,7 @@ // OMXPlayer video playing for Raspberry Pi. // -#ifdef _RPI_ +#if defined(_RPI_) #pragma once #ifndef ES_CORE_COMPONENTS_VIDEO_PLAYER_COMPONENT_H #define ES_CORE_COMPONENTS_VIDEO_PLAYER_COMPONENT_H diff --git a/es-core/src/components/VideoVlcComponent.cpp b/es-core/src/components/VideoVlcComponent.cpp index 468b99d5e..1f2c175f2 100644 --- a/es-core/src/components/VideoVlcComponent.cpp +++ b/es-core/src/components/VideoVlcComponent.cpp @@ -266,7 +266,7 @@ void VideoVlcComponent::startVideo() mVideoWidth = 0; mVideoHeight = 0; - #ifdef _WIN64 + #if defined(_WIN64) std::string path(Utils::String::replace(mVideoPath, "/", "\\")); #else std::string path(mVideoPath); diff --git a/es-core/src/renderers/Renderer.cpp b/es-core/src/renderers/Renderer.cpp index edd6afc52..2bd8160cb 100644 --- a/es-core/src/renderers/Renderer.cpp +++ b/es-core/src/renderers/Renderer.cpp @@ -100,7 +100,7 @@ namespace Renderer unsigned int windowFlags; - #ifdef _WIN64 + #if defined(_WIN64) // For Windows, always set the mode to windowed, as full screen mode seems to // behave quite erratic. There may be a proper fix for this, but for now windowed // mode seems to behave well and it's almost completely seamless, especially with diff --git a/es-core/src/resources/ResourceManager.cpp b/es-core/src/resources/ResourceManager.cpp index 7d81b6f8f..4cccf410c 100644 --- a/es-core/src/resources/ResourceManager.cpp +++ b/es-core/src/resources/ResourceManager.cpp @@ -110,7 +110,7 @@ const ResourceData ResourceManager::getFileData(const std::string& path) const ResourceData ResourceManager::loadFile(const std::string& path) const { - #ifdef _WIN64 + #if defined(_WIN64) std::ifstream stream(Utils::String::stringToWideString(path).c_str(), std::ios::binary); #else std::ifstream stream(path, std::ios::binary); diff --git a/es-core/src/utils/FileSystemUtil.cpp b/es-core/src/utils/FileSystemUtil.cpp index 9f100854a..3c70adc9c 100644 --- a/es-core/src/utils/FileSystemUtil.cpp +++ b/es-core/src/utils/FileSystemUtil.cpp @@ -35,7 +35,7 @@ // The installPrefix directory is the value set for CMAKE_INSTALL_PREFIX during build. // If not defined, the default prefix path '/usr/local' will be used. #if defined(__unix__) -#ifdef ES_INSTALL_PREFIX +#if defined(ES_INSTALL_PREFIX) std::string installPrefix = ES_INSTALL_PREFIX; #else std::string installPrefix = "/usr/local"; @@ -676,7 +676,7 @@ namespace Utils return true; // Try to create directory. - #ifdef _WIN64 + #if defined(_WIN64) if (_wmkdir(Utils::String::stringToWideString(path).c_str()) == 0) return true; #else