diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2009-08-17 14:48:48 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2009-08-17 14:48:48 +0000 |
commit | 84fde256e93d7a4a8d15ab452c64356a7f246b86 (patch) | |
tree | 48243402bf810358528fdb3d15479a35216ab0e9 /maint | |
parent | 0bd2cca21e2be39f156d5dfb07f0cfbc2ab9ae27 (diff) | |
download | pcre-84fde256e93d7a4a8d15ab452c64356a7f246b86.tar.gz |
Add #ifndef SUPPORT_UCP to pcre_ucd.c
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@425 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'maint')
-rwxr-xr-x | maint/MultiStage2.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/maint/MultiStage2.py b/maint/MultiStage2.py index f1a8e15..2e20039 100755 --- a/maint/MultiStage2.py +++ b/maint/MultiStage2.py @@ -26,6 +26,7 @@ # Adjusted global table names by prefixing _pcre_. # Commented out stuff relating to the casefolding table, which isn't used. # Corrected size calculation +# Add #ifndef SUPPORT_UCP to use dummy tables when no UCP support is needed. # # The tables generated by this script are used by macros defined in # pcre_internal.h. They look up Unicode character properties using short @@ -276,11 +277,28 @@ for block_size in [2 ** i for i in range(5,10)]: print "#ifdef HAVE_CONFIG_H" print "#include \"config.h\"" print "#endif" +print print "#include \"pcre_internal.h\"" print print "/* Unicode character database. */" print "/* This file was autogenerated by the MultiStage2.py script. */" print "/* Total size: %d bytes, block size: %d. */" % (min_size, min_block_size) +print +print "/* The tables herein are needed only when UCP support is built */" +print "/* into PCRE. This module should not be referenced otherwise, so */" +print "/* it should not matter whether it is compiled or not. However */" +print "/* a comment was received about space saving - maybe the guy linked */" +print "/* all the modules rather than using a library - so we include a */" +print "/* condition to cut out the tables when not needed. But don't leave */" +print "/* a totally empty module because some compilers barf at that. */" +print "/* Instead, just supply small dummy tables. */" +print +print "#ifndef SUPPORT_UCP" +print "const ucd_record _pcre_ucd_records[] = {{0,0,0 }};" +print "const uschar _pcre_ucd_stage1[] = {0};" +print "const pcre_uint16 _pcre_ucd_stage2[] = {0};" +print "#else" +print print record_struct print_records(records, record_size) print_table(min_stage1, '_pcre_ucd_stage1') @@ -288,6 +306,7 @@ print_table(min_stage2, '_pcre_ucd_stage2', min_block_size) print "#if UCD_BLOCK_SIZE != %d" % min_block_size print "#error Please correct UCD_BLOCK_SIZE in pcre_internal.h" print "#endif" +print "#endif /* SUPPORT_UCP */" """ |