From 22aeb64ff9bafde697cdd8c96a254ae27e2ee625 Mon Sep 17 00:00:00 2001 From: Will Date: Sat, 7 Mar 2026 08:21:10 +1000 Subject: [PATCH] fix various minor issues causing compilation failure with clang (#567) - Include order and forward decls were breaking button.h because a declared but not defined struct can't be initiated (honestly this file was cooked, crazy include order). - `MAXINT` is GCC specific, `INT_MAX` is portable. - InterlockedDecrement takes a LONG, not ULONG - an imgui printf-style call using a direct string instead of %s (let's ignore the fact that it's actually safe based on how the str is constructed) - missing `override` on a virtual subclass - `CALLBACK` on a lambda threw me for a loop, but I believe moving it after the arg list is the correct approach (see if it builds on gcc I guess) - `std::result_of` was removed in C++20, which the project is built with --- src/spice2x/cfg/api.h | 16 ++++---------- src/spice2x/cfg/button.h | 12 ++++++++-- src/spice2x/games/iidx/iidx.cpp | 10 ++++----- src/spice2x/games/iidx/local_camera.h | 2 +- .../graphics/backends/d3d9/d3d9_backend.cpp | 4 ++-- .../graphics/backends/d3d9/d3d9_device.cpp | 4 ++-- src/spice2x/overlay/windows/config.cpp | 2 +- src/spice2x/overlay/windows/iopanel.h | 1 + src/spice2x/overlay/windows/patch_manager.cpp | 22 +++++++++---------- src/spice2x/overlay/windows/screen_resize.h | 4 ++-- src/spice2x/util/threadpool.h | 4 ++-- 11 files changed, 41 insertions(+), 40 deletions(-) diff --git a/src/spice2x/cfg/api.h b/src/spice2x/cfg/api.h index 1693870..5f70714 100644 --- a/src/spice2x/cfg/api.h +++ b/src/spice2x/cfg/api.h @@ -6,24 +6,20 @@ #include #include "option.h" +#include "button.h" +#include "analog.h" +#include "light.h" + namespace rawinput { class RawInputManager; struct Device; } -class Button; -class Analog; -class Light; class Game; class Option; namespace GameAPI { namespace Buttons { - enum State { - BUTTON_PRESSED = true, - BUTTON_NOT_PRESSED = false - }; - /** * Parses the config and returns the buttons set by the user. * @@ -152,7 +148,3 @@ namespace GameAPI { void sortOptions(std::vector