We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 443eb2d commit c407d8eCopy full SHA for c407d8e
include/xtl/xsystem.hpp
@@ -76,21 +76,13 @@ namespace xtl
76
{
77
GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<LPCTSTR>(module_path), &handle);
78
}
79
- #if defined(UNICODE)
80
- if (GetModuleFileNameW(handle, buffer, sizeof(buffer)) != 0)
+ if (GetModuleFileName(handle, buffer, sizeof(buffer)) != 0)
81
82
// Convert wchar_t to std::string
83
std::wstring wideString(buffer);
84
std::string narrowString(wideString.begin(), wideString.end());
85
path = narrowString;
86
87
- #else
88
- if (GetModuleFileNameA(handle, buffer, sizeof(buffer)) != 0)
89
- {
90
- path = buffer;
91
- }
92
- #endif
93
- // failed to determine run path
94
#elif defined (__APPLE__)
95
std::uint32_t size = sizeof(buffer);
96
if(_NSGetExecutablePath(buffer, &size) == 0)
0 commit comments