mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 07:35:38 +00:00
Changed '#ifdef' to '#if defined()' throughout the code.
This commit is contained in:
parent
af5a48ed10
commit
88a5962926
|
@ -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<std::string> 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());
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "Log.h"
|
||||
#include "Settings.h"
|
||||
#include "SystemData.h"
|
||||
|
||||
#include <pugixml.hpp>
|
||||
|
||||
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())) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 <unordered_map>
|
||||
#include <time.h>
|
||||
|
||||
#ifdef _WIN64
|
||||
#if defined(_WIN64)
|
||||
#include <cstring>
|
||||
#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") ==
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<OptionListComponent<std::string>>
|
||||
(mWindow, getHelpStyle(), "AUDIO CARD", false);
|
||||
std::vector<std::string> 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<OptionListComponent<std::string>>
|
||||
(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<OptionListComponent<std::string>>
|
||||
(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<SwitchComponent>(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<SwitchComponent>(mWindow);
|
||||
hide_taskbar->setState(Settings::getInstance()->getBool("HideTaskbar"));
|
||||
|
|
|
@ -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<SwitchComponent>(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<TextComponent>(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) {
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "CECInput.h"
|
||||
|
||||
#ifdef HAVE_LIBCEC
|
||||
#if defined(HAVE_LIBCEC)
|
||||
#include "Log.h"
|
||||
|
||||
#include <iostream> // 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;
|
||||
|
|
|
@ -25,7 +25,7 @@ private:
|
|||
CECInput();
|
||||
~CECInput();
|
||||
|
||||
static CECInput* sInstance;
|
||||
static CECInput* sInstance;
|
||||
|
||||
CEC::ICECAdapter* mlibCEC;
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include <string>
|
||||
|
||||
// Why the hell this naming inconsistency exists is well beyond me.
|
||||
#ifdef _WIN64
|
||||
#if defined(_WIN64)
|
||||
#define sleep Sleep
|
||||
#endif
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -260,7 +260,7 @@ void ThemeData::loadFile(std::map<std::string, std::string> 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
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
// OMXPlayer video playing for Raspberry Pi.
|
||||
//
|
||||
|
||||
#ifdef _RPI_
|
||||
#if defined(_RPI_)
|
||||
#include "components/VideoPlayerComponent.h"
|
||||
|
||||
#include "renderers/Renderer.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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue