From 231b31a41b3dd2d5c4f5ed6b668091a8f4d8310e Mon Sep 17 00:00:00 2001 From: ninetailedtori Date: Sun, 7 Dec 2025 21:58:48 +0000 Subject: [PATCH 1/2] Move -s (strip symtab) to linker flags. Both clang and gcc pass this directly to linker anyway. Signed-off-by: ninetailedtori --- src/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0bde3260..b38ba4b4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -165,7 +165,8 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug") endif() if(UNIX AND CMAKE_BUILD_TYPE STREQUAL "Release") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s") set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS OFF) set(CMAKE_BUILD_TYPE_INIT "Release") set(CMAKE_C_FLAGS_RELEASE "-DNDEBUG -Oz -ffunction-sections -fdata-sections") From ae54bf86c0cafad16f893e51c61a5b69e962293c Mon Sep 17 00:00:00 2001 From: ninetailedtori Date: Mon, 8 Dec 2025 20:05:03 +0000 Subject: [PATCH 2/2] Add VA_ARGS expansion for Clang support. Remove user-defined copy constructor (implicitly defined, unnecessary and destroys the implicit copy operator when compiling with pedantic warnings on newer compilers. --- src/include/millennium/backend_init.h | 3 --- src/include/millennium/logger.h | 13 ++++++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/include/millennium/backend_init.h b/src/include/millennium/backend_init.h index a0fae329..a003d733 100644 --- a/src/include/millennium/backend_init.h +++ b/src/include/millennium/backend_init.h @@ -83,9 +83,6 @@ class BackendCallbacks : public Singleton PluginTypeSchema(const std::string& name, eBackendLoadEvents ev) : pluginName(name), event(ev) { } - PluginTypeSchema(const PluginTypeSchema& other) : pluginName(other.pluginName), event(other.event) - { - } }; using EventCallback = std::function; diff --git a/src/include/millennium/logger.h b/src/include/millennium/logger.h index d6cc688f..6ebbaf60 100644 --- a/src/include/millennium/logger.h +++ b/src/include/millennium/logger.h @@ -102,5 +102,16 @@ extern OutputLogger Logger; #endif #ifndef LOG_ERROR -#define LOG_ERROR(fmt, ...) Logger.ErrorTrace(fmt, __FILE__, __LINE__, PRETTY_FUNCTION, ##__VA_ARGS__) +#define LOG_ERROR(...) Logger.ErrorTrace(FIRST(__VA_ARGS__), __FILE__, __LINE__, PRETTY_FUNCTION REST(__VA_ARGS__)) +#define FIRST(...) FIRST_HELPER(__VA_ARGS__, throwaway) +#define FIRST_HELPER(first, ...) first +#define REST(...) REST_HELPER(NUM(__VA_ARGS__), __VA_ARGS__) +#define REST_HELPER(qty, ...) REST_HELPER2(qty, __VA_ARGS__) +#define REST_HELPER2(qty, ...) REST_HELPER_##qty(__VA_ARGS__) +#define REST_HELPER_ONE(first) +#define REST_HELPER_TWOORMORE(first, ...) , __VA_ARGS__ +#define NUM(...) \ + SELECT_10TH(__VA_ARGS__, TWOORMORE, TWOORMORE, TWOORMORE, TWOORMORE,\ + TWOORMORE, TWOORMORE, TWOORMORE, TWOORMORE, ONE, throwaway) +#define SELECT_10TH(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, ...) a10 #endif