Skip to content

Commit 9a868b0

Browse files
authored
Tidy up config.h management (task from README) (#658)
This fortuitously fixes the 16/32-bit 'unity' build. Also tidy up the ckd_smul macros, for the sake of the Unity build.
1 parent 5eb3276 commit 9a868b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+114
-3244
lines changed

CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,6 @@ if(PCRE2_BUILD_PCRE2_16)
885885
set_target_properties(
886886
pcre2-16-static
887887
PROPERTIES
888-
UNITY_BUILD OFF
889888
COMPILE_DEFINITIONS PCRE2_CODE_UNIT_WIDTH=16
890889
MACHO_COMPATIBILITY_VERSION "${LIBPCRE2_32_MACHO_COMPATIBILITY_VERSION}"
891890
MACHO_CURRENT_VERSION "${LIBPCRE2_32_MACHO_CURRENT_VERSION}"
@@ -914,7 +913,6 @@ if(PCRE2_BUILD_PCRE2_16)
914913
set_target_properties(
915914
pcre2-16-shared
916915
PROPERTIES
917-
UNITY_BUILD OFF
918916
COMPILE_DEFINITIONS PCRE2_CODE_UNIT_WIDTH=16
919917
MACHO_COMPATIBILITY_VERSION "${LIBPCRE2_32_MACHO_COMPATIBILITY_VERSION}"
920918
MACHO_CURRENT_VERSION "${LIBPCRE2_32_MACHO_CURRENT_VERSION}"
@@ -955,7 +953,6 @@ if(PCRE2_BUILD_PCRE2_32)
955953
set_target_properties(
956954
pcre2-32-static
957955
PROPERTIES
958-
UNITY_BUILD OFF
959956
COMPILE_DEFINITIONS PCRE2_CODE_UNIT_WIDTH=32
960957
MACHO_COMPATIBILITY_VERSION "${LIBPCRE2_32_MACHO_COMPATIBILITY_VERSION}"
961958
MACHO_CURRENT_VERSION "${LIBPCRE2_32_MACHO_CURRENT_VERSION}"
@@ -984,7 +981,6 @@ if(PCRE2_BUILD_PCRE2_32)
984981
set_target_properties(
985982
pcre2-32-shared
986983
PROPERTIES
987-
UNITY_BUILD OFF
988984
COMPILE_DEFINITIONS PCRE2_CODE_UNIT_WIDTH=32
989985
MACHO_COMPATIBILITY_VERSION "${LIBPCRE2_32_MACHO_COMPATIBILITY_VERSION}"
990986
MACHO_CURRENT_VERSION "${LIBPCRE2_32_MACHO_CURRENT_VERSION}"

Makefile.am

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -778,10 +778,7 @@ EXTRA_DIST += \
778778
testdata/testoutput6 \
779779
testdata/testoutput7 \
780780
testdata/testoutput8-16-2 \
781-
testdata/testoutput8-16-3 \
782781
testdata/testoutput8-16-4 \
783-
testdata/testoutput8-32-2 \
784-
testdata/testoutput8-32-3 \
785782
testdata/testoutput8-32-4 \
786783
testdata/testoutput8-8-2 \
787784
testdata/testoutput8-8-3 \

RunTest

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,11 +667,17 @@ for bmode in "$test8" "$test16" "$test32"; do
667667

668668
if [ $do8 = yes ] ; then
669669
echo $title8
670+
bits_link_size=$link_size
671+
if [ $bits = "16" -a $link_size = "3" ] ; then
672+
bits_link_size=4
673+
elif [ $bits = "32" ] ; then
674+
bits_link_size=4
675+
fi
670676
if [ $utf -eq 0 ] ; then
671677
echo " Skipped because UTF-$bits support is not available"
672678
else
673679
$sim $valgrind $pcre2test -q $setstack $bmode $testdata/testinput8 testtry
674-
checkresult $? 8-$bits-$link_size ""
680+
checkresult $? 8-$bits-$bits_link_size ""
675681
fi
676682
fi
677683

RunTest.bat

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,10 @@ if [%3] == [] (
259259
)
260260

261261
if %1 == 8 (
262-
set outnum=%1-%bits%-%link_size%
262+
set bits_link_size=%link_size%
263+
if %bits% EQU 16 if %link_size% EQU 3 set bits_link_size=4
264+
if %bits% EQU 32 set bits_link_size=4
265+
set outnum=%1-%bits%-!bits_link_size!
263266
) else if %1 == 11 (
264267
set outnum=%1-%bits%
265268
) else if %1 == 12 (

maint/GenerateUcd.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -790,9 +790,6 @@ def write_bitsets(list, item_size):
790790
headers are needed. */
791791
792792
#ifndef PCRE2_PCRE2TEST
793-
#ifdef HAVE_CONFIG_H
794-
#include "config.h"
795-
#endif
796793
#include "pcre2_internal.h"
797794
#endif /* PCRE2_PCRE2TEST */
798795

maint/README

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,6 @@ years.
396396
perhaps be used as a way round this problem. However, note that Perl does not
397397
distinguish: like PCRE2, a name is just an alias for a number in Perl.
398398

399-
. Instead of having #ifdef HAVE_CONFIG_H in each module, put #include
400-
"something" and the the #ifdef appears only in one place, in "something".
401-
402399
. Implement something like (?(R2+)... to check outer recursions.
403400

404401
. If Perl ever supports the POSIX notation [[.something.]] PCRE2 should try

maint/manifest-tarball

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,10 +444,7 @@ drwxr-xr-x tarball-dir/pcre2-SNAPSHOT/testdata
444444
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/testdata/testoutput6
445445
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/testdata/testoutput7
446446
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/testdata/testoutput8-16-2
447-
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/testdata/testoutput8-16-3
448447
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/testdata/testoutput8-16-4
449-
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/testdata/testoutput8-32-2
450-
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/testdata/testoutput8-32-3
451448
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/testdata/testoutput8-32-4
452449
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/testdata/testoutput8-8-2
453450
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/testdata/testoutput8-8-3

maint/pcre2_chartables.c.non-standard

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
#ifdef HAVE_CONFIG_H
2-
#include "config.h"
3-
#endif
4-
51
#include "pcre2_internal.h"
62

73
const uint8_t PRIV(default_tables)[] = {

maint/ucptest.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,6 @@ characters, the list ends with ...
8282
The command "list" must be followed by one of property names script, bool,
8383
type, gbreak or bidi. The defined values for that property are listed. */
8484

85-
86-
#ifdef HAVE_CONFIG_H
87-
#include "../src/config.h"
88-
#endif
89-
9085
#ifndef SUPPORT_UNICODE
9186
#error "Unicode support not enabled"
9287
#endif

src/pcre2_auto_possess.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,14 @@ POSSIBILITY OF SUCH DAMAGE.
3838
-----------------------------------------------------------------------------
3939
*/
4040

41+
4142
/* This module contains functions that scan a compiled pattern and change
4243
repeats into possessive repeats where possible. */
4344

4445

45-
#ifdef HAVE_CONFIG_H
46-
#include "config.h"
47-
#endif
46+
#include "pcre2_internal.h"
4847

4948

50-
#include "pcre2_internal.h"
5149

5250
/* This macro represents the max size of list[] and that is used to keep
5351
track of UCD info in several places, it should be kept on sync with the

0 commit comments

Comments
 (0)