make TIFF_SSIZE_T the same bitwidth as TIFF_SIZE_T

it was previously the same bitwidth as unsigned char *
Pointers can be larger than size_t.
This commit is contained in:
Thomas Bernard 2019-02-23 23:58:28 +01:00
parent 69ce2652ef
commit 4d26884a15
No known key found for this signature in database
GPG Key ID: 0FF11B67A5C0863C
3 changed files with 10 additions and 18 deletions

View File

@ -338,29 +338,21 @@ endif()
if(SIZEOF_UNSIGNED_INT EQUAL SIZEOF_SIZE_T)
set(TIFF_SIZE_T "unsigned int")
set(TIFF_SIZE_FORMAT "%u")
set(TIFF_SSIZE_T "signed int")
set(TIFF_SSIZE_FORMAT "%d")
elseif(SIZEOF_UNSIGNED_LONG EQUAL SIZEOF_SIZE_T)
set(TIFF_SIZE_T "unsigned long")
set(TIFF_SIZE_FORMAT "%lu")
elseif(SIZEOF_UNSIGNED_LONG_LONG EQUAL SIZEOF_SIZE_T)
set(TIFF_SIZE_T "unsigned long long")
if (MINGW)
set(TIFF_SIZE_FORMAT "%I64u")
else()
set(TIFF_SIZE_FORMAT "%llu")
endif()
endif()
if(SIZEOF_SIGNED_INT EQUAL SIZEOF_UNSIGNED_CHAR_P)
set(TIFF_SSIZE_T "signed int")
set(TIFF_SSIZE_FORMAT "%d")
elseif(SIZEOF_SIGNED_LONG EQUAL SIZEOF_UNSIGNED_CHAR_P)
set(TIFF_SSIZE_T "signed long")
set(TIFF_SSIZE_FORMAT "%ld")
elseif(SIZEOF_SIGNED_LONG_LONG EQUAL SIZEOF_UNSIGNED_CHAR_P)
elseif(SIZEOF_UNSIGNED_LONG_LONG EQUAL SIZEOF_SIZE_T)
set(TIFF_SIZE_T "unsigned long long")
set(TIFF_SSIZE_T "signed long long")
if (MINGW)
set(TIFF_SIZE_FORMAT "%I64u")
set(TIFF_SSIZE_FORMAT "%I64d")
else()
set(TIFF_SIZE_FORMAT "%llu")
set(TIFF_SSIZE_FORMAT "%lld")
endif()
endif()

View File

@ -365,15 +365,15 @@ AC_DEFINE_UNQUOTED([TIFF_SIZE_FORMAT],[$SIZE_FORMAT],[Size type formatter])
AC_MSG_CHECKING(for signed size type)
SSIZE_T='unknown'
SSIZE_FORMAT='unknown'
if test $ac_cv_sizeof_signed_int -eq $ac_cv_sizeof_unsigned_char_p
if test $ac_cv_sizeof_signed_int -eq $ac_cv_sizeof_size_t
then
SSIZE_T='signed int'
SSIZE_FORMAT='"%d"'
elif test $ac_cv_sizeof_signed_long -eq $ac_cv_sizeof_unsigned_char_p
elif test $ac_cv_sizeof_signed_long -eq $ac_cv_sizeof_size_t
then
SSIZE_T='signed long'
SSIZE_FORMAT='"%ld"'
elif test $ac_cv_sizeof_signed_long_long -eq $ac_cv_sizeof_unsigned_char_p
elif test $ac_cv_sizeof_signed_long_long -eq $ac_cv_sizeof_size_t
then
SSIZE_T='signed long long'
case "${host_os}" in

View File

@ -51,7 +51,7 @@ main()
CHECK_TYPE(TIFF_UINT32_T, 4)
CHECK_TYPE(TIFF_UINT64_T, 8)
CHECK_TYPE(TIFF_SIZE_T, sizeof(size_t))
CHECK_TYPE(TIFF_SSIZE_T, sizeof(unsigned char *))
CHECK_TYPE(TIFF_SSIZE_T, sizeof(size_t))
return 0;
}