Skip to content

Commit

Permalink
Provide APR_SIZEOF_OFF_T.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1836616 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
ylavic committed Jul 25, 2018
1 parent e619092 commit 674aa3b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -1832,6 +1832,7 @@ if test "${ac_cv_sizeof_off_t}${apr_cv_use_lfs64}" = "4yes"; then
off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT'
off_t_value='off64_t'
off_t_strfn='apr_strtoi64'
off_t_size=8
elif test "${ac_cv_sizeof_off_t}x${ac_cv_sizeof_long}" = "4x4"; then
# Special case: off_t may change size with _FILE_OFFSET_BITS
# on 32-bit systems with LFS support. To avoid compatibility
Expand All @@ -1840,8 +1841,10 @@ elif test "${ac_cv_sizeof_off_t}x${ac_cv_sizeof_long}" = "4x4"; then
off_t_value=long
off_t_fmt='#define APR_OFF_T_FMT "ld"'
off_t_strfn='strtol'
off_t_size="$ac_cv_sizeof_long"
elif test "$ac_cv_type_off_t" = "yes"; then
off_t_value=off_t
off_t_size="$ac_cv_sizeof_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
Expand All @@ -1862,16 +1865,19 @@ elif test "$ac_cv_type_off_t" = "yes"; then
off_t_value=apr_int64_t
off_t_fmt='#define APR_OFF_T_FMT "I64d"'
off_t_strfn='_strtoi64'
off_t_size=8
;;
esac
else
# Fallback on int
off_t_value=int
off_t_fmt='#define APR_OFF_T_FMT "d"'
off_t_strfn='strtoi'
off_t_size=4
fi
AC_MSG_RESULT($off_t_value)


# Regardless of whether _LARGEFILE64_SOURCE is used, on some
# platforms _FILE_OFFSET_BITS will affect the size of ino_t and hence
# the build-time ABI may be different from the apparent ABI when using
Expand Down Expand Up @@ -1942,6 +1948,7 @@ AC_SUBST(bigendian)
AC_SUBST(aprlfs)
AC_SUBST(have_iovec)
AC_SUBST(ino_t_value)
AC_SUBST(off_t_size)

dnl ----------------------------- Checking for string functions
AC_CHECK_FUNCS(strnicmp, have_strnicmp="1", have_strnicmp="0")
Expand Down
1 change: 1 addition & 0 deletions include/apr.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ typedef @int_value@ apr_int32_t;
typedef unsigned @int_value@ apr_uint32_t;

#define APR_SIZEOF_VOIDP @voidp_size@
#define APR_SIZEOF_OFF_T @off_t_size@

/*
* Darwin 10's default compiler (gcc42) builds for both 64 and
Expand Down

0 comments on commit 674aa3b

Please sign in to comment.