apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject cvs commit: apr configure.in
Date Sun, 07 Mar 2004 20:31:31 GMT
jorton      2004/03/07 12:31:31

  Modified:    .        Tag: APR_0_9_BRANCH configure.in
  Log:
  * configure.in: Define apr_off_t as long on 32-bit systems with a
  32-bit off_t, rather than as int, and as off_t everywhere else, for
  simplicity and to preserve ABI compatibility of C++ libraries which
  make use apr_off_t in interfaces.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.535.2.7 +21 -11    apr/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/apr/configure.in,v
  retrieving revision 1.535.2.6
  retrieving revision 1.535.2.7
  diff -w -d -u -r1.535.2.6 -r1.535.2.7
  --- configure.in	22 Feb 2004 12:41:38 -0000	1.535.2.6
  +++ configure.in	7 Mar 2004 20:31:31 -0000	1.535.2.7
  @@ -1177,19 +1177,29 @@
   
   if test "$ac_cv_type_off_t" = "yes"; then
       APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], off_t, 8)
  -    if test "$ac_cv_sizeof_off_t" = "2"; then
  -        off_t_value='apr_int16_t'
  -        off_t_fmt='#define APR_OFF_T_FMT APR_INT16_T_FMT'
  -    elif test "$ac_cv_sizeof_off_t" = "4"; then
  -        off_t_value='apr_int32_t'
  +    AC_MSG_CHECKING([which type to use for apr_off_t])
  +    if test "${ac_cv_sizeof_off_t}${ac_cv_sizeof_long}" = "44"; then
  +        # Special case: off_t may change size with _FILE_OFFSET_BITS
  +        # on 32-bit systems with LFS support.  To avoid compatibility
  +        # with other software which may export _FILE_OFFSET_BITS,
  +        # hard-code apr_off_t to long.
  +        off_t_value=long
  +        off_t_fmt='#define APR_OFF_T_FMT "ld"'
  +    else
  +        off_t_value=off_t
  +        # off_t is more commonly a long than an int; prefer that case
  +        # where int and long are the same size.
  +        if test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long"; then
  +            off_t_fmt='#define APR_OFF_T_FMT "ld"'
  +        elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_int"; then
           off_t_fmt='#define APR_OFF_T_FMT "d"'
  -    elif test "$ac_cv_sizeof_off_t" = "8"; then
  -        off_t_value='apr_int64_t'
  +        elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long_long"; then
           off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT'
       else
  -        off_t_value='apr_int64_t'
  -        off_t_fmt='#error Can not determine the proper size for off_t'
  +            AC_ERROR([could not determine the size of off_t])
  +        fi
       fi
  +    AC_MSG_RESULT([$off_t_value])
   else
       off_t_value='apr_int32_t'
       off_t_fmt='#define APR_OFF_T_FMT "d"'
  
  
  

Mime
View raw message