Fixed various areas where code was being compiled for Linux only, but should actually be used on OS X too (bug 4392, r=dvander).
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
#include "ConCommandBaseIterator.h"
|
||||
#include "ShareSys.h"
|
||||
|
||||
#if defined PLATFORM_LINUX
|
||||
#if defined PLATFORM_POSIX
|
||||
# include <dlfcn.h>
|
||||
# include <sys/mman.h>
|
||||
# include <stdint.h>
|
||||
|
||||
+1
-1
@@ -153,7 +153,7 @@ void CHalfLife2::OnSourceModAllInitialized_Post()
|
||||
return;
|
||||
}
|
||||
g_EntList = *reinterpret_cast<void **>(addr + offset);
|
||||
#elif defined PLATFORM_LINUX
|
||||
#elif defined PLATFORM_LINUX || defined PLATFORM_APPLE
|
||||
/* gEntList and/or g_pEntityList */
|
||||
if (!g_pGameConf->GetMemSig("gEntList", (void **)&addr))
|
||||
{
|
||||
|
||||
+1
-1
@@ -241,7 +241,7 @@ bool LibrarySystem::IsPathDirectory(const char *path)
|
||||
return true;
|
||||
}
|
||||
|
||||
#elif defined PLATFORM_LINUX
|
||||
#elif defined PLATFORM_POSIX
|
||||
struct stat s;
|
||||
|
||||
if (stat(path, &s) != 0)
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#include "sm_crc32.h"
|
||||
#include "MemoryUtils.h"
|
||||
|
||||
#if defined PLATFORM_LINUX
|
||||
#if defined PLATFORM_POSIX
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
@@ -523,7 +523,7 @@ SMCResult CGameConfig::ReadSMC_LeavingSection(const SMCStates *states)
|
||||
s_TempSig.library,
|
||||
m_CurFile);
|
||||
} else {
|
||||
#if defined PLATFORM_LINUX
|
||||
#if defined PLATFORM_POSIX
|
||||
if (s_TempSig.sig[0] == '@')
|
||||
{
|
||||
Dl_info info;
|
||||
@@ -570,7 +570,7 @@ SMCResult CGameConfig::ReadSMC_LeavingSection(const SMCStates *states)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined PLATFORM_LINUX
|
||||
#if defined PLATFORM_POSIX
|
||||
skip_find:
|
||||
#endif
|
||||
m_Sigs.replace(m_offset, final_addr);
|
||||
|
||||
+2
-5
@@ -46,7 +46,7 @@
|
||||
|
||||
#if defined PLATFORM_WINDOWS
|
||||
#include <windows.h>
|
||||
#elif defined PLATFORM_LINUX
|
||||
#elif defined PLATFORM_POSIX
|
||||
#include <limits.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/times.h>
|
||||
@@ -407,7 +407,7 @@ static cell_t GetSysTickCount(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
#if defined PLATFORM_WINDOWS
|
||||
return (cell_t)GetTickCount();
|
||||
#elif defined PLATFORM_LINUX
|
||||
#elif defined PLATFORM_POSIX
|
||||
tms tm;
|
||||
clock_t ticks = times(&tm);
|
||||
long ticks_per_sec = sysconf(_SC_CLK_TCK);
|
||||
@@ -419,9 +419,6 @@ static cell_t GetSysTickCount(IPluginContext *pContext, const cell_t *params)
|
||||
fticks -= r;
|
||||
}
|
||||
return (cell_t)fticks;
|
||||
#elif defined PLATFORM_APPLE
|
||||
assert(false);
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
//Note: Do not add this to Linux yet, i haven't done the HPET timing research (if even available)
|
||||
//nonetheless we need accurate counting
|
||||
#if !defined PLATFORM_LINUX
|
||||
#if !defined PLATFORM_LINUX && !defined PLATFORM_APPLE
|
||||
|
||||
struct Profiler
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user