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