Skip to content

Commit 47cd184

Browse files
committed
loader_platform: GCC wants a cast
1 parent 382fe86 commit 47cd184

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
@@ -116,7 +116,7 @@ static inline int32_t xr_snprintf(char *result_buffer, size_t buffer_size, const
116116

117117
#endif
118118

119-
static std::string DescribeError(uint32_t code, bool prefixErrorCode = true) {
119+
static inline std::string DescribeError(uint32_t code, bool prefixErrorCode = true) {
120120
std::string str;
121121

122122
if (prefixErrorCode) {
@@ -142,7 +142,7 @@ static std::string DescribeError(uint32_t code, bool prefixErrorCode = true) {
142142

143143
// Dynamic Loading:
144144
typedef HMODULE LoaderPlatformLibraryHandle;
145-
static LoaderPlatformLibraryHandle LoaderPlatformLibraryOpen(const std::string &path) {
145+
static inline LoaderPlatformLibraryHandle LoaderPlatformLibraryOpen(const std::string &path) {
146146
const std::wstring pathW = utf8_to_wide(path);
147147

148148
// Try loading the library the original way first.
@@ -160,23 +160,23 @@ static LoaderPlatformLibraryHandle LoaderPlatformLibraryOpen(const std::string &
160160
return handle;
161161
}
162162

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

171-
static void LoaderPlatformLibraryClose(LoaderPlatformLibraryHandle library) { FreeLibrary(library); }
171+
static inline void LoaderPlatformLibraryClose(LoaderPlatformLibraryHandle library) { FreeLibrary(library); }
172172

173-
static void *LoaderPlatformLibraryGetProcAddr(LoaderPlatformLibraryHandle library, const std::string &name) {
173+
static inline void *LoaderPlatformLibraryGetProcAddr(LoaderPlatformLibraryHandle library, const std::string &name) {
174174
assert(library);
175175
assert(name.size() > 0);
176-
return GetProcAddress(library, name.c_str());
176+
return reinterpret_cast<void *>(GetProcAddress(library, name.c_str()));
177177
}
178178

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

0 commit comments

Comments
 (0)