diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2010-01-05 17:44:57 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2010-01-05 17:44:57 +0000 |
commit | d93627b2961938679366bd402b51ac39c180f417 (patch) | |
tree | e9c3021fc9f497389051b3107c218674e284f36c | |
parent | 3fac64a4495bb8d0111a28b3d80a9990e20ced19 (diff) | |
download | pcre-d93627b2961938679366bd402b51ac39c180f417.tar.gz |
Fix HP compile problem for pcrecpp.cc.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@486 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r-- | ChangeLog | 45 | ||||
-rw-r--r-- | configure.ac | 63 | ||||
-rw-r--r-- | pcrecpp.cc | 4 |
3 files changed, 73 insertions, 39 deletions
@@ -1,7 +1,7 @@ ChangeLog for PCRE ------------------ -Version 8.01 11-Dec-09 +Version 8.01 06-Jan-10 ---------------------- 1. If a pattern contained a conditional subpattern with only one branch (in @@ -67,46 +67,51 @@ Version 8.01 11-Dec-09 - The compiler thus generates a "C" signature for the test function. - The linker fails to find the "C" function. - PCRE fails to configure if asked to do so against libbz2. - + 11. When running libtoolize from libtool-2.2.6b as part of autogen.sh, these messages were output: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and rerunning libtoolize, to keep the correct libtool macros in-tree. Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am. - + I have done both of these things. - + 12. Although pcre_dfa_exec() does not use nearly as much stack as pcre_exec() - most of the time, it *can* run out if it is given a pattern that contains a - runaway infinite recursion. I updated the discussion in the pcrestack man - page. - -13. Now that we have gone to the x.xx style of version numbers, the minor - version may start with zero. Using 08 or 09 is a bad idea because users - might check the value of PCRE_MINOR in their code, and 08 or 09 may be - interpreted as invalid octal numbers. I've updated the previous comment in - configure.ac, and also added a check that gives an error if 08 or 09 are + most of the time, it *can* run out if it is given a pattern that contains a + runaway infinite recursion. I updated the discussion in the pcrestack man + page. + +13. Now that we have gone to the x.xx style of version numbers, the minor + version may start with zero. Using 08 or 09 is a bad idea because users + might check the value of PCRE_MINOR in their code, and 08 or 09 may be + interpreted as invalid octal numbers. I've updated the previous comment in + configure.ac, and also added a check that gives an error if 08 or 09 are used. - + 14. Change 8.00/11 was not quite complete: code had been accidentally omitted, causing partial matching to fail when the end of the subject matched \W in a UTF-8 pattern where \W was quantified with a minimum of 3. - + 15. There were some discrepancies between the declarations in pcre_internal.h - of _pcre_is_newline(), _pcre_was_newline(), and _pcre_valid_utf8() and + of _pcre_is_newline(), _pcre_was_newline(), and _pcre_valid_utf8() and their definitions. The declarations used "const uschar *" and the definitions used USPTR. Even though USPTR is normally defined as "const unsigned char *" (and uschar is typedeffed as "unsigned char"), it was reported that: "This difference in casting confuses some C++ compilers, for example, SunCC recognizes above declarations as different functions and - generates broken code for hbpcre." I have changed the declarations to use + generates broken code for hbpcre." I have changed the declarations to use USPTR. - -16. GNU libtool is named differently on some systems. The autogen.sh script now + +16. GNU libtool is named differently on some systems. The autogen.sh script now tries several variants such as glibtoolize (MacOSX) and libtoolize1x (FreeBSD). - + +17. Applied Craig's patch that fixes an HP aCC compile error in pcre 8.00 + (strtoXX undefined when compiling pcrecpp.cc). The patch contains this + comment: "Figure out how to create a longlong from a string: strtoll and + equivalent. It's not enough to call AC_CHECK_FUNCS: hpux has a strtoll, for + instance, but it only takes 2 args instead of 3!" Version 8.00 19-Oct-09 diff --git a/configure.ac b/configure.ac index c63b492..83d7093 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ dnl be defined as -RC2, for example. For real releases, it should be empty. m4_define(pcre_major, [8]) m4_define(pcre_minor, [01]) m4_define(pcre_prerelease, [-RC1]) -m4_define(pcre_date, [2010-01-02]) +m4_define(pcre_date, [2010-01-06]) # Libtool shared library interface versions (current:revision:age) m4_define(libpcre_version, [0:1:0]) @@ -340,6 +340,49 @@ AC_CHECK_HEADERS(bits/type_traits.h, [pcre_have_bits_type_traits="1"], AC_CHECK_HEADERS(type_traits.h, [pcre_have_type_traits="1"], [pcre_have_type_traits="0"]) +# (This isn't c++-specific, but is only used in pcrecpp.cc, so try this +# in a c++ context. This matters becuase strtoimax is C99 and may not +# be supported by the C++ compiler.) +# Figure out how to create a longlong from a string: strtoll and +# equiv. It's not enough to call AC_CHECK_FUNCS: hpux has a +# strtoll, for instance, but it only takes 2 args instead of 3! +# We have to call AH_TEMPLATE since AC_DEFINE_UNQUOTED below is complex. +AH_TEMPLATE(HAVE_STRTOQ, [Define to 1 if you have `strtoq'.]) +AH_TEMPLATE(HAVE_STRTOLL, [Define to 1 if you have `strtoll'.]) +AH_TEMPLATE(HAVE__STRTOI64, [Define to 1 if you have `_strtoi64'.]) +AH_TEMPLATE(HAVE_STRTOIMAX, [Define to 1 if you have `strtoimax'.]) +have_strto_fn=0 +for fn in srtoq strtoll _strtoi64 strtoimax; do + AC_MSG_CHECKING([for $fn]) + if test "$fn" = strtoimax; then + include=stdint.h + else + include=stdlib.h + fi + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([#include <$include>], + [char* e; return $fn("100", &e, 10)]), + [AC_MSG_RESULT(yes) + AC_DEFINE_UNQUOTED(HAVE_`echo $fn | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`, 1, + [Define to 1 if you have `$fn'.]) + have_strto_fn=1 + break], + [AC_MSG_RESULT(no)]) +done + +if test "$have_strto_fn" = 1; then + AC_CHECK_TYPES([long long], + [pcre_have_long_long="1"], + [pcre_have_long_long="0"]) + AC_CHECK_TYPES([unsigned long long], + [pcre_have_ulong_long="1"], + [pcre_have_ulong_long="0"]) +else + pcre_have_long_long="0" + pcre_have_ulong_long="0" +fi +AC_SUBST(pcre_have_long_long) +AC_SUBST(pcre_have_ulong_long) + AC_LANG_POP fi # Using AC_SUBST eliminates the need to include config.h in a public .h file @@ -355,24 +398,6 @@ AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xy AC_C_CONST AC_TYPE_SIZE_T -pcre_have_strotolonglong=0 -AC_CHECK_FUNCS(strtoq strtoll _strtoi64, [pcre_have_strotolonglong="1"; break]) -# If we can't convert a string to a long long, pretend we don't even -# have a long long. -if test $pcre_have_strotolonglong = "0"; then - pcre_have_long_long="0" - pcre_have_ulong_long="0" -else - AC_CHECK_TYPES([long long], - [pcre_have_long_long="1"], - [pcre_have_long_long="0"]) - AC_CHECK_TYPES([unsigned long long], - [pcre_have_ulong_long="1"], - [pcre_have_ulong_long="0"]) -fi -AC_SUBST(pcre_have_long_long) -AC_SUBST(pcre_have_ulong_long) - # Checks for library functions. AC_CHECK_FUNCS(bcopy memmove strerror) @@ -821,6 +821,8 @@ bool Arg::parse_longlong_radix(const char* str, long long r = strtoll(str, &end, radix); #elif defined HAVE__STRTOI64 long long r = _strtoi64(str, &end, radix); +#elif defined HAVE_STRTOIMAX + long long r = strtoimax(str, &end, radix); #else #error parse_longlong_radix: cannot convert input to a long-long #endif @@ -851,6 +853,8 @@ bool Arg::parse_ulonglong_radix(const char* str, unsigned long long r = strtoull(str, &end, radix); #elif defined HAVE__STRTOI64 unsigned long long r = _strtoui64(str, &end, radix); +#elif defined HAVE_STRTOIMAX + unsigned long long r = strtoumax(str, &end, radix); #else #error parse_ulonglong_radix: cannot convert input to a long-long #endif |