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