More mac/linux compile fixes.
More mac/linux compile fixes.
1.1 --- a/core/HalfLife2.cpp Sat Feb 25 15:23:39 2012 -0500
1.2 +++ b/core/HalfLife2.cpp Sat Feb 25 16:41:00 2012 -0500
1.3 @@ -41,15 +41,23 @@
1.4 #include "LibrarySys.h"
1.5 #include "logic_bridge.h"
1.6
1.7 +
1.8 +typedef ICommandLine *(*FakeGetCommandLine)();
1.9 +
1.10 #if defined _WIN32
1.11 #define TIER0_NAME "tier0.dll"
1.12 #define VSTDLIB_NAME "vstdlib.dll"
1.13 #elif defined __APPLE__
1.14 #define TIER0_NAME "libtier0.dylib"
1.15 #define VSTDLIB_NAME "libvstdlib.dylib"
1.16 -#elif defined __linux__
1.17 -#define TIER0_NAME LIB_PREFIX "tier0" LIB_SUFFIX
1.18 -#define VSTDLIB_NAME LIB_PREFIX "vstdlib" LIB_SUFFIX
1.19 +#elif defined __linux__
1.20 +#if SOURCE_ENGINE == SE_EPISODE1 || SOURCE_ENGINE == ORANGEBOX || SOURCE_ENGINE == SE_LEFT4DEAD
1.21 +#define TIER0_NAME "tier0_i486.so"
1.22 +#define VSTDLIB_NAME "vstdlib_i486.so"
1.23 +#else
1.24 +#define TIER0_NAME "libtier0.so"
1.25 +#define VSTDLIB_NAME "libvstdlib.so"
1.26 +#endif
1.27 #endif
1.28
1.29 CHalfLife2 g_HL2;
1.30 @@ -228,12 +236,12 @@
1.31 }
1.32
1.33 ILibrary *lib = g_LibSys.OpenLibrary(path, error, sizeof(error));
1.34 - m_pGetCommandLine = (GetCommandLine)lib->GetSymbolAddress("CommandLine_Tier0");
1.35 + m_pGetCommandLine = lib->GetSymbolAddress("CommandLine_Tier0");
1.36
1.37 /* '_Tier0' dropped on Alien Swarm version */
1.38 if (m_pGetCommandLine == NULL)
1.39 {
1.40 - m_pGetCommandLine = (GetCommandLine)lib->GetSymbolAddress("CommandLine");
1.41 + m_pGetCommandLine = lib->GetSymbolAddress("CommandLine");
1.42 }
1.43
1.44 if (m_pGetCommandLine == NULL)
1.45 @@ -253,7 +261,7 @@
1.46 return;
1.47 }
1.48
1.49 - m_pGetCommandLine = (GetCommandLine)lib->GetSymbolAddress("CommandLine");
1.50 + m_pGetCommandLine = lib->GetSymbolAddress("CommandLine");
1.51
1.52 if (m_pGetCommandLine == NULL)
1.53 {
1.54 @@ -269,7 +277,7 @@
1.55 if (!m_pGetCommandLine)
1.56 return NULL;
1.57
1.58 - return m_pGetCommandLine();
1.59 + return ((FakeGetCommandLine)((FakeGetCommandLine *)m_pGetCommandLine))();
1.60 }
1.61
1.62 #if !defined METAMOD_PLAPI_VERSION || PLAPI_VERSION < 11
2.1 --- a/core/HalfLife2.h Sat Feb 25 15:23:39 2012 -0500
2.2 +++ b/core/HalfLife2.h Sat Feb 25 16:41:00 2012 -0500
2.3 @@ -46,10 +46,6 @@
2.4 #include <ihandleentity.h>
2.5 #include <tier0/icommandline.h>
2.6
2.7 -#undef GetCommandLine
2.8 -
2.9 -typedef ICommandLine *(*GetCommandLine)();
2.10 -
2.11 class CCommand;
2.12
2.13 using namespace SourceHook;
2.14 @@ -172,7 +168,7 @@
2.15 CStack<DelayedFakeCliCmd *> m_FreeCmds;
2.16 CStack<CachedCommandInfo> m_CommandStack;
2.17 Queue<DelayedKickInfo> m_DelayedKicks;
2.18 - GetCommandLine m_pGetCommandLine;
2.19 + void *m_pGetCommandLine;
2.20 };
2.21
2.22 extern CHalfLife2 g_HL2;
3.1 --- a/pushbuild.txt Sat Feb 25 15:23:39 2012 -0500
3.2 +++ b/pushbuild.txt Sat Feb 25 16:41:00 2012 -0500
3.3 @@ -56,3 +56,4 @@
3.4 rum ham
3.5 scrambled eggs
3.6 EXCEPTION
3.7 +asher make me touch this
3.8 \ No newline at end of file