Skip to content

Commit a232aa2

Browse files
eagleivgXottab-DUTY
authored andcommitted
xrCore: fix Linux build
1 parent 9bfcd4b commit a232aa2

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/Common/PlatformLinux.inl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ typedef dirent DirEntryType;
202202
#define _alloca alloca
203203
#define _snprintf snprintf
204204
#define sprintf_s(buffer, buffer_size, stringbuffer, ...) sprintf(buffer, stringbuffer, ##__VA_ARGS__)
205-
#define GetProcAddress(handle, name) dlsym(handle, name)
205+
//#define GetProcAddress(handle, name) dlsym(handle, name)
206206
#define _chdir chdir
207207
#define _strnicmp strnicmp
208208
#define strnicmp strncasecmp
@@ -217,6 +217,8 @@ typedef dirent DirEntryType;
217217
#define _open open
218218
#define _close close
219219
#define _sopen open
220+
#define _utime utime
221+
#define _utimbuf utimbuf
220222
#define _sopen_s(handle, filename, ...) open(filename, O_RDONLY)
221223
inline int _filelength(int fd)
222224
{
@@ -238,8 +240,6 @@ inline int _filelength(int fd)
238240
#undef max
239241
#define __max(a, b) std::max(a, b)
240242
#define __min(a, b) std::min(a, b)
241-
#define _utime utime
242-
#define _utimbuf utimbuf
243243

244244
#define xr_itoa SDL_itoa
245245

src/xrCore/ModuleLookup.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#include "stdafx.h"
22

33
#include "ModuleLookup.hpp"
4+
#ifdef LINUX
5+
#include <dlfcn.h>
6+
#endif
47

58
namespace XRay
69
{
@@ -26,7 +29,7 @@ void* ModuleHandle::Open(pcstr moduleName)
2629
#ifdef WINDOWS
2730
handle = LoadLibraryA(moduleName);
2831
#elif defined(LINUX)
29-
handle = dlopen(name, RTLD_LAZY);
32+
handle = dlopen(moduleName, RTLD_LAZY);
3033
#endif
3134
if (handle == nullptr)
3235
{
@@ -82,7 +85,7 @@ void* ModuleHandle::GetProcAddress(pcstr procName) const
8285
#ifdef WINDOWS
8386
proc = ::GetProcAddress(static_cast<HMODULE>(handle), procName);
8487
#elif defined(LINUX)
85-
proc = dlsym(handle, procedure);
88+
proc = dlsym(handle, procName);
8689
#endif
8790

8891
if (proc == nullptr)

0 commit comments

Comments
 (0)