extensions/geoip/sdk/smsdk_ext.cpp
changeset 2471 194be299b700
parent 2289 44045ead61cd
     1.1 --- a/extensions/geoip/sdk/smsdk_ext.cpp	Mon Dec 15 18:47:11 2008 +1300
     1.2 +++ b/extensions/geoip/sdk/smsdk_ext.cpp	Tue Dec 23 01:33:37 2008 -0500
     1.3 @@ -30,7 +30,7 @@
     1.4   */
     1.5  
     1.6  #include <stdio.h>
     1.7 -#include <malloc.h>
     1.8 +#include <stdlib.h>
     1.9  #include "smsdk_ext.h"
    1.10  
    1.11  /**
    1.12 @@ -79,6 +79,24 @@
    1.13  #if defined SMEXT_ENABLE_LIBSYS
    1.14  ILibrarySys *libsys = NULL;
    1.15  #endif
    1.16 +#if defined SMEXT_ENABLE_PLUGINSYS
    1.17 +SourceMod::IPluginManager *plsys;
    1.18 +#endif
    1.19 +#if defined SMEXT_ENABLE_MENUS
    1.20 +IMenuManager *menus = NULL;
    1.21 +#endif
    1.22 +#if defined SMEXT_ENABLE_ADMINSYS
    1.23 +IAdminSystem *adminsys = NULL;
    1.24 +#endif
    1.25 +#if defined SMEXT_ENABLE_TEXTPARSERS
    1.26 +ITextParsers *textparsers = NULL;
    1.27 +#endif
    1.28 +#if defined SMEXT_ENABLE_USERMSGS
    1.29 +IUserMessages *usermsgs = NULL;
    1.30 +#endif
    1.31 +#if defined SMEXT_ENABLE_TRANSLATOR
    1.32 +ITranslator *translator = NULL;
    1.33 +#endif
    1.34  
    1.35  /** Exports the main interface */
    1.36  PLATFORM_EXTERN_C IExtensionInterface *GetSMExtAPI()
    1.37 @@ -149,6 +167,24 @@
    1.38  #if defined SMEXT_ENABLE_LIBSYS
    1.39  	SM_GET_IFACE(LIBRARYSYS, libsys);
    1.40  #endif
    1.41 +#if defined SMEXT_ENABLE_PLUGINSYS
    1.42 +	SM_GET_IFACE(PLUGINSYSTEM, plsys);
    1.43 +#endif
    1.44 +#if defined SMEXT_ENABLE_MENUS
    1.45 +	SM_GET_IFACE(MENUMANAGER, menus);
    1.46 +#endif
    1.47 +#if defined SMEXT_ENABLE_ADMINSYS
    1.48 +	SM_GET_IFACE(ADMINSYS, adminsys);
    1.49 +#endif
    1.50 +#if defined SMEXT_ENABLE_TEXTPARSERS
    1.51 +	SM_GET_IFACE(TEXTPARSERS, textparsers);
    1.52 +#endif
    1.53 +#if defined SMEXT_ENABLE_USERMSGS
    1.54 +	SM_GET_IFACE(USERMSGS, usermsgs);
    1.55 +#endif
    1.56 +#if defined SMEXT_ENABLE_TRANSLATOR
    1.57 +	SM_GET_IFACE(TRANSLATOR, translator);
    1.58 +#endif
    1.59  
    1.60  	if (SDK_OnLoad(error, maxlength, late))
    1.61  	{
    1.62 @@ -256,7 +292,11 @@
    1.63  /** Exposes the extension to Metamod */
    1.64  SMM_API void *PL_EXPOSURE(const char *name, int *code)
    1.65  {
    1.66 +#if defined METAMOD_PLAPI_VERSION
    1.67 +	if (name && !strcmp(name, METAMOD_PLAPI_NAME))
    1.68 +#else
    1.69  	if (name && !strcmp(name, PLAPI_NAME))
    1.70 +#endif
    1.71  	{
    1.72  		if (code)
    1.73  		{
    1.74 @@ -277,8 +317,13 @@
    1.75  {
    1.76  	PLUGIN_SAVEVARS();
    1.77  
    1.78 +#if !defined METAMOD_PLAPI_VERSION
    1.79  	GET_V_IFACE_ANY(serverFactory, gamedll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL);
    1.80  	GET_V_IFACE_CURRENT(engineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
    1.81 +#else
    1.82 +	GET_V_IFACE_ANY(GetServerFactory, gamedll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL);
    1.83 +	GET_V_IFACE_CURRENT(GetEngineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
    1.84 +#endif
    1.85  
    1.86  	m_SourceMMLoaded = true;
    1.87  
    1.88 @@ -389,7 +434,7 @@
    1.89  #endif
    1.90  
    1.91  /* Overload a few things to prevent libstdc++ linking */
    1.92 -#if defined __linux__
    1.93 +#if defined __linux__ || defined __APPLE__
    1.94  extern "C" void __cxa_pure_virtual(void)
    1.95  {
    1.96  }
    1.97 @@ -414,3 +459,4 @@
    1.98  	free(ptr);
    1.99  }
   1.100  #endif
   1.101 +