Cleaned up a few things in regex extension and updated project files to build on both engines. Linux makefiles probably still won't work. sourcemod-1.1.0
authorMatt Woodrow <pred@alliedmods.net>
Tue Mar 04 23:18:16 2008 +0000 (2008-03-04)
branchsourcemod-1.1.0
changeset 1919fe6181f4b9d2
parent 1849 e311a9419c23
child 1930 12f08d51439c
Cleaned up a few things in regex extension and updated project files to build on both engines. Linux makefiles probably still won't work.
extensions/regex/CRegEx.cpp
extensions/regex/extension.cpp
extensions/regex/msvc8/sdk.sln
extensions/regex/msvc8/sdk.vcproj
     1.1 --- a/extensions/regex/CRegEx.cpp	Thu Jan 17 00:31:58 2008 +0000
     1.2 +++ b/extensions/regex/CRegEx.cpp	Tue Mar 04 23:18:16 2008 +0000
     1.3 @@ -13,7 +13,7 @@
     1.4  	mSubStrings = 0;
     1.5  }
     1.6  
     1.7 -void RegEx::Clear()
     1.8 +void RegEx::Clear ()
     1.9  {
    1.10  	mErrorOffset = 0;
    1.11  	mError = NULL;
     2.1 --- a/extensions/regex/extension.cpp	Thu Jan 17 00:31:58 2008 +0000
     2.2 +++ b/extensions/regex/extension.cpp	Tue Mar 04 23:18:16 2008 +0000
     2.3 @@ -32,7 +32,6 @@
     2.4  #include "extension.h"
     2.5  
     2.6  #include <sh_string.h>
     2.7 -#include <sh_vector.h>
     2.8  #include "pcre.h"
     2.9  #include "CRegEx.h"
    2.10  using namespace SourceHook;
    2.11 @@ -50,21 +49,6 @@
    2.12  HandleType_t g_RegexHandle=0;
    2.13  
    2.14  
    2.15 -SourceHook::CVector<RegEx *> PEL;
    2.16 -
    2.17 -int GetPEL()
    2.18 -{
    2.19 -	for (int i=0; i<(int)PEL.size(); i++)
    2.20 -	{
    2.21 -		if (PEL[i]->isFree())
    2.22 -			return i;
    2.23 -	}
    2.24 -
    2.25 -	RegEx *x = new RegEx();
    2.26 -	PEL.push_back(x);
    2.27 -
    2.28 -	return (int)PEL.size() - 1;
    2.29 -}
    2.30  
    2.31  bool RegexExtension::SDK_OnLoad(char *error, size_t err_max, bool late)
    2.32  {
    2.33 @@ -76,15 +60,7 @@
    2.34  void RegexExtension::SDK_OnUnload()
    2.35  {
    2.36  	g_pHandleSys->RemoveType(g_RegexHandle, myself->GetIdentity());
    2.37 -	for(int i=0; i<(int)PEL.size(); i++)
    2.38 -	{
    2.39 -		if(PEL[i])
    2.40 -		{
    2.41 -			delete PEL[i];
    2.42 -			PEL[i] = 0;
    2.43 -		}
    2.44 -	}
    2.45 -	PEL.clear();
    2.46 +
    2.47  }
    2.48  
    2.49  static cell_t CompileRegex(IPluginContext *pCtx, const cell_t *params)
    2.50 @@ -92,8 +68,7 @@
    2.51  	char *regex;
    2.52  	pCtx->LocalToString(params[1], &regex);
    2.53  
    2.54 -	int id = GetPEL();
    2.55 -	RegEx *x = PEL[id];
    2.56 +	RegEx *x = new RegEx();
    2.57  	
    2.58  	if (x->Compile(regex, params[2]) == 0)
    2.59  	{
    2.60 @@ -201,6 +176,7 @@
    2.61  	RegEx *x = (RegEx *)object;
    2.62  
    2.63  	x->Clear();
    2.64 +	delete x;
    2.65  }
    2.66  
    2.67  const sp_nativeinfo_t regex_natives[] = 
     3.1 --- a/extensions/regex/msvc8/sdk.sln	Thu Jan 17 00:31:58 2008 +0000
     3.2 +++ b/extensions/regex/msvc8/sdk.sln	Tue Mar 04 23:18:16 2008 +0000
     3.3 @@ -1,18 +1,24 @@
     3.4  
     3.5  Microsoft Visual Studio Solution File, Format Version 9.00
     3.6 -# Visual Studio 2005
     3.7 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sdk", "sdk.vcproj", "{B3E797CF-4E77-4C9D-B8A8-7589B6902206}"
     3.8 +# Visual C++ Express 2005
     3.9 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "regex", "sdk.vcproj", "{B3E797CF-4E77-4C9D-B8A8-7589B6902206}"
    3.10  EndProject
    3.11  Global
    3.12  	GlobalSection(SolutionConfigurationPlatforms) = preSolution
    3.13 -		Debug|Win32 = Debug|Win32
    3.14 -		Release|Win32 = Release|Win32
    3.15 +		Debug - Episode 1|Win32 = Debug - Episode 1|Win32
    3.16 +		Debug - Orange Box|Win32 = Debug - Orange Box|Win32
    3.17 +		Release - Episode 1|Win32 = Release - Episode 1|Win32
    3.18 +		Release - Orange Box|Win32 = Release - Orange Box|Win32
    3.19  	EndGlobalSection
    3.20  	GlobalSection(ProjectConfigurationPlatforms) = postSolution
    3.21 -		{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug|Win32.ActiveCfg = Debug|Win32
    3.22 -		{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug|Win32.Build.0 = Debug|Win32
    3.23 -		{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release|Win32.ActiveCfg = Release|Win32
    3.24 -		{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release|Win32.Build.0 = Release|Win32
    3.25 +		{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Episode 1|Win32.ActiveCfg = Debug|Win32
    3.26 +		{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Episode 1|Win32.Build.0 = Debug|Win32
    3.27 +		{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Orange Box|Win32.ActiveCfg = Debug - Orange Box|Win32
    3.28 +		{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Orange Box|Win32.Build.0 = Debug - Orange Box|Win32
    3.29 +		{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Episode 1|Win32.ActiveCfg = Release|Win32
    3.30 +		{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Episode 1|Win32.Build.0 = Release|Win32
    3.31 +		{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Orange Box|Win32.ActiveCfg = Release - Orange Box|Win32
    3.32 +		{B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Orange Box|Win32.Build.0 = Release - Orange Box|Win32
    3.33  	EndGlobalSection
    3.34  	GlobalSection(SolutionProperties) = preSolution
    3.35  		HideSolutionNode = FALSE
     4.1 --- a/extensions/regex/msvc8/sdk.vcproj	Thu Jan 17 00:31:58 2008 +0000
     4.2 +++ b/extensions/regex/msvc8/sdk.vcproj	Tue Mar 04 23:18:16 2008 +0000
     4.3 @@ -40,7 +40,7 @@
     4.4  			<Tool
     4.5  				Name="VCCLCompilerTool"
     4.6  				Optimization="0"
     4.7 -				AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn"
     4.8 +				AdditionalIncludeDirectories="..\;..\sdk;..\..;..\systems;..\..\..\public;..\..\..\public\sourcepawn;&quot;$(SOURCEMM142)&quot;;&quot;$(SOURCEMM142)\sourcemm&quot;;&quot;$(SOURCEMM142)\sourcehook&quot;;&quot;$(HL2SDK)\public\tier1&quot;;&quot;$(HL2SDK)\public&quot;;&quot;$(HL2SDK)\public\engine&quot;;&quot;$(HL2SDK)\public\game\server&quot;;&quot;$(HL2SDK)\public\mathlib&quot;;&quot;$(HL2SDK)\public\tier0&quot;;&quot;$(HL2SDK)\public\tier1&quot;;&quot;$(HL2SDK)\public\vstdlib&quot;;&quot;$(HL2SDK)\tier1&quot;;"
     4.9  				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
    4.10  				MinimalRebuild="true"
    4.11  				BasicRuntimeChecks="3"
    4.12 @@ -64,7 +64,7 @@
    4.13  			<Tool
    4.14  				Name="VCLinkerTool"
    4.15  				IgnoreImportLibrary="false"
    4.16 -				AdditionalDependencies="..\lib_win\pcre.lib tier0.lib mathlib.lib"
    4.17 +				AdditionalDependencies="..\lib_win\pcre.lib &quot;$(HL2SDK)\lib\public\tier0.lib&quot; &quot;$(HL2SDK)\lib\public\tier1.lib&quot; &quot;$(HL2SDK)\lib\public\vstdlib.lib&quot; &quot;$(HL2SDK)\lib\public\mathlib.lib&quot;"
    4.18  				OutputFile="$(OutDir)\regex.ext.dll"
    4.19  				LinkIncremental="2"
    4.20  				IgnoreDefaultLibraryNames="LIBCMTD"
    4.21 @@ -126,7 +126,7 @@
    4.22  			<Tool
    4.23  				Name="VCCLCompilerTool"
    4.24  				FavorSizeOrSpeed="1"
    4.25 -				AdditionalIncludeDirectories="..;..\sdk;..\..\..\public;..\..\..\public\sourcepawn"
    4.26 +				AdditionalIncludeDirectories="..\;..\sdk;..\..;..\systems;..\..\..\public;..\..\..\public\sourcepawn;&quot;$(SOURCEMM142)&quot;;&quot;$(SOURCEMM142)\sourcemm&quot;;&quot;$(SOURCEMM142)\sourcehook&quot;;&quot;$(HL2SDK)\public\tier1&quot;;&quot;$(HL2SDK)\public&quot;;&quot;$(HL2SDK)\public\engine&quot;;&quot;$(HL2SDK)\public\game\server&quot;;&quot;$(HL2SDK)\public\mathlib&quot;;&quot;$(HL2SDK)\public\tier0&quot;;&quot;$(HL2SDK)\public\tier1&quot;;&quot;$(HL2SDK)\public\vstdlib&quot;;&quot;$(HL2SDK)\tier1&quot;;"
    4.27  				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
    4.28  				RuntimeLibrary="0"
    4.29  				EnableEnhancedInstructionSet="1"
    4.30 @@ -147,7 +147,175 @@
    4.31  			/>
    4.32  			<Tool
    4.33  				Name="VCLinkerTool"
    4.34 -				OutputFile="$(OutDir)\sample.ext.dll"
    4.35 +				AdditionalDependencies="..\lib_win\pcre.lib &quot;$(HL2SDK)\lib\public\tier0.lib&quot; &quot;$(HL2SDK)\lib\public\tier1.lib&quot; &quot;$(HL2SDK)\lib\public\vstdlib.lib&quot; &quot;$(HL2SDK)\lib\public\mathlib.lib&quot;"
    4.36 +				OutputFile="$(OutDir)\regex.ext.dll"
    4.37 +				LinkIncremental="1"
    4.38 +				IgnoreDefaultLibraryNames="LIBCMT"
    4.39 +				GenerateDebugInformation="true"
    4.40 +				SubSystem="2"
    4.41 +				OptimizeReferences="2"
    4.42 +				EnableCOMDATFolding="2"
    4.43 +				TargetMachine="1"
    4.44 +			/>
    4.45 +			<Tool
    4.46 +				Name="VCALinkTool"
    4.47 +			/>
    4.48 +			<Tool
    4.49 +				Name="VCManifestTool"
    4.50 +			/>
    4.51 +			<Tool
    4.52 +				Name="VCXDCMakeTool"
    4.53 +			/>
    4.54 +			<Tool
    4.55 +				Name="VCBscMakeTool"
    4.56 +			/>
    4.57 +			<Tool
    4.58 +				Name="VCFxCopTool"
    4.59 +			/>
    4.60 +			<Tool
    4.61 +				Name="VCAppVerifierTool"
    4.62 +			/>
    4.63 +			<Tool
    4.64 +				Name="VCWebDeploymentTool"
    4.65 +			/>
    4.66 +			<Tool
    4.67 +				Name="VCPostBuildEventTool"
    4.68 +			/>
    4.69 +		</Configuration>
    4.70 +		<Configuration
    4.71 +			Name="Debug - Orange Box|Win32"
    4.72 +			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
    4.73 +			IntermediateDirectory="$(ConfigurationName)"
    4.74 +			ConfigurationType="2"
    4.75 +			CharacterSet="2"
    4.76 +			>
    4.77 +			<Tool
    4.78 +				Name="VCPreBuildEventTool"
    4.79 +			/>
    4.80 +			<Tool
    4.81 +				Name="VCCustomBuildTool"
    4.82 +			/>
    4.83 +			<Tool
    4.84 +				Name="VCXMLDataGeneratorTool"
    4.85 +			/>
    4.86 +			<Tool
    4.87 +				Name="VCWebServiceProxyGeneratorTool"
    4.88 +			/>
    4.89 +			<Tool
    4.90 +				Name="VCMIDLTool"
    4.91 +			/>
    4.92 +			<Tool
    4.93 +				Name="VCCLCompilerTool"
    4.94 +				Optimization="0"
    4.95 +				AdditionalIncludeDirectories="..\;..\sdk;..\..;..\systems;..\..\..\public;..\..\..\public\sourcepawn;&quot;$(SOURCEMM16)&quot;;&quot;$(SOURCEMM16)\sourcemm&quot;;&quot;$(SOURCEMM16)\sourcehook&quot;;&quot;$(HL2SDKOB)\public\tier1&quot;;&quot;$(HL2SDKOB)\public&quot;;&quot;$(HL2SDKOB)\public\engine&quot;;&quot;$(HL2SDKOB)\public\game\server&quot;;&quot;$(HL2SDKOB)\public\mathlib&quot;;&quot;$(HL2SDKOB)\public\tier0&quot;;&quot;$(HL2SDKOB)\public\tier1&quot;;&quot;$(HL2SDKOB)\public\vstdlib&quot;;&quot;$(HL2SDKOB)\tier1&quot;;"
    4.96 +				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
    4.97 +				MinimalRebuild="true"
    4.98 +				BasicRuntimeChecks="3"
    4.99 +				RuntimeLibrary="1"
   4.100 +				EnableEnhancedInstructionSet="1"
   4.101 +				RuntimeTypeInfo="false"
   4.102 +				UsePrecompiledHeader="0"
   4.103 +				WarningLevel="3"
   4.104 +				Detect64BitPortabilityProblems="false"
   4.105 +				DebugInformationFormat="4"
   4.106 +			/>
   4.107 +			<Tool
   4.108 +				Name="VCManagedResourceCompilerTool"
   4.109 +			/>
   4.110 +			<Tool
   4.111 +				Name="VCResourceCompilerTool"
   4.112 +			/>
   4.113 +			<Tool
   4.114 +				Name="VCPreLinkEventTool"
   4.115 +			/>
   4.116 +			<Tool
   4.117 +				Name="VCLinkerTool"
   4.118 +				IgnoreImportLibrary="false"
   4.119 +				AdditionalDependencies="..\lib_win\pcre.lib &quot;$(HL2SDKOB)\lib\public\tier0.lib&quot; &quot;$(HL2SDKOB)\lib\public\tier1.lib&quot; &quot;$(HL2SDKOB)\lib\public\vstdlib.lib&quot; &quot;$(HL2SDKOB)\lib\public\mathlib.lib&quot;"
   4.120 +				OutputFile="$(OutDir)\regex.ext.dll"
   4.121 +				LinkIncremental="2"
   4.122 +				IgnoreDefaultLibraryNames="LIBCMTD"
   4.123 +				GenerateDebugInformation="true"
   4.124 +				SubSystem="2"
   4.125 +				OptimizeReferences="0"
   4.126 +				EnableCOMDATFolding="0"
   4.127 +				ImportLibrary="$(OutDir)/sdk.lib"
   4.128 +				TargetMachine="1"
   4.129 +			/>
   4.130 +			<Tool
   4.131 +				Name="VCALinkTool"
   4.132 +			/>
   4.133 +			<Tool
   4.134 +				Name="VCManifestTool"
   4.135 +			/>
   4.136 +			<Tool
   4.137 +				Name="VCXDCMakeTool"
   4.138 +			/>
   4.139 +			<Tool
   4.140 +				Name="VCBscMakeTool"
   4.141 +			/>
   4.142 +			<Tool
   4.143 +				Name="VCFxCopTool"
   4.144 +			/>
   4.145 +			<Tool
   4.146 +				Name="VCAppVerifierTool"
   4.147 +			/>
   4.148 +			<Tool
   4.149 +				Name="VCWebDeploymentTool"
   4.150 +			/>
   4.151 +			<Tool
   4.152 +				Name="VCPostBuildEventTool"
   4.153 +			/>
   4.154 +		</Configuration>
   4.155 +		<Configuration
   4.156 +			Name="Release - Orange Box|Win32"
   4.157 +			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
   4.158 +			IntermediateDirectory="$(ConfigurationName)"
   4.159 +			ConfigurationType="2"
   4.160 +			CharacterSet="2"
   4.161 +			WholeProgramOptimization="1"
   4.162 +			>
   4.163 +			<Tool
   4.164 +				Name="VCPreBuildEventTool"
   4.165 +			/>
   4.166 +			<Tool
   4.167 +				Name="VCCustomBuildTool"
   4.168 +			/>
   4.169 +			<Tool
   4.170 +				Name="VCXMLDataGeneratorTool"
   4.171 +			/>
   4.172 +			<Tool
   4.173 +				Name="VCWebServiceProxyGeneratorTool"
   4.174 +			/>
   4.175 +			<Tool
   4.176 +				Name="VCMIDLTool"
   4.177 +			/>
   4.178 +			<Tool
   4.179 +				Name="VCCLCompilerTool"
   4.180 +				FavorSizeOrSpeed="1"
   4.181 +				AdditionalIncludeDirectories="..\;..\sdk;..\..;..\systems;..\..\..\public;..\..\..\public\sourcepawn;&quot;$(SOURCEMM16)&quot;;&quot;$(SOURCEMM16)\sourcemm&quot;;&quot;$(SOURCEMM16)\sourcehook&quot;;&quot;$(HL2SDKOB)\public\tier1&quot;;&quot;$(HL2SDKOB)\public&quot;;&quot;$(HL2SDKOB)\public\engine&quot;;&quot;$(HL2SDKOB)\public\game\server&quot;;&quot;$(HL2SDKOB)\public\mathlib&quot;;&quot;$(HL2SDKOB)\public\tier0&quot;;&quot;$(HL2SDKOB)\public\tier1&quot;;&quot;$(HL2SDKOB)\public\vstdlib&quot;;&quot;$(HL2SDKOB)\tier1&quot;;"
   4.182 +				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SDK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;SOURCEMOD_BUILD"
   4.183 +				RuntimeLibrary="0"
   4.184 +				EnableEnhancedInstructionSet="1"
   4.185 +				RuntimeTypeInfo="false"
   4.186 +				UsePrecompiledHeader="0"
   4.187 +				WarningLevel="3"
   4.188 +				Detect64BitPortabilityProblems="false"
   4.189 +				DebugInformationFormat="3"
   4.190 +			/>
   4.191 +			<Tool
   4.192 +				Name="VCManagedResourceCompilerTool"
   4.193 +			/>
   4.194 +			<Tool
   4.195 +				Name="VCResourceCompilerTool"
   4.196 +			/>
   4.197 +			<Tool
   4.198 +				Name="VCPreLinkEventTool"
   4.199 +			/>
   4.200 +			<Tool
   4.201 +				Name="VCLinkerTool"
   4.202 +				AdditionalDependencies="..\lib_win\pcre.lib &quot;$(HL2SDKOB)\lib\public\tier0.lib&quot; &quot;$(HL2SDKOB)\lib\public\tier1.lib&quot; &quot;$(HL2SDKOB)\lib\public\vstdlib.lib&quot; &quot;$(HL2SDKOB)\lib\public\mathlib.lib&quot;"
   4.203 +				OutputFile="$(OutDir)\regex.ext.dll"
   4.204  				LinkIncremental="1"
   4.205  				IgnoreDefaultLibraryNames="LIBCMT"
   4.206  				GenerateDebugInformation="true"