SourceMod can now be somewhat compiled on OS X for patch sanity testing (bug 3516, r=ds).

This adds the ability for us to change the GCC version we use more flexibly.
This commit is contained in:
David Anderson
2008-12-23 01:33:37 -05:00
parent 58ec9a4f38
commit 1fe38c7473
65 changed files with 599 additions and 149 deletions
+1 -1
View File
@@ -29,7 +29,7 @@
* Version: $Id$
*/
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
#include "CDataPack.h"
+1 -1
View File
@@ -29,7 +29,7 @@
* Version: $Id$
*/
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
extern HandleType_t htCellArray;
+2 -2
View File
@@ -44,7 +44,7 @@
#ifdef PLATFORM_WINDOWS
ConVar sm_corecfgfile("sm_corecfgfile", "addons\\sourcemod\\configs\\core.cfg", 0, "SourceMod core configuration file");
#elif defined PLATFORM_LINUX
#elif defined PLATFORM_LINUX || defined PLATFORM_APPLE
ConVar sm_corecfgfile("sm_corecfgfile", "addons/sourcemod/configs/core.cfg", 0, "SourceMod core configuration file");
#endif
@@ -275,7 +275,7 @@ inline bool IsPathSepChar(char c)
{
#if defined PLATFORM_WINDOWS
return (c == '\\' || c == '/');
#elif defined PLATFORM_LINUX
#elif defined PLATFORM_LINUX || defined PLATFORM_POSIX
return (c == '/');
#endif
}
+3
View File
@@ -73,6 +73,9 @@ char g_GameName[256] = {'$', '\0'};
#elif defined PLATFORM_LINUX
#define PLATFORM_NAME "linux"
#define PLATFORM_SERVER_BINARY "server_i486.so"
#elif defined PLATFORM_APPLE
#define PLATFORM_NAME "undef"
#define PLATFORM_SERVER_BINARY "undef.dylib"
#endif
struct TempSigInfo
+4 -4
View File
@@ -138,7 +138,7 @@ bool CDirectory::IsEntryDirectory()
{
#if defined PLATFORM_WINDOWS
return ((m_fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY);
#elif defined PLATFORM_LINUX
#elif defined PLATFORM_POSIX
char temppath[PLATFORM_MAX_PATH];
snprintf(temppath, sizeof(temppath), "%s/%s", m_origpath, GetEntryName());
return g_LibSys.IsPathDirectory(temppath);
@@ -160,7 +160,7 @@ const char *CDirectory::GetEntryName()
{
#if defined PLATFORM_WINDOWS
return m_fd.cFileName;
#elif defined PLATFORM_LINUX
#elif defined PLATFORM_POSIX
return ep ? ep->d_name : "";
#endif
}
@@ -174,7 +174,7 @@ bool CDirectory::IsValid()
{
#if defined PLATFORM_WINDOWS
return (m_dir != INVALID_HANDLE_VALUE);
#elif defined PLATFORM_LINUX
#elif defined PLATFORM_POSIX
return (m_dir != NULL);
#endif
}
@@ -214,7 +214,7 @@ bool LibrarySystem::IsPathFile(const char *path)
}
return true;
#elif defined PLATFORM_LINUX
#elif defined PLATFORM_POSIX
struct stat s;
if (stat(path, &s) != 0)
+1 -1
View File
@@ -43,7 +43,7 @@ C_OPT_FLAGS = -DNDEBUG -O3 -funroll-loops -pipe -fno-strict-aliasing
C_DEBUG_FLAGS = -D_DEBUG -DDEBUG -g -ggdb3
C_GCC4_FLAGS = -fvisibility=hidden
CPP_GCC4_FLAGS = -fvisibility-inlines-hidden
CPP = gcc-4.1
CPP = gcc
override ENGSET = false
ifeq "$(ENGINE)" "original"
+2 -11
View File
@@ -201,11 +201,7 @@ char *MD5::hex_digest(){
int i;
char *s= new char[33];
if (!finalized){
/* cerr << "MD5::hex_digest: Can't get digest if you haven't "<<
"finalized the digest!" <<endl;*/
return "";
}
assert(finalized);
for (i=0; i<16; i++)
sprintf(s+i*2, "%02x", digest[i]);
@@ -220,12 +216,7 @@ char *MD5::hex_digest(char buffer[33]){
int i;
if (!finalized)
{
/* cerr << "MD5::hex_digest: Can't get digest if you haven't "<<
"finalized the digest!" <<endl;*/
return "";
}
assert(finalized);
for (i=0; i<16; i++)
sprintf(buffer+i*2, "%02x", digest[i]);
+1 -1
View File
@@ -30,7 +30,7 @@
*/
#include <string.h>
#include <malloc.h>
#include <stdlib.h>
#include "sm_memtable.h"
BaseMemTable::BaseMemTable(unsigned int init_size)
+1 -1
View File
@@ -33,7 +33,7 @@
#define _INCLUDE_SM_QUEUE_H
#include <new>
#include <malloc.h>
#include <stdlib.h>
#include <sh_stack.h>
using namespace SourceHook;
+1 -1
View File
@@ -29,7 +29,7 @@
* Version: $Id$
*/
#include <malloc.h>
#include <stdlib.h>
#include "sm_globals.h"
#include "sm_stringutil.h"
#include "CellArray.h"
+1 -1
View File
@@ -29,7 +29,7 @@
* Version: $Id$
*/
#include <malloc.h>
#include <stdlib.h>
#include "sm_globals.h"
#include "sm_stringutil.h"
#include "CellArray.h"
+1 -1
View File
@@ -29,7 +29,7 @@
* Version: $Id$
*/
#include <malloc.h>
#include <stdlib.h>
#include "sm_globals.h"
#include "sm_stringutil.h"
#include "HandleSys.h"
+3
View File
@@ -418,6 +418,9 @@ 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
}
+1 -1
View File
@@ -40,7 +40,7 @@ inline const char *_strstr(const char *str, const char *substr)
{
#ifdef PLATFORM_WINDOWS
return strstr(str, substr);
#elif defined PLATFORM_LINUX
#elif defined PLATFORM_LINUX || defined PLATFORM_APPLE
return (const char *)strstr(str, substr);
#endif
}