提交 f1da9297 authored 作者: Michael Jerris's avatar Michael Jerris

fix msvc pcre build for pcre 7.9

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13729 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 f71ebf11
...@@ -41,6 +41,10 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -41,6 +41,10 @@ POSSIBILITY OF SUCH DAMAGE.
/* This module contains code for searching the table of Unicode character /* This module contains code for searching the table of Unicode character
properties. */ properties. */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "pcre_internal.h" #include "pcre_internal.h"
#include "ucp.h" /* Category definitions */ #include "ucp.h" /* Category definitions */
......
差异被折叠。
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2005 University of Cambridge Copyright (c) 1997-2008 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
...@@ -38,14 +38,19 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -38,14 +38,19 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
/* This is a freestanding support program to generate a file containing default /* This is a freestanding support program to generate a file containing
character tables for PCRE. The tables are built according to the default C character tables for PCRE. The tables are built according to the current
locale. Now that pcre_maketables is a function visible to the outside world, we locale. Now that pcre_maketables is a function visible to the outside world, we
make use of its code from here in order to be consistent. */ make use of its code from here in order to be consistent. */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <ctype.h> #include <ctype.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <locale.h>
#include "pcre_internal.h" #include "pcre_internal.h"
...@@ -55,38 +60,60 @@ make use of its code from here in order to be consistent. */ ...@@ -55,38 +60,60 @@ make use of its code from here in order to be consistent. */
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
int i;
FILE *f; FILE *f;
const unsigned char *tables = pcre_maketables(); int i = 1;
const unsigned char *base_of_tables = tables; const unsigned char *tables;
const unsigned char *base_of_tables;
/* By default, the default C locale is used rather than what the building user
happens to have set. However, if the -L option is given, set the locale from
the LC_xxx environment variables. */
if (argc != 2) if (argc > 1 && strcmp(argv[1], "-L") == 0)
{
setlocale(LC_ALL, ""); /* Set from environment variables */
i++;
}
if (argc < i + 1)
{ {
fprintf(stderr, "dftables: one filename argument is required\n"); fprintf(stderr, "dftables: one filename argument is required\n");
return 1; return 1;
} }
f = fopen(argv[1], "wb"); tables = pcre_maketables();
base_of_tables = tables;
f = fopen(argv[i], "wb");
if (f == NULL) if (f == NULL)
{ {
fprintf(stderr, "dftables: failed to open %s for writing\n", argv[1]); fprintf(stderr, "dftables: failed to open %s for writing\n", argv[1]);
return 1; return 1;
} }
/* There are two fprintf() calls here, because gcc in pedantic mode complains /* There are several fprintf() calls here, because gcc in pedantic mode
about the very long string otherwise. */ complains about the very long string otherwise. */
fprintf(f, fprintf(f,
"/*************************************************\n" "/*************************************************\n"
"* Perl-Compatible Regular Expressions *\n" "* Perl-Compatible Regular Expressions *\n"
"*************************************************/\n\n" "*************************************************/\n\n"
"/* This file is automatically written by the dftables auxiliary \n" "/* This file was automatically written by the dftables auxiliary\n"
"program. If you edit it by hand, you might like to edit the Makefile to \n" "program. It contains character tables that are used when no external\n"
"prevent its ever being regenerated.\n\n"); "tables are passed to PCRE by the application that calls it. The tables\n"
"are used only for characters whose code values are less than 256.\n\n");
fprintf(f,
"The following #includes are present because without them gcc 4.x may remove\n"
"the array definition from the final binary if PCRE is built into a static\n"
"library and dead code stripping is activated. This leads to link errors.\n"
"Pulling in the header ensures that the array gets flagged as \"someone\n"
"outside this compilation unit might reference this\" and so it will always\n"
"be supplied to the linker. */\n\n"
"#ifdef HAVE_CONFIG_H\n"
"#include \"config.h\"\n"
"#endif\n\n"
"#include \"pcre_internal.h\"\n\n");
fprintf(f, fprintf(f,
"This file contains the default tables for characters with codes less than\n"
"128 (ASCII characters). These tables are used when no external tables are\n"
"passed to PCRE. */\n\n"
"const unsigned char _pcre_default_tables[] = {\n\n" "const unsigned char _pcre_default_tables[] = {\n\n"
"/* This table is a lower casing table. */\n\n"); "/* This table is a lower casing table. */\n\n");
...@@ -162,7 +189,7 @@ if (isprint(i-8)) fprintf(f, " %c -", i-8); ...@@ -162,7 +189,7 @@ if (isprint(i-8)) fprintf(f, " %c -", i-8);
else fprintf(f, "%3d-", i-8); else fprintf(f, "%3d-", i-8);
if (isprint(i-1)) fprintf(f, " %c ", i-1); if (isprint(i-1)) fprintf(f, " %c ", i-1);
else fprintf(f, "%3d", i-1); else fprintf(f, "%3d", i-1);
fprintf(f, " */\n\n/* End of chartables.c */\n"); fprintf(f, " */\n\n/* End of pcre_chartables.c */\n");
fclose(f); fclose(f);
free((void *)base_of_tables); free((void *)base_of_tables);
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\..\pcre\" AdditionalIncludeDirectories="..\..\pcre\"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;HAVE_CONFIG_H"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="2" RuntimeLibrary="2"
...@@ -97,12 +97,11 @@ ...@@ -97,12 +97,11 @@
/> />
</Configuration> </Configuration>
<Configuration <Configuration
Name="Release|Win32" Name="Debug|x64"
OutputDirectory="$(ConfigurationName)" OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1" ConfigurationType="1"
CharacterSet="1" CharacterSet="1"
WholeProgramOptimization="1"
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
...@@ -119,11 +118,15 @@ ...@@ -119,11 +118,15 @@
/> />
<Tool <Tool
Name="VCMIDLTool" Name="VCMIDLTool"
TargetEnvironment="3"
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\pcre\" AdditionalIncludeDirectories="..\..\pcre\"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;HAVE_CONFIG_H"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="2" RuntimeLibrary="2"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
...@@ -141,14 +144,12 @@ ...@@ -141,14 +144,12 @@
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
OutputFile="$(OutDir)\dftables.exe" OutputFile="$(OutDir)\dftables.exe"
LinkIncremental="1" LinkIncremental="2"
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="1" SubSystem="1"
OptimizeReferences="2" RandomizedBaseAddress="1"
EnableCOMDATFolding="2"
RandomizedBaseAddress="2"
DataExecutionPrevention="0" DataExecutionPrevention="0"
TargetMachine="1" TargetMachine="17"
/> />
<Tool <Tool
Name="VCALinkTool" Name="VCALinkTool"
...@@ -174,11 +175,12 @@ ...@@ -174,11 +175,12 @@
/> />
</Configuration> </Configuration>
<Configuration <Configuration
Name="Debug|x64" Name="Release|Win32"
OutputDirectory="$(PlatformName)\$(ConfigurationName)" OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1" ConfigurationType="1"
CharacterSet="1" CharacterSet="1"
WholeProgramOptimization="1"
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
...@@ -195,15 +197,11 @@ ...@@ -195,15 +197,11 @@
/> />
<Tool <Tool
Name="VCMIDLTool" Name="VCMIDLTool"
TargetEnvironment="3"
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\pcre\" AdditionalIncludeDirectories="..\..\pcre\"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;HAVE_CONFIG_H"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="2" RuntimeLibrary="2"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
...@@ -221,12 +219,14 @@ ...@@ -221,12 +219,14 @@
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
OutputFile="$(OutDir)\dftables.exe" OutputFile="$(OutDir)\dftables.exe"
LinkIncremental="2" LinkIncremental="1"
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="1" SubSystem="1"
RandomizedBaseAddress="1" OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="2"
DataExecutionPrevention="0" DataExecutionPrevention="0"
TargetMachine="17" TargetMachine="1"
/> />
<Tool <Tool
Name="VCALinkTool" Name="VCALinkTool"
...@@ -279,7 +279,7 @@ ...@@ -279,7 +279,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\pcre\" AdditionalIncludeDirectories="..\..\pcre\"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;HAVE_CONFIG_H"
RuntimeLibrary="2" RuntimeLibrary="2"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\..\pcre\" AdditionalIncludeDirectories="..\..\pcre\"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;HAVE_CONFIG_H"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="3"
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\pcre\" AdditionalIncludeDirectories="..\..\pcre\"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;HAVE_CONFIG_H"
RuntimeLibrary="2" RuntimeLibrary="2"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论