Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c407d8e

Browse files
committedMay 30, 2024·
Use W/A macro
1 parent 443eb2d commit c407d8e

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed
 

‎include/xtl/xsystem.hpp

+1-9
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,13 @@ namespace xtl
7676
{
7777
GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<LPCTSTR>(module_path), &handle);
7878
}
79-
#if defined(UNICODE)
80-
if (GetModuleFileNameW(handle, buffer, sizeof(buffer)) != 0)
79+
if (GetModuleFileName(handle, buffer, sizeof(buffer)) != 0)
8180
{
8281
// Convert wchar_t to std::string
8382
std::wstring wideString(buffer);
8483
std::string narrowString(wideString.begin(), wideString.end());
8584
path = narrowString;
8685
}
87-
#else
88-
if (GetModuleFileNameA(handle, buffer, sizeof(buffer)) != 0)
89-
{
90-
path = buffer;
91-
}
92-
#endif
93-
// failed to determine run path
9486
#elif defined (__APPLE__)
9587
std::uint32_t size = sizeof(buffer);
9688
if(_NSGetExecutablePath(buffer, &size) == 0)

0 commit comments

Comments
 (0)
Please sign in to comment.