On Tue, Jan 27, 2004 at 10:32:20AM -0500, Greg Hudson wrote: > There is a new idea afloat, incidentally: rather than fix apr_off_t at > 64 bits, fix apr_off_t at the size off_t has at configuration time. > (There appears to be no off32_t, so that would have to be apr_int32_t on > most 32-bit platforms.) That doesn't get large-file support, but it > does make apr_off_t independent of _FILE_OFFSET_BITS, and it doesn't > cause an ABI change.
Attached is an implementation of this idea. The idea was originally suggested by Tobias Ringström in: http://marc.theaimsgroup.com/?l=subversion-dev&m=107490548803069&w=2 This also removes some cruft that appears to have been added because sizeof(int) == sizeof(long) on some platforms. Which this patch happily avoids altogether for us. :) -- Ben Reser <[EMAIL PROTECTED]> http://ben.reser.org "Conscience is the inner voice which warns us somebody may be looking." - H.L. Mencken
Index: configure.in =================================================================== RCS file: /home/cvspublic/apr/configure.in,v retrieving revision 1.566 diff -u -r1.566 configure.in --- configure.in 26 Jan 2004 15:44:28 -0000 1.566 +++ configure.in 28 Jan 2004 03:11:36 -0000 @@ -1108,11 +1108,6 @@ stdint=0 fi -if test "$ac_cv_type_off_t" = "yes"; then - off_t_value="off_t" -else - off_t_value="apr_int32_t" -fi if test "$ac_cv_type_size_t" = "yes"; then size_t_value="size_t" else @@ -1149,16 +1144,24 @@ size_t_fmt='#error Can not determine the proper size for size_t' fi -APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], off_t, 8) - -if 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" = "$ac_cv_sizeof_long"; then - off_t_fmt='#define APR_OFF_T_FMT "ld"' -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' +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' + off_t_fmt='#define APR_OFF_T_FMT APR_INT32_T_FMT' + elif test "$ac_cv_sizeof_off_t" = "8"; then + off_t_value='apr_int64_t' + 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' + fi else - off_t_fmt='#error Can not determine the proper size for off_t' + off_t_value='apr_int32_t' + off_t_fmt='#define APR_OFF_T_FMT APR_INT32_T_FMT' fi APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], pid_t, 8) @@ -1192,7 +1195,6 @@ size_t_fmt='#define APR_SIZE_T_FMT "ld"' ;; *os2_emx) - off_t_fmt='#define APR_OFF_T_FMT "ld"' size_t_fmt='#define APR_SIZE_T_FMT "lu"' ;; *-solaris*) @@ -1211,16 +1213,6 @@ size_t_fmt='#define APR_SIZE_T_FMT "lu"' ;; esac - -# Override format string for off_t more carefully: only use hard-coded -# choice if using a 32-bit off_t on platforms which support LFS. -if test "$ac_cv_sizeof_off_t" = "4"; then - case $host in - *linux*|*-solaris*|*aix[[45]]*) - off_t_fmt='#define APR_OFF_T_FMT "ld"' - ;; - esac -fi AC_SUBST(voidp_size) AC_SUBST(short_value)