From a232aa23da37a5bf4f9edbbb3baf9661ac247065 Mon Sep 17 00:00:00 2001 From: Ilya Orlov Date: Mon, 28 May 2018 10:23:14 +0300 Subject: [PATCH] xrCore: fix Linux build --- src/Common/PlatformLinux.inl | 6 +++--- src/xrCore/ModuleLookup.cpp | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Common/PlatformLinux.inl b/src/Common/PlatformLinux.inl index 929833ac07c..b82ac5930b4 100644 --- a/src/Common/PlatformLinux.inl +++ b/src/Common/PlatformLinux.inl @@ -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 @@ -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) { @@ -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 diff --git a/src/xrCore/ModuleLookup.cpp b/src/xrCore/ModuleLookup.cpp index 3e21c61ecc6..6aed67e9b54 100644 --- a/src/xrCore/ModuleLookup.cpp +++ b/src/xrCore/ModuleLookup.cpp @@ -1,6 +1,9 @@ #include "stdafx.h" #include "ModuleLookup.hpp" +#ifdef LINUX +#include +#endif namespace XRay { @@ -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) { @@ -82,7 +85,7 @@ void* ModuleHandle::GetProcAddress(pcstr procName) const #ifdef WINDOWS proc = ::GetProcAddress(static_cast(handle), procName); #elif defined(LINUX) - proc = dlsym(handle, procedure); + proc = dlsym(handle, procName); #endif if (proc == nullptr)