# HG changeset patch # User Timo Sirainen # Date 1137945228 -7200 # Node ID 49a1a979959e1abc372beae9ad7d8c6f829c6e4c # Parent 0c863c21025c8e9d403e216ffc420afa3a0732a7 If uoff_t type already exists, use it (UnixWare has it). diff -r 0c863c21025c -r 49a1a979959e configure.in --- a/configure.in Sun Jan 22 17:50:07 2006 +0200 +++ b/configure.in Sun Jan 22 17:53:48 2006 +0200 @@ -589,30 +589,36 @@ AC_DEFINE_UNQUOTED(_FILE_OFFSET_BITS, $preferred_off_t_bits, [If set to 64, enables 64bit off_t for some systems (eg. Linux, Solaris)]) -AC_TYPEOF(off_t, long int long-long) -case "$typeof_off_t" in - int) - offt_max=INT_MAX - uofft_fmt="u" - AC_DEFINE(UOFF_T_INT,, Define if off_t is int) - offt_bits=`expr 8 \* $ac_cv_sizeof_int` - ;; - long) - offt_max=LONG_MAX - uofft_fmt="lu" - AC_DEFINE(UOFF_T_LONG,, Define if off_t is long) - offt_bits=`expr 8 \* $ac_cv_sizeof_long` - ;; - "long long") - offt_max=LLONG_MAX - uofft_fmt="llu" - AC_DEFINE(UOFF_T_LONG_LONG,, Define if off_t is long long) - offt_bits=`expr 8 \* $ac_cv_sizeof_long_long` - ;; - *) - AC_MSG_ERROR([Unsupported off_t type]) - ;; -esac +AC_CHECK_TYPES(_Bool) + +AC_CHECK_TYPE(uoff_t, [ + AC_DEFINE(HAVE_UOFF_T,, Define if you have a native uoff_t type) +], [ + AC_TYPEOF(off_t, long int long-long) + case "$typeof_off_t" in + int) + offt_max=INT_MAX + uofft_fmt="u" + AC_DEFINE(UOFF_T_INT,, Define if off_t is int) + offt_bits=`expr 8 \* $ac_cv_sizeof_int` + ;; + long) + offt_max=LONG_MAX + uofft_fmt="lu" + AC_DEFINE(UOFF_T_LONG,, Define if off_t is long) + offt_bits=`expr 8 \* $ac_cv_sizeof_long` + ;; + "long long") + offt_max=LLONG_MAX + uofft_fmt="llu" + AC_DEFINE(UOFF_T_LONG_LONG,, Define if off_t is long long) + offt_bits=`expr 8 \* $ac_cv_sizeof_long_long` + ;; + *) + AC_MSG_ERROR([Unsupported off_t type]) + ;; + esac +]) dnl * Do we have struct dirent->d_type AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ @@ -724,8 +730,6 @@ AC_DEFINE(HAVE_SOCKLEN_T,, Define to 'int' if you don't have socklen_t) fi -AC_CHECK_TYPES(_Bool) - AC_DEFINE_UNQUOTED(MEM_ALIGN_SIZE, $mem_align, Required memory alignment) dnl * find random source diff -r 0c863c21025c -r 49a1a979959e src/lib/compat.h --- a/src/lib/compat.h Sun Jan 22 17:50:07 2006 +0200 +++ b/src/lib/compat.h Sun Jan 22 17:53:48 2006 +0200 @@ -19,7 +19,9 @@ #endif #endif -#if defined (UOFF_T_INT) +#if defined (HAVE_UOFF_T) +/* native support */ +#elif defined (UOFF_T_INT) typedef unsigned int uoff_t; #elif defined (UOFF_T_LONG) typedef unsigned long uoff_t;