diff --git a/AMBuildScript b/AMBuildScript index 0ac845f6..584337e4 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -68,6 +68,7 @@ class SMConfig(object): self.mysql_root = None self.spcomp = None self.smx_files = {} + self.versionlib = None def detectProductVersion(self): builder.AddConfigureFile('product.version') @@ -245,8 +246,10 @@ class SMConfig(object): cfg.defines += [ 'SOURCEMOD_BUILD', 'SM_GENERATED_BUILD', + 'SM_USE_VERSIONLIB', ] cfg.includes += [os.path.join(builder.buildPath, 'includes')] + cfg.includes += [os.path.join(builder.sourcePath, 'versionlib')] def LibraryBuilder(self, compiler, name): binary = compiler.Library(name) @@ -261,6 +264,7 @@ class SMConfig(object): '-compatibility_version', '1.0.0', '-current_version', self.productVersion ] + binary.compiler.linkflags += [self.versionlib] binary.compiler.sourcedeps += SM.generated_headers return binary @@ -272,6 +276,7 @@ class SMConfig(object): 'BINARY_NAME="{0}"'.format(binary.outputFile), 'SM_GENERATED_BUILD' ] + binary.compiler.linkflags += [self.versionlib] binary.compiler.sourcedeps += SM.generated_headers return binary @@ -432,6 +437,10 @@ SM.generated_headers = builder.RunScript( 'tools/buildbot/Versioning', { 'SM': SM } ) +SM.versionlib = builder.RunScript( + 'versionlib/AMBuilder', + { 'SM': SM } +) builder.RunBuildScripts( [ diff --git a/core/CoreConfig.cpp b/core/CoreConfig.cpp index a79e4d67..42c30ab1 100644 --- a/core/CoreConfig.cpp +++ b/core/CoreConfig.cpp @@ -34,12 +34,12 @@ #include "sourcemod.h" #include "sourcemm_api.h" #include "sm_srvcmds.h" -#include #include "sm_stringutil.h" #include "LibrarySys.h" #include "Logger.h" #include "frame_hooks.h" #include "logic_bridge.h" +#include #ifdef PLATFORM_WINDOWS ConVar sm_corecfgfile("sm_corecfgfile", "addons\\sourcemod\\configs\\core.cfg", 0, "SourceMod core configuration file"); @@ -410,7 +410,7 @@ bool SM_ExecuteConfig(IPlugin *pl, AutoConfig *cfg, bool can_create) FILE *fp = fopen(file, "wt"); if (fp) { - fprintf(fp, "// This file was auto-generated by SourceMod (v%s)\n", SM_VERSION_STRING); + fprintf(fp, "// This file was auto-generated by SourceMod (v%s)\n", SOURCEMOD_VERSION); fprintf(fp, "// ConVars for plugin \"%s\"\n", pl->GetFilename()); fprintf(fp, "\n\n"); diff --git a/core/Logger.cpp b/core/Logger.cpp index a7f24023..20668fc4 100644 --- a/core/Logger.cpp +++ b/core/Logger.cpp @@ -36,8 +36,8 @@ #include "Logger.h" #include "LibrarySys.h" #include "TimerSys.h" -#include #include "logic_bridge.h" +#include Logger g_Logger; @@ -165,7 +165,7 @@ void Logger::_NewMapFile() } else { char date[32]; strftime(date, sizeof(date), "%m/%d/%Y - %H:%M:%S", curtime); - fprintf(fp, "L %s: SourceMod log file started (file \"L%02d%02d%03d.log\") (Version \"%s\")\n", date, curtime->tm_mon + 1, curtime->tm_mday, i, SM_VERSION_STRING); + fprintf(fp, "L %s: SourceMod log file started (file \"L%02d%02d%03d.log\") (Version \"%s\")\n", date, curtime->tm_mon + 1, curtime->tm_mday, i, SOURCEMOD_VERSION); fclose(fp); } } @@ -384,7 +384,7 @@ void Logger::LogMessageEx(const char *vafmt, va_list ap) char date[32]; m_DailyPrintHdr = false; strftime(date, sizeof(date), "%m/%d/%Y - %H:%M:%S", curtime); - fprintf(fp, "L %s: SourceMod log file session started (file \"L%04d%02d%02d.log\") (Version \"%s\")\n", date, curtime->tm_year + 1900, curtime->tm_mon + 1, curtime->tm_mday, SM_VERSION_STRING); + fprintf(fp, "L %s: SourceMod log file session started (file \"L%04d%02d%02d.log\") (Version \"%s\")\n", date, curtime->tm_year + 1900, curtime->tm_mon + 1, curtime->tm_mday, SOURCEMOD_VERSION); } LogToOpenFileEx(fp, vafmt, ap); fclose(fp); diff --git a/core/PlayerManager.cpp b/core/PlayerManager.cpp index cf6e66a2..ede00bfa 100644 --- a/core/PlayerManager.cpp +++ b/core/PlayerManager.cpp @@ -43,9 +43,9 @@ #include #include #include -#include #include "ConsoleDetours.h" #include "logic_bridge.h" +#include PlayerManager g_Players; bool g_OnMapStarted = false; @@ -1065,7 +1065,7 @@ void PlayerManager::OnClientCommand(edict_t *pEntity) } ClientConsolePrint(pEntity, - "SourceMod %s, by AlliedModders LLC", SM_VERSION_STRING); + "SourceMod %s, by AlliedModders LLC", SOURCEMOD_VERSION); ClientConsolePrint(pEntity, "To see running plugins, type \"sm plugins\""); ClientConsolePrint(pEntity, diff --git a/core/sm_srvcmds.cpp b/core/sm_srvcmds.cpp index d3fa7281..3e20f2b2 100644 --- a/core/sm_srvcmds.cpp +++ b/core/sm_srvcmds.cpp @@ -30,15 +30,15 @@ */ #include "sm_srvcmds.h" -#include #include "sm_stringutil.h" #include "CoreConfig.h" #include "ConVarManager.h" #include "logic_bridge.h" +#include RootConsoleMenu g_RootMenu; -ConVar sourcemod_version("sourcemod_version", SM_VERSION_STRING, FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY, "SourceMod Version"); +ConVar sourcemod_version("sourcemod_version", SOURCEMOD_VERSION, FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY, "SourceMod Version"); RootConsoleMenu::RootConsoleMenu() { @@ -333,14 +333,14 @@ void RootConsoleMenu::OnRootConsoleCommand(const char *cmdname, const CCommand & else if (strcmp(cmdname, "version") == 0) { ConsolePrint(" SourceMod Version Information:"); - ConsolePrint(" SourceMod Version: %s", SM_VERSION_STRING); + ConsolePrint(" SourceMod Version: %s", SOURCEMOD_VERSION); if (g_pSourcePawn2->IsJitEnabled()) ConsolePrint(" SourcePawn Engine: %s (build %s)", g_pSourcePawn2->GetEngineName(), g_pSourcePawn2->GetVersionString()); else ConsolePrint(" SourcePawn Engine: %s (build %s NO JIT)", g_pSourcePawn2->GetEngineName(), g_pSourcePawn2->GetVersionString()); ConsolePrint(" SourcePawn API: v1 = %d, v2 = %d", g_pSourcePawn->GetEngineAPIVersion(), g_pSourcePawn2->GetAPIVersion()); ConsolePrint(" Compiled on: %s %s", __DATE__, __TIME__); - ConsolePrint(" Build ID: %s", SM_BUILD_UNIQUEID); + ConsolePrint(" Build ID: %s", SOURCEMOD_BUILD_ID); ConsolePrint(" http://www.sourcemod.net/"); } } diff --git a/core/sourcemm_api.cpp b/core/sourcemm_api.cpp index d92e199e..306965a8 100644 --- a/core/sourcemm_api.cpp +++ b/core/sourcemm_api.cpp @@ -31,11 +31,11 @@ #include "sourcemod.h" #include "sourcemm_api.h" -#include #include "Logger.h" #include "concmd_cleaner.h" #include "compat_wrappers.h" #include "logic_bridge.h" +#include SourceMod_Core g_SourceMod_Core; IVEngineServer *engine = NULL; @@ -149,7 +149,7 @@ const char *SourceMod_Core::GetLicense() const char *SourceMod_Core::GetVersion() { - return SM_VERSION_STRING; + return SOURCEMOD_VERSION; } const char *SourceMod_Core::GetDate() diff --git a/extensions/bintools/extension.cpp b/extensions/bintools/extension.cpp index c91f3c60..7f956792 100644 --- a/extensions/bintools/extension.cpp +++ b/extensions/bintools/extension.cpp @@ -61,11 +61,11 @@ bool BinTools::SDK_OnLoad(char *error, size_t maxlength, bool late) const char *BinTools::GetExtensionVerString() { - return SM_VERSION_STRING; + return SOURCEMOD_VERSION; } const char *BinTools::GetExtensionDateString() { - return SM_BUILD_TIMESTAMP; + return SOURCEMOD_BUILD_TIME; } diff --git a/extensions/clientprefs/extension.cpp b/extensions/clientprefs/extension.cpp index 63ced815..ec200d64 100644 --- a/extensions/clientprefs/extension.cpp +++ b/extensions/clientprefs/extension.cpp @@ -496,12 +496,12 @@ IdentityToken_t *ClientPrefs::GetIdentity() const const char *ClientPrefs::GetExtensionVerString() { - return SM_VERSION_STRING; + return SOURCEMOD_VERSION; } const char *ClientPrefs::GetExtensionDateString() { - return SM_BUILD_TIMESTAMP; + return SOURCEMOD_BUILD_TIME; } ClientPrefs::ClientPrefs() diff --git a/extensions/cstrike/extension.cpp b/extensions/cstrike/extension.cpp index fd767fb2..c0a309d0 100644 --- a/extensions/cstrike/extension.cpp +++ b/extensions/cstrike/extension.cpp @@ -283,12 +283,12 @@ bool CStrike::ProcessCommandTarget(cmd_target_info_t *info) const char *CStrike::GetExtensionVerString() { - return SM_VERSION_STRING; + return SOURCEMOD_VERSION; } const char *CStrike::GetExtensionDateString() { - return SM_BUILD_TIMESTAMP; + return SOURCEMOD_BUILD_TIME; } void CStrike::OnPluginLoaded(IPlugin *plugin) diff --git a/extensions/curl/extension.cpp b/extensions/curl/extension.cpp index 37456506..b7c29bc5 100644 --- a/extensions/curl/extension.cpp +++ b/extensions/curl/extension.cpp @@ -78,11 +78,11 @@ void CurlExt::SDK_OnUnload() const char *CurlExt::GetExtensionVerString() { - return SM_VERSION_STRING; + return SOURCEMOD_VERSION; } const char *CurlExt::GetExtensionDateString() { - return SM_BUILD_TIMESTAMP; + return SOURCEMOD_BUILD_TIME; } diff --git a/extensions/geoip/extension.cpp b/extensions/geoip/extension.cpp index d3159804..6d3c8fc7 100644 --- a/extensions/geoip/extension.cpp +++ b/extensions/geoip/extension.cpp @@ -70,12 +70,12 @@ void GeoIP_Extension::SDK_OnUnload() const char *GeoIP_Extension::GetExtensionVerString() { - return SM_VERSION_STRING; + return SOURCEMOD_VERSION; } const char *GeoIP_Extension::GetExtensionDateString() { - return SM_BUILD_TIMESTAMP; + return SOURCEMOD_BUILD_TIME; } /******************************* diff --git a/extensions/mysql/extension.cpp b/extensions/mysql/extension.cpp index d6264789..272b50ef 100644 --- a/extensions/mysql/extension.cpp +++ b/extensions/mysql/extension.cpp @@ -62,11 +62,11 @@ void DBI_MySQL::SDK_OnUnload() const char *DBI_MySQL::GetExtensionVerString() { - return SM_VERSION_STRING; + return SOURCEMOD_VERSION; } const char *DBI_MySQL::GetExtensionDateString() { - return SM_BUILD_TIMESTAMP; + return SOURCEMOD_BUILD_TIME; } diff --git a/extensions/regex/extension.cpp b/extensions/regex/extension.cpp index 37199936..5f7b6f17 100644 --- a/extensions/regex/extension.cpp +++ b/extensions/regex/extension.cpp @@ -65,12 +65,12 @@ void RegexExtension::SDK_OnUnload() const char *RegexExtension::GetExtensionVerString() { - return SM_VERSION_STRING; + return SOURCEMOD_VERSION; } const char *RegexExtension::GetExtensionDateString() { - return SM_BUILD_TIMESTAMP; + return SOURCEMOD_BUILD_TIME; } static cell_t CompileRegex(IPluginContext *pCtx, const cell_t *params) diff --git a/extensions/sdkhooks/extension.cpp b/extensions/sdkhooks/extension.cpp index d4c6de12..4fe96c0b 100644 --- a/extensions/sdkhooks/extension.cpp +++ b/extensions/sdkhooks/extension.cpp @@ -354,12 +354,12 @@ bool SDKHooks::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool const char *SDKHooks::GetExtensionVerString() { - return SM_VERSION_STRING; + return SOURCEMOD_VERSION; } const char *SDKHooks::GetExtensionDateString() { - return SM_BUILD_TIMESTAMP; + return SOURCEMOD_BUILD_TIME; } void SDKHooks::OnPluginLoaded(IPlugin *plugin) diff --git a/extensions/sdktools/extension.cpp b/extensions/sdktools/extension.cpp index 3e5e2027..a8e0d025 100644 --- a/extensions/sdktools/extension.cpp +++ b/extensions/sdktools/extension.cpp @@ -437,12 +437,12 @@ bool SDKTools::ProcessCommandTarget(cmd_target_info_t *info) const char *SDKTools::GetExtensionVerString() { - return SM_VERSION_STRING; + return SOURCEMOD_VERSION; } const char *SDKTools::GetExtensionDateString() { - return SM_BUILD_TIMESTAMP; + return SOURCEMOD_BUILD_TIME; } void SDKTools::OnClientPutInServer(int client) diff --git a/extensions/sqlite/Makefile b/extensions/sqlite/Makefile index 9c0dbc17..d68ab723 100644 --- a/extensions/sqlite/Makefile +++ b/extensions/sqlite/Makefile @@ -89,10 +89,11 @@ else endif LINK += -lpthread -m32 -ldl -lm +INCLUDE += -I$(SMSDK)/public/amtl CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \ -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Werror \ - -Wno-uninitialized -mfpmath=sse -msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H -DSQLITE_THREADSAFE \ + -Wno-uninitialized -msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H -DSQLITE_THREADSAFE \ -DSQLITE_OMIT_LOAD_EXTENSION -m32 CPPFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti diff --git a/extensions/sqlite/extension.cpp b/extensions/sqlite/extension.cpp index 4016aed6..410b56fe 100644 --- a/extensions/sqlite/extension.cpp +++ b/extensions/sqlite/extension.cpp @@ -74,11 +74,11 @@ size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) const char *SqliteExt::GetExtensionVerString() { - return SM_VERSION_STRING; + return SOURCEMOD_VERSION; } const char *SqliteExt::GetExtensionDateString() { - return SM_BUILD_TIMESTAMP; + return SOURCEMOD_BUILD_TIME; } diff --git a/extensions/tf2/extension.cpp b/extensions/tf2/extension.cpp index b1893d50..1f49f0ff 100644 --- a/extensions/tf2/extension.cpp +++ b/extensions/tf2/extension.cpp @@ -136,12 +136,12 @@ bool TF2Tools::SDK_OnLoad(char *error, size_t maxlength, bool late) const char *TF2Tools::GetExtensionVerString() { - return SM_VERSION_STRING; + return SOURCEMOD_VERSION; } const char *TF2Tools::GetExtensionDateString() { - return SM_BUILD_TIMESTAMP; + return SOURCEMOD_BUILD_TIME; } bool TF2Tools::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool late) diff --git a/extensions/topmenus/extension.cpp b/extensions/topmenus/extension.cpp index 6820600f..38a239d6 100644 --- a/extensions/topmenus/extension.cpp +++ b/extensions/topmenus/extension.cpp @@ -67,11 +67,11 @@ void TopMenuExtension::SDK_OnUnload() const char *TopMenuExtension::GetExtensionVerString() { - return SM_VERSION_STRING; + return SOURCEMOD_VERSION; } const char *TopMenuExtension::GetExtensionDateString() { - return SM_BUILD_TIMESTAMP; + return SOURCEMOD_BUILD_TIME; } diff --git a/extensions/updater/Updater.cpp b/extensions/updater/Updater.cpp index d20a143b..ba18ff4e 100644 --- a/extensions/updater/Updater.cpp +++ b/extensions/updater/Updater.cpp @@ -29,11 +29,11 @@ * Version: $Id$ */ -#include #include #include "extension.h" #include "Updater.h" #include "md5.h" +#include #define USTATE_NONE 0 #define USTATE_FOLDERS 1 @@ -356,7 +356,7 @@ void UpdateReader::PerformUpdate(const char *url) xfer = webternet->CreateSession(); xfer->SetFailOnHTTPError(true); - form->AddString("version", SM_VERSION_STRING); + form->AddString("version", SOURCEMOD_VERSION); unsigned int num_files = 0; add_folders(form, "gamedata", num_files); diff --git a/extensions/updater/extension.cpp b/extensions/updater/extension.cpp index 06b2a83f..4fcdbbc4 100644 --- a/extensions/updater/extension.cpp +++ b/extensions/updater/extension.cpp @@ -249,11 +249,11 @@ void AddUpdateError(const char *fmt, ...) const char *SmUpdater::GetExtensionVerString() { - return SM_VERSION_STRING; + return SOURCEMOD_VERSION; } const char *SmUpdater::GetExtensionDateString() { - return SM_BUILD_TIMESTAMP; + return SOURCEMOD_BUILD_TIME; } diff --git a/public/sourcemod_version.h b/public/sourcemod_version.h index 4f81926f..a5d88112 100644 --- a/public/sourcemod_version.h +++ b/public/sourcemod_version.h @@ -39,7 +39,11 @@ */ #if defined SM_GENERATED_BUILD -#include +# if defined SM_USE_VERSIONLIB +# include +# else +# include +# endif #else #define SM_BUILD_TAG "manual" #define SM_BUILD_REV "0" @@ -55,5 +59,11 @@ #endif #define SM_BUILD_TIMESTAMP __DATE__ " " __TIME__ +#if !defined(SM_GENERATED_BUILD) || !defined(SM_USE_VERSIONLIB) +# define SOURCEMOD_VERSION SM_VERSION_STRING +# define SOURCEMOD_BUILD_ID SM_BUILD_UNIQUEID +# define SOURCEMOD_BUILD_TIME SM_BUILD_TIMESTAMP +#endif + #endif /* _INCLUDE_SOURCEMOD_VERSION_INFORMATION_H_ */ diff --git a/sourcepawn/compiler/sc1.c b/sourcepawn/compiler/sc1.c index e1ab9d24..9c8f5c13 100644 --- a/sourcepawn/compiler/sc1.c +++ b/sourcepawn/compiler/sc1.c @@ -1244,7 +1244,7 @@ static void setconfig(char *root) static void setcaption(void) { - pc_printf("SourcePawn Compiler " SM_VERSION_STRING "\n"); + pc_printf("SourcePawn Compiler %s\n", SOURCEMOD_VERSION); pc_printf("Copyright (c) 1997-2006, ITB CompuPhase, (C)2004-2008 AlliedModders, LLC\n\n"); } diff --git a/sourcepawn/jit/engine2.cpp b/sourcepawn/jit/engine2.cpp index 5c4d9d53..09023cbd 100644 --- a/sourcepawn/jit/engine2.cpp +++ b/sourcepawn/jit/engine2.cpp @@ -1,5 +1,4 @@ // vim: set ts=4 sw=4 tw=99 noet: -#include #include #include #include @@ -9,6 +8,7 @@ #include "BaseRuntime.h" #include "sp_vm_engine.h" #include "watchdog_timer.h" +#include using namespace SourcePawn; @@ -152,7 +152,7 @@ const char *SourcePawnEngine2::GetEngineName() const char *SourcePawnEngine2::GetVersionString() { - return SM_VERSION_STRING; + return SOURCEMOD_VERSION; } IProfiler *SourcePawnEngine2::GetProfiler() diff --git a/versionlib/AMBuilder b/versionlib/AMBuilder new file mode 100644 index 00000000..2676d1d6 --- /dev/null +++ b/versionlib/AMBuilder @@ -0,0 +1,15 @@ +# vim: sts=2 ts=8 sw=2 tw=99 et ft=python: +import os + +lib = builder.compiler.StaticLibrary('version') +lib.compiler.includes += [ + os.path.join(builder.sourcePath, 'public') +] +lib.compiler.defines.remove('SM_USE_VERSIONLIB') +lib.compiler.sourcedeps += SM.generated_headers +lib.sources += [ + 'versionlib.cpp' +] +task = builder.Add(lib) + +rvalue = task.binary diff --git a/versionlib/versionlib.cpp b/versionlib/versionlib.cpp new file mode 100644 index 00000000..571d33b5 --- /dev/null +++ b/versionlib/versionlib.cpp @@ -0,0 +1,34 @@ +/** + * vim: set ts=4 sw=4 tw=99 noet : + * ============================================================================= + * SourceMod + * Copyright (C) 2004-2013 AlliedModders LLC. All rights reserved. + * ============================================================================= + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License, version 3.0, as published by the + * Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + * + * As a special exception, AlliedModders LLC gives you permission to link the + * code of this program (as well as its derivative works) to "Half-Life 2," the + * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software + * by the Valve Corporation. You must obey the GNU General Public License in + * all respects for all other code used. Additionally, AlliedModders LLC grants + * this exception to all derivative works. AlliedModders LLC defines further + * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), + * or . + */ +#include +#include + +const char *SOURCEMOD_BUILD_ID = SM_BUILD_UNIQUEID; +const char *SOURCEMOD_VERSION = SM_VERSION_STRING; +const char *SOURCEMOD_BUILD_TIME = __DATE__ " " __TIME__; diff --git a/versionlib/versionlib.h b/versionlib/versionlib.h new file mode 100644 index 00000000..bd2e0844 --- /dev/null +++ b/versionlib/versionlib.h @@ -0,0 +1,49 @@ +/** + * vim: set ts=4 sw=4 tw=99 noet : + * ============================================================================= + * SourceMod + * Copyright (C) 2004-2013 AlliedModders LLC. All rights reserved. + * ============================================================================= + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License, version 3.0, as published by the + * Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + * + * As a special exception, AlliedModders LLC gives you permission to link the + * code of this program (as well as its derivative works) to "Half-Life 2," the + * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software + * by the Valve Corporation. You must obey the GNU General Public License in + * all respects for all other code used. Additionally, AlliedModders LLC grants + * this exception to all derivative works. AlliedModders LLC defines further + * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), + * or . + */ +#ifndef _INCLUDE_SOURCEMOD_VERSIONLIB_H_ +#define _INCLUDE_SOURCEMOD_VERSIONLIB_H_ + +#if !defined(SM_USE_VERSIONLIB) +// These get defined in sourcemod_version.h since +// versionlib does not use versionlib. +# undef SOURCEMOD_BUILD_ID +# undef SOURCEMOD_VERSION +# undef SOURCEMOD_BUILD_TIME +#endif + +#ifdef __cplusplus +# define EXTERN_C extern "C" +#else +# define EXTERN_C extern +#endif +EXTERN_C const char *SOURCEMOD_BUILD_ID; +EXTERN_C const char *SOURCEMOD_VERSION; +EXTERN_C const char *SOURCEMOD_BUILD_TIME; + +#endif // _INCLUDE_SOURCEMOD_VERSIONLIB_H_