From ca3a165114d110e30b5ade0c94847e17dd5f4a26 Mon Sep 17 00:00:00 2001 From: Emma Date: Thu, 23 Apr 2026 16:53:45 +0000 Subject: [PATCH] #if -> #ifdef --- CMakeLists.txt | 4 ++-- src/Cafe/OS/libs/nsyshid/AttachDefaultBackends.cpp | 4 ++-- src/Cafe/OS/libs/nsyshid/BackendEmulated.cpp | 2 +- src/Cafe/OS/libs/nsyshid/SkylanderXbox360.cpp | 2 +- src/Cafe/OS/libs/nsyshid/SkylanderXbox360.h | 4 ++-- src/input/ControllerFactory.cpp | 4 ++-- src/input/InputManager.cpp | 2 +- src/input/api/GameCube/GameCubeController.cpp | 2 +- src/input/api/GameCube/GameCubeController.h | 2 +- src/input/api/GameCube/GameCubeControllerProvider.cpp | 2 +- src/input/api/GameCube/GameCubeControllerProvider.h | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 38630217..58bdf628 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,9 +131,9 @@ option(ENABLE_SDL "Enables the SDLController backend" ON) option(ENABLE_LIBUSB "Build with libusb support" ON) if (ENABLE_LIBUSB) - add_compile_definitions(HAS_LIBUSB=1) + add_compile_definitions(HAS_LIBUSB) else() - add_compile_definitions(HAS_LIBUSB=0) + add_compile_definitions(HAS_LIBUSB) endif() # audio backends diff --git a/src/Cafe/OS/libs/nsyshid/AttachDefaultBackends.cpp b/src/Cafe/OS/libs/nsyshid/AttachDefaultBackends.cpp index 5cf3352f..ec0e2cd8 100644 --- a/src/Cafe/OS/libs/nsyshid/AttachDefaultBackends.cpp +++ b/src/Cafe/OS/libs/nsyshid/AttachDefaultBackends.cpp @@ -1,7 +1,7 @@ #include "nsyshid.h" #include "Backend.h" #include "BackendEmulated.h" -#if HAS_LIBUSB +#ifdef HAS_LIBUSB #include "BackendLibusb.h" #endif @@ -9,7 +9,7 @@ namespace nsyshid::backend { void AttachDefaultBackends() { - #if HAS_LIBUSB + #ifdef HAS_LIBUSB // add libusb backend { auto backendLibusb = std::make_shared(); diff --git a/src/Cafe/OS/libs/nsyshid/BackendEmulated.cpp b/src/Cafe/OS/libs/nsyshid/BackendEmulated.cpp index 93ea8e5a..e6b9fd9d 100644 --- a/src/Cafe/OS/libs/nsyshid/BackendEmulated.cpp +++ b/src/Cafe/OS/libs/nsyshid/BackendEmulated.cpp @@ -29,7 +29,7 @@ namespace nsyshid::backend::emulated auto device = std::make_shared(); AttachDevice(device); } - #if HAS_LIBUSB + #ifdef HAS_LIBUSB else if (auto usb_portal = FindDeviceById(0x1430, 0x1F17)) { cemuLog_logDebug(LogType::Force, "Attaching Xbox 360 Portal"); diff --git a/src/Cafe/OS/libs/nsyshid/SkylanderXbox360.cpp b/src/Cafe/OS/libs/nsyshid/SkylanderXbox360.cpp index 2227ff17..0c528094 100644 --- a/src/Cafe/OS/libs/nsyshid/SkylanderXbox360.cpp +++ b/src/Cafe/OS/libs/nsyshid/SkylanderXbox360.cpp @@ -2,7 +2,7 @@ namespace nsyshid { - #if HAS_LIBUSB + #ifdef HAS_LIBUSB SkylanderXbox360PortalLibusb::SkylanderXbox360PortalLibusb(std::shared_ptr usbPortal) : Device(0x1430, 0x0150, 1, 2, 0) { diff --git a/src/Cafe/OS/libs/nsyshid/SkylanderXbox360.h b/src/Cafe/OS/libs/nsyshid/SkylanderXbox360.h index 21476255..b92cffcc 100644 --- a/src/Cafe/OS/libs/nsyshid/SkylanderXbox360.h +++ b/src/Cafe/OS/libs/nsyshid/SkylanderXbox360.h @@ -1,14 +1,14 @@ #pragma once #include "nsyshid.h" -#if HAS_LIBUSB +#ifdef HAS_LIBUSB #include "BackendLibusb.h" #include "g721/g721.h" #endif namespace nsyshid { - #if HAS_LIBUSB + #ifdef HAS_LIBUSB class SkylanderXbox360PortalLibusb final : public Device { public: SkylanderXbox360PortalLibusb(std::shared_ptr usbPortal); diff --git a/src/input/ControllerFactory.cpp b/src/input/ControllerFactory.cpp index 408a659f..1284c6b1 100644 --- a/src/input/ControllerFactory.cpp +++ b/src/input/ControllerFactory.cpp @@ -83,7 +83,7 @@ ControllerPtr ControllerFactory::CreateController(InputAPI::Type api, std::strin return std::make_shared(index); } #endif -#if defined(HAS_GAMECUBE) && HAS_GAMECUBE && HAS_LIBUSB +#if defined(HAS_GAMECUBE) && HAS_GAMECUBE && defined(HAS_LIBUSB) case InputAPI::GameCube: { const auto index = uuid.find_first_of('_'); @@ -165,7 +165,7 @@ ControllerProviderPtr ControllerFactory::CreateControllerProvider(InputAPI::Type } #endif -#if defined(HAS_GAMECUBE) && HAS_GAMECUBE && HAS_LIBUSB +#if defined(HAS_GAMECUBE) && HAS_GAMECUBE && defined(HAS_LIBUSB) case InputAPI::GameCube: return std::make_shared(); #endif diff --git a/src/input/InputManager.cpp b/src/input/InputManager.cpp index d5ef26dd..5b228414 100644 --- a/src/input/InputManager.cpp +++ b/src/input/InputManager.cpp @@ -40,7 +40,7 @@ InputManager::InputManager() #if HAS_DSU create_provider(); #endif -#if defined(HAS_GAMECUBE) && HAS_GAMECUBE && HAS_LIBUSB +#if defined(HAS_GAMECUBE) && HAS_GAMECUBE && defined(HAS_LIBUSB) create_provider(); #endif #if HAS_WIIMOTE diff --git a/src/input/api/GameCube/GameCubeController.cpp b/src/input/api/GameCube/GameCubeController.cpp index 76c27cbe..910a513e 100644 --- a/src/input/api/GameCube/GameCubeController.cpp +++ b/src/input/api/GameCube/GameCubeController.cpp @@ -1,6 +1,6 @@ #include "input/api/GameCube/GameCubeController.h" -#if defined(HAS_GAMECUBE) && HAS_GAMECUBE && HAS_LIBUSB +#if defined(HAS_GAMECUBE) && HAS_GAMECUBE && defined(HAS_LIBUSB) GameCubeController::GameCubeController(uint32 adapter, uint32 index) : base_type(fmt::format("{}_{}", adapter, index), fmt::format("Controller {}", index + 1)), m_adapter(adapter), diff --git a/src/input/api/GameCube/GameCubeController.h b/src/input/api/GameCube/GameCubeController.h index fb97944e..d027eee0 100644 --- a/src/input/api/GameCube/GameCubeController.h +++ b/src/input/api/GameCube/GameCubeController.h @@ -3,7 +3,7 @@ #include "input/api/Controller.h" #include "input/api/GameCube/GameCubeControllerProvider.h" -#if defined(HAS_GAMECUBE) && HAS_GAMECUBE && HAS_LIBUSB +#if defined(HAS_GAMECUBE) && HAS_GAMECUBE && defined(HAS_LIBUSB) class GameCubeController : public Controller { diff --git a/src/input/api/GameCube/GameCubeControllerProvider.cpp b/src/input/api/GameCube/GameCubeControllerProvider.cpp index 57b53272..60689568 100644 --- a/src/input/api/GameCube/GameCubeControllerProvider.cpp +++ b/src/input/api/GameCube/GameCubeControllerProvider.cpp @@ -2,7 +2,7 @@ #include "input/api/GameCube/GameCubeController.h" #include "util/libusbWrapper/libusbWrapper.h" -#if defined(HAS_GAMECUBE) && HAS_GAMECUBE && HAS_LIBUSB +#if defined(HAS_GAMECUBE) && HAS_GAMECUBE && defined(HAS_LIBUSB) constexpr uint16_t kVendorId = 0x57e, kProductId = 0x337; diff --git a/src/input/api/GameCube/GameCubeControllerProvider.h b/src/input/api/GameCube/GameCubeControllerProvider.h index c7ca94be..d4e19d92 100644 --- a/src/input/api/GameCube/GameCubeControllerProvider.h +++ b/src/input/api/GameCube/GameCubeControllerProvider.h @@ -2,7 +2,7 @@ #include "input/api/ControllerProvider.h" -#if defined(HAS_GAMECUBE) && HAS_GAMECUBE && HAS_LIBUSB +#if defined(HAS_GAMECUBE) && HAS_GAMECUBE && defined(HAS_LIBUSB) #include "util/libusbWrapper/libusbWrapper.h"