Skip to content

Commit 10ba3e1

Browse files
committed
loader_platform: GCC wants a cast
1 parent 811c8b6 commit 10ba3e1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/loader/loader_platform.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static inline int32_t xr_snprintf(char *result_buffer, size_t buffer_size, const
114114

115115
#endif
116116

117-
static std::string DescribeError(uint32_t code, bool prefixErrorCode = true) {
117+
static inline std::string DescribeError(uint32_t code, bool prefixErrorCode = true) {
118118
std::string str;
119119

120120
if (prefixErrorCode) {
@@ -140,7 +140,7 @@ static std::string DescribeError(uint32_t code, bool prefixErrorCode = true) {
140140

141141
// Dynamic Loading:
142142
typedef HMODULE LoaderPlatformLibraryHandle;
143-
static LoaderPlatformLibraryHandle LoaderPlatformLibraryOpen(const std::string &path) {
143+
static inline LoaderPlatformLibraryHandle LoaderPlatformLibraryOpen(const std::string &path) {
144144
const std::wstring pathW = utf8_to_wide(path);
145145

146146
// Try loading the library the original way first.
@@ -158,23 +158,23 @@ static LoaderPlatformLibraryHandle LoaderPlatformLibraryOpen(const std::string &
158158
return handle;
159159
}
160160

161-
static std::string LoaderPlatformLibraryOpenError(const std::string &path) {
161+
static inline std::string LoaderPlatformLibraryOpenError(const std::string &path) {
162162
std::stringstream ss;
163163
const DWORD dwLastError = GetLastError();
164164
const std::string strError = DescribeError(dwLastError);
165165
ss << "Failed to open dynamic library " << path << " with error " << dwLastError << ": " << strError;
166166
return ss.str();
167167
}
168168

169-
static void LoaderPlatformLibraryClose(LoaderPlatformLibraryHandle library) { FreeLibrary(library); }
169+
static inline void LoaderPlatformLibraryClose(LoaderPlatformLibraryHandle library) { FreeLibrary(library); }
170170

171-
static void *LoaderPlatformLibraryGetProcAddr(LoaderPlatformLibraryHandle library, const std::string &name) {
171+
static inline void *LoaderPlatformLibraryGetProcAddr(LoaderPlatformLibraryHandle library, const std::string &name) {
172172
assert(library);
173173
assert(name.size() > 0);
174-
return GetProcAddress(library, name.c_str());
174+
return reinterpret_cast<void *>(GetProcAddress(library, name.c_str()));
175175
}
176176

177-
static std::string LoaderPlatformLibraryGetProcAddrAddrError(const std::string &name) {
177+
static inline std::string LoaderPlatformLibraryGetProcAddrAddrError(const std::string &name) {
178178
std::stringstream ss;
179179
ss << "Failed to find function " << name << " in dynamic library";
180180
return ss.str();

0 commit comments

Comments
 (0)