From 20f24366a347966ca886cac92d01524069f8990d Mon Sep 17 00:00:00 2001 From: mike <39063587+mike-turintech@users.noreply.github.com> Date: Thu, 10 Jul 2025 17:43:10 +0100 Subject: [PATCH] fix: mark function as inline for optimization i... --- src/os/winheader.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/os/winheader.h b/src/os/winheader.h index 1bac4a9..600a531 100644 --- a/src/os/winheader.h +++ b/src/os/winheader.h @@ -5,8 +5,13 @@ namespace OsWinHeader { -void ShowMessage(const char* message); +// Accept message as const char* to avoid string copy. +// Mark function as inline to give compiler opportunity to optimize out-of-header usage for this trivial wrapper. +// Add noexcept for better codegen and possible optimization. +inline void ShowMessage(const char* message) noexcept { + MessageBoxA(nullptr, message, "Info", MB_OK | MB_ICONINFORMATION); +} } -#endif // ! __OS_WINHEADER_H__ +#endif // ! __OS_WINHEADER_H__ \ No newline at end of file