From 8a8d704d270e47c5de6c911853e917dc4cad1be5 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Sat, 7 Oct 2023 12:22:04 +0200 Subject: [PATCH 1/2] windows.cfg: Fixed wrong configuration of GetModuleHandle(A|W)-functions. --- cfg/windows.cfg | 2 +- test/cfg/windows.cpp | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/cfg/windows.cfg b/cfg/windows.cfg index 53dc335e463..47a428c827c 100644 --- a/cfg/windows.cfg +++ b/cfg/windows.cfg @@ -4825,7 +4825,7 @@ HFONT CreateFont( - + diff --git a/test/cfg/windows.cpp b/test/cfg/windows.cpp index 55eb21ecda2..bd7a4a7b618 100644 --- a/test/cfg/windows.cpp +++ b/test/cfg/windows.cpp @@ -8,14 +8,23 @@ // #include -#include +#include #include -#include -#include +#include +#include #include #include #include #include +#include + +/// https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulefilenamew +std::string constVariable_GetModuleFileName(void) { + char path[42]; + if(GetModuleFileNameA(NULL, path, sizeof(path))==0) + return std::string(); + return std::string{path}; +} int stringCompare_mbscmp(const unsigned char *string1, const unsigned char *string2) { @@ -1117,4 +1126,4 @@ void invalidPrintfArgType_StructMember(double d) { // #9672 BOOL MyEnableWindow(HWND hWnd, BOOL bEnable) { return EnableWindow(hWnd, bEnable); -} \ No newline at end of file +} From 1564d38dddad20e2af390478d2bf080300dfdec8 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Sat, 7 Oct 2023 12:24:53 +0200 Subject: [PATCH 2/2] Formatting --- test/cfg/windows.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/cfg/windows.cpp b/test/cfg/windows.cpp index bd7a4a7b618..7c90898fdf1 100644 --- a/test/cfg/windows.cpp +++ b/test/cfg/windows.cpp @@ -21,9 +21,9 @@ /// https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulefilenamew std::string constVariable_GetModuleFileName(void) { char path[42]; - if(GetModuleFileNameA(NULL, path, sizeof(path))==0) - return std::string(); - return std::string{path}; + if (GetModuleFileNameA(NULL, path, sizeof(path))==0) + return std::string(); + return std::string{path}; } int stringCompare_mbscmp(const unsigned char *string1, const unsigned char *string2)