Skip to content

Commit

Permalink
xrCore: fix Linux build
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleivg authored and Xottab-DUTY committed May 28, 2018
1 parent 9bfcd4b commit a232aa2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Common/PlatformLinux.inl
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ typedef dirent DirEntryType;
#define _alloca alloca
#define _snprintf snprintf
#define sprintf_s(buffer, buffer_size, stringbuffer, ...) sprintf(buffer, stringbuffer, ##__VA_ARGS__)
#define GetProcAddress(handle, name) dlsym(handle, name)
//#define GetProcAddress(handle, name) dlsym(handle, name)
#define _chdir chdir
#define _strnicmp strnicmp
#define strnicmp strncasecmp
Expand All @@ -217,6 +217,8 @@ typedef dirent DirEntryType;
#define _open open
#define _close close
#define _sopen open
#define _utime utime
#define _utimbuf utimbuf
#define _sopen_s(handle, filename, ...) open(filename, O_RDONLY)
inline int _filelength(int fd)
{
Expand All @@ -238,8 +240,6 @@ inline int _filelength(int fd)
#undef max
#define __max(a, b) std::max(a, b)
#define __min(a, b) std::min(a, b)
#define _utime utime
#define _utimbuf utimbuf

#define xr_itoa SDL_itoa

Expand Down
7 changes: 5 additions & 2 deletions src/xrCore/ModuleLookup.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "stdafx.h"

#include "ModuleLookup.hpp"
#ifdef LINUX
#include <dlfcn.h>
#endif

namespace XRay
{
Expand All @@ -26,7 +29,7 @@ void* ModuleHandle::Open(pcstr moduleName)
#ifdef WINDOWS
handle = LoadLibraryA(moduleName);
#elif defined(LINUX)
handle = dlopen(name, RTLD_LAZY);
handle = dlopen(moduleName, RTLD_LAZY);
#endif
if (handle == nullptr)
{
Expand Down Expand Up @@ -82,7 +85,7 @@ void* ModuleHandle::GetProcAddress(pcstr procName) const
#ifdef WINDOWS
proc = ::GetProcAddress(static_cast<HMODULE>(handle), procName);
#elif defined(LINUX)
proc = dlsym(handle, procedure);
proc = dlsym(handle, procName);
#endif

if (proc == nullptr)
Expand Down

0 comments on commit a232aa2

Please sign in to comment.