You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2002/08/03 22:29:54 UTC

cvs commit: apr/strings apr_strings.c

wrowe       2002/08/03 13:29:54

  Modified:    .        configure.in
               include  apr.h.in apr.hnw apr.hw
               strings  apr_strings.c
  Log:
    Out of time and at the end of my config-foo.  This should get us the
    appropriate 64 bit atoi/atol/atoll or signal that the fn is unavailable.
  
    Someone with better config foo than I might want to make both variables
    private and relocate them into apr_private.h (without APR_ decoration.)
  
  Revision  Changes    Path
  1.470     +8 -2      apr/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/apr/configure.in,v
  retrieving revision 1.469
  retrieving revision 1.470
  diff -u -r1.469 -r1.470
  --- configure.in	2 Aug 2002 18:12:03 -0000	1.469
  +++ configure.in	3 Aug 2002 20:29:53 -0000	1.470
  @@ -1028,12 +1028,14 @@
       int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 1'
       int64_value="int"
       long_value=int
  +    int64_strfn="strtoi"
   elif test "$ac_cv_sizeof_long" = "8"; then
       int64_literal='#define APR_INT64_C(val) (val##L)'
       int64_t_fmt='#define APR_INT64_T_FMT "ld"'
       int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 2'
       int64_value="long"
       long_value=long
  +    int64_strfn="strtol"
   elif test "$ac_cv_sizeof_long_long" = "8"; then
       int64_literal='#define APR_INT64_C(val) (val##LL)'
       dnl Linux, Solaris, FreeBSD all support ll with printf.
  @@ -1044,18 +1046,21 @@
       int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 3'
       int64_value="long long"
       long_value="long long"
  +    int64_strfn="strtoll"
   elif test "$ac_cv_sizeof_long_double" = "8"; then
       int64_literal='#define APR_INT64_C(val) (val##LD)'
       int64_t_fmt='#define APR_INT64_T_FMT "Ld"'
       int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 2'
       int64_value="long double"
       long_value="long double"
  +    int64_strfn="strtoll"
   elif test "$ac_cv_sizeof_longlong" = "8"; then
       int64_literal='#define APR_INT64_C(val) (val##LL)'
       int64_t_fmt='#define APR_INT64_T_FMT "qd"'
       int64_t_fmt_len='#define APR_INT64_T_FMT_LEN 2'
       int64_value="__int64"
       long_value="__int64"
  +    int64_strfn="strtoll"
   else
       dnl # int64_literal may be overriden if your compiler thinks you have
       dnl # a 64-bit value but APR does not agree.
  @@ -1210,7 +1215,7 @@
   AC_CHECK_FUNCS(strdup, have_strdup="1", have_strdup="0")
   AC_CHECK_FUNCS(strstr, have_strstr="1", have_strstr="0")
   AC_CHECK_FUNCS(memchr, have_memchr="1", have_memchr="0")
  -AC_CHECK_FUNCS(strtoll, have_strtoll="1", have_strtoll="0")
  +AC_CHECK_FUNCS($int64_strfn, have_int64_strfn="1", have_int64_strfn="0")
   
   AC_SUBST(have_strnicmp)
   AC_SUBST(have_strncasecmp)
  @@ -1219,7 +1224,8 @@
   AC_SUBST(have_strdup)
   AC_SUBST(have_strstr)
   AC_SUBST(have_memchr)
  -AC_SUBST(have_strtoll)
  +AC_SUBST(have_int64_strfn)
  +AC_SUBST(int64_strfn)
   
   dnl #----------------------------- Checking for DSO support
   echo $ac_n "${nl}Checking for DSO...${nl}"
  
  
  
  1.115     +4 -1      apr/include/apr.h.in
  
  Index: apr.h.in
  ===================================================================
  RCS file: /home/cvs/apr/include/apr.h.in,v
  retrieving revision 1.114
  retrieving revision 1.115
  diff -u -r1.114 -r1.115
  --- apr.h.in	24 Jul 2002 20:29:38 -0000	1.114
  +++ apr.h.in	3 Aug 2002 20:29:54 -0000	1.115
  @@ -115,7 +115,6 @@
   #define APR_HAVE_STRNICMP       @have_strnicmp@
   #define APR_HAVE_STRSTR         @have_strstr@
   #define APR_HAVE_MEMCHR         @have_memchr@
  -#define APR_HAVE_STRTOLL        @have_strtoll@
   #define APR_HAVE_STRUCT_RLIMIT  @struct_rlimit@
   #define APR_HAVE_UNION_SEMUN    @have_union_semun@
   
  @@ -265,6 +264,10 @@
   /* And APR_INT64_T_FMT */
   @int64_t_fmt@
   @int64_t_fmt_len@
  +
  +/* Deal with atoi64 variables ... these should move to apr_private.h */
  +#define APR_HAVE_INT64_STRFN  @have_int64_strfn@
  +#define APR_INT64_STRFN	      @int64_strfn@
   
   /* are we going to force the generic atomic operations */
   #define APR_FORCE_ATOMIC_GENERIC @apr_force_atomic_generic@
  
  
  
  1.21      +4 -0      apr/include/apr.hnw
  
  Index: apr.hnw
  ===================================================================
  RCS file: /home/cvs/apr/include/apr.hnw,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- apr.hnw	2 Aug 2002 19:56:08 -0000	1.20
  +++ apr.hnw	3 Aug 2002 20:29:54 -0000	1.21
  @@ -339,6 +339,10 @@
   #define APR_INT64_T_FMT          "l64d"
   #define APR_TIME_T_FMT APR_INT64_T_FMT
   
  +/* Deal with atoi64 variables ... these should move to apr_private.h */
  +/* I don't have the answer, perhaps a NetWare hacker will fill this in? */
  +#define APR_HAVE_INT64_STRFN  0
  +#define APR_INT64_STRFN	      missing
   
   #endif /* APR_H */
   /** @} */
  
  
  
  1.99      +10 -0     apr/include/apr.hw
  
  Index: apr.hw
  ===================================================================
  RCS file: /home/cvs/apr/include/apr.hw,v
  retrieving revision 1.98
  retrieving revision 1.99
  diff -u -r1.98 -r1.99
  --- apr.hw	2 Aug 2002 19:56:08 -0000	1.98
  +++ apr.hw	3 Aug 2002 20:29:54 -0000	1.99
  @@ -414,6 +414,16 @@
   
   #define APR_INT64_T_FMT          "I64d"
   
  +/* Deal with atoi64 variables ... these should move to apr_private.h */
  +/* MSVC 6.0 introduced _strtoui64 */
  +#if _MSC_VER >= 1200
  +#define APR_HAVE_INT64_STRFN  1
  +#define APR_INT64_STRFN	      _strtoui64
  +#else
  +#define APR_HAVE_INT64_STRFN  0
  +#define APR_INT64_STRFN	      undef
  +#endif
  +
   /* Local machine definition for console and log output. */
   #define APR_EOL_STR              "\r\n"
   
  
  
  
  1.34      +4 -4      apr/strings/apr_strings.c
  
  Index: apr_strings.c
  ===================================================================
  RCS file: /home/cvs/apr/strings/apr_strings.c,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- apr_strings.c	3 Aug 2002 19:31:36 -0000	1.33
  +++ apr_strings.c	3 Aug 2002 20:29:54 -0000	1.34
  @@ -235,11 +235,11 @@
   
   APR_DECLARE(apr_int64_t) apr_strtoi64(const char *buf, char **end, int base)
   {
  -#if (APR_HAVE_STRTOLL)
  -    return (apr_int64_t)strtoll(buf, end, base);
  +#if (APR_HAVE_INT64_STRFN)
  +    return APR_INT64_STRFN(buf, end, base);
   #else
  -    /* XXX This Is Absolutely Bogus */
  -    return (apr_int64_t)strtol(buf, end, base);
  +    /* XXX This Is Absolutely Bogus :: REIMPLEMENT! */
  +    return strtol(buf, end, base);
   #endif
   }