From ac0ef5fcab0cb534c3e29079beeb987c4b9999fc Mon Sep 17 00:00:00 2001 From: Maschell Date: Sat, 14 Dec 2024 11:13:18 +0100 Subject: [PATCH] Fix formatting --- include/wups/common.h | 5 +++-- include/wups/function_patching.h | 3 ++- include/wups/hooks.h | 7 ++++--- include/wups/meta.h | 9 ++++++--- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/include/wups/common.h b/include/wups/common.h index e7ca0c2..8f4f05c 100644 --- a/include/wups/common.h +++ b/include/wups/common.h @@ -46,8 +46,9 @@ extern "C" { #define WUPS_SECTION(x) WUPS_EXTERN_C __attribute__((__section__(".wups." x), used)) -#define WUPS_META(id, value) \ - WUPS_SECTION("meta") const char wups_meta_##id[] = #id "=" value +#define WUPS_META(id, value) \ + WUPS_SECTION("meta") \ + const char wups_meta_##id[] = #id "=" value #ifdef __cplusplus } diff --git a/include/wups/function_patching.h b/include/wups/function_patching.h index a58c09e..87eae07 100644 --- a/include/wups/function_patching.h +++ b/include/wups/function_patching.h @@ -148,7 +148,8 @@ typedef struct wups_loader_entry_t { #define WUPS_MUST_REPLACE_FOR_PROCESS(x, lib, function_name, targetProcess) WUPS_MUST_REPLACE_EX(NULL, NULL, real_##x, lib, my_##x, function_name, targetProcess) #define WUPS_MUST_REPLACE_EX(pAddress, vAddress, original_func, rpl_type, replace_func, replace_function_name, process) \ - WUPS_SECTION("load") const wups_loader_entry_t wups_load_##replace_func = { \ + WUPS_SECTION("load") \ + const wups_loader_entry_t wups_load_##replace_func = { \ .type = WUPS_LOADER_ENTRY_FUNCTION_MANDATORY, \ ._function = { \ .physical_address = (const void *) pAddress, \ diff --git a/include/wups/hooks.h b/include/wups/hooks.h index 7f39350..46e470d 100644 --- a/include/wups/hooks.h +++ b/include/wups/hooks.h @@ -22,9 +22,10 @@ extern "C" { #endif -#define WUPS_HOOK_EX(type_def, original_func) \ - WUPS_SECTION("hooks") const wups_loader_hook_t wups_hooks_##original_func = { \ - .type = type_def, \ +#define WUPS_HOOK_EX(type_def, original_func) \ + WUPS_SECTION("hooks") \ + const wups_loader_hook_t wups_hooks_##original_func = { \ + .type = type_def, \ .target = (const void *) &(original_func)} typedef enum wups_loader_hook_type_t { diff --git a/include/wups/meta.h b/include/wups/meta.h index 53ec4ad..ada3b48 100644 --- a/include/wups/meta.h +++ b/include/wups/meta.h @@ -50,11 +50,14 @@ extern "C" { WUPS___FINI_WRAPPER(); \ WUPS_INIT_CONFIG_FUNCTIONS(); \ WUPS_META(buildtimestamp, __DATE__ " " __TIME__); \ - WUPS_SECTION("meta") const char wups_meta_plugin_name[] = __plugin_name; \ - WUPS_SECTION("meta") const char wups_meta_info_dump[] = "(plugin: " __plugin_name ";" \ + WUPS_SECTION("meta") \ + const char wups_meta_plugin_name[] = __plugin_name; \ + WUPS_SECTION("meta") \ + const char wups_meta_info_dump[] = "(plugin: " __plugin_name ";" \ "wups " WUPS_VERSION_STR ";" \ "buildtime: " __DATE__ " " __TIME__ ")"; \ - WUPS_SECTION("meta") const char wups_meta_info_linking_order[] = "Loading \"" __plugin_name "\" failed.\n" \ + WUPS_SECTION("meta") \ + const char wups_meta_info_linking_order[] = "Loading \"" __plugin_name "\" failed.\n" \ "Function \"wut_get_thread_specific\" returned unexpected value.\n" \ "Please check linking order (expected \"-lwups -lwut\")";