summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorbfriesen <bfriesen>2007-06-26 20:05:33 +0000
committerbfriesen <bfriesen>2007-06-26 20:05:33 +0000
commitc1943a62e9ea0551149e7352855b418487deff9d (patch)
tree6ebe238d1f3761142db3aa1c3980d029a3975a43 /configure.ac
parentbc048291cd0d12be621b9e38e501d937c9294114 (diff)
downloadlibtiff-c1943a62e9ea0551149e7352855b418487deff9d.tar.gz
Added support for a TIFF_PTRDIFF_T type to use when doing pointer arithmetic.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac30
1 files changed, 26 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index fd73004d..57a9e47c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -99,8 +99,6 @@ dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_C_BIGENDIAN
-AC_CHECK_SIZEOF(int)dnl # This one does not seem to be needed any more.
-AC_CHECK_SIZEOF(long)dnl # This one is needed by libtiff/tif_fax3.c
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
@@ -128,8 +126,8 @@ AC_CHECK_SIZEOF(signed long)
# Obtain size of a 'unsigned long' and define as SIZEOF_UNSIGNED_LONG
AC_CHECK_SIZEOF(unsigned long)
-# Obtain size of a 'long long' and define as SIZEOF_SIGNED_LONG_LONG. If
-# 'long long' is not supported then the value defined is zero.
+# Obtain size of a 'long long' and define as SIZEOF_SIGNED_LONG_LONG.
+# If 'long long' is not supported then the value defined is zero.
AC_CHECK_SIZEOF(signed long long)
# Obtain size of a 'unsigned long long' and define as
@@ -137,6 +135,11 @@ AC_CHECK_SIZEOF(signed long long)
# supported then the value defined is zero.
AC_CHECK_SIZEOF(unsigned long long)
+# Obtain the size of an 'unsigned char *' and define as
+# SIZEOF_UNSIGNED_CHAR_P. Result is available in
+# ac_cv_sizeof_unsigned_char_p.
+AC_CHECK_SIZEOF(unsigned char *)
+
AC_MSG_CHECKING(for signed 8-bit type)
INT8_T='signed char'
AC_MSG_RESULT($INT8_T)
@@ -205,6 +208,25 @@ fi
AC_MSG_RESULT($UINT64_T)
AC_DEFINE_UNQUOTED(TIFF_UINT64_T,$UINT64_T,[Unsigned 64-bit type])
+# Determine the type to use for the difference between two pointers.
+# We will default to the POSIX ptrdiff_t if it is available, but will
+# be prepared for the case when it is not.
+PTRDIFF_T='unknown'
+AC_CHECK_TYPE(ptrdiff_t,[PTRDIFF_T=ptrdiff_t])
+if test $PTRDIFF_T = unknown
+then
+ if test $ac_cv_sizeof_signed_long -eq $ac_cv_sizeof_unsigned_char_p
+ then
+ PTRDIFF_T='signed long'
+ elif test $ac_cv_sizeof_signed_long_long -eq $ac_cv_sizeof_unsigned_char_p
+ then
+ PTRDIFF_T='signed long long'
+ fi
+fi
+AC_MSG_CHECKING(for pointer difference type)
+AC_MSG_RESULT($PTRDIFF_T)
+AC_DEFINE_UNQUOTED(TIFF_PTRDIFF_T,$PTRDIFF_T,[Pointer difference type])
+
dnl Some compilers (IBM VisualAge) has these types defined, so check it here:
AC_CHECK_TYPES([int8, int16, int32],,,
[