Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/os/winheader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__