Re: [pcre-dev] PCRE 7.6 and HPUX -- no strtoll function

Kezdőlap
Üzenet törlése
Szerző: Craig Silverstein
Dátum:  
Címzett: ph10
CC: zmiller, pcre-dev
Tárgy: Re: [pcre-dev] PCRE 7.6 and HPUX -- no strtoll function
} Philip, ignore my last patch for now. I'll have another one for you
} sometime later.

OK, here it is below. This patch only affects autoconf. I tried
pretending different things on my system, and it seemed to work as
expected. Of course, autoconf is tricky.

craig

--cut here--

Index: configure.ac
===================================================================
--- configure.ac    (revision 319)
+++ configure.ac    (working copy)
@@ -301,18 +301,27 @@
 AC_C_CONST
 AC_TYPE_SIZE_T


-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"])
+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 strtoq strtoll _strtoi64)
+AC_CHECK_FUNCS(bcopy memmove strerror)

# Check for the availability of libz (aka zlib)