aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2016-12-31 10:03:09 -0800
committerMark Adler <madler@alumni.caltech.edu>2016-12-31 10:06:40 -0800
commitcca27e95cf2bf057b2bbea93702135da3ca7be45 (patch)
tree10eac4a38123691dfcfaf6026a7d32a702f9067e /configure
parentb7fbee215674c3399212dffba1e71323056931d9 (diff)
downloadzlib-cca27e95cf2bf057b2bbea93702135da3ca7be45.tar.gz
zlib-cca27e95cf2bf057b2bbea93702135da3ca7be45.tar.bz2
zlib-cca27e95cf2bf057b2bbea93702135da3ca7be45.zip
Avoid the need for ssize_t.
Limit read() and write() requests to sizes that fit in an int. This allows storing the return value in an int, and avoiding the need to use or construct an ssize_t type. This is required for Microsoft C, whose _read and _write functions take an unsigned request and return an int.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure22
1 files changed, 1 insertions, 21 deletions
diff --git a/configure b/configure
index e0c07b7..e974d1f 100755
--- a/configure
+++ b/configure
@@ -465,23 +465,8 @@ fi
465 465
466echo >> configure.log 466echo >> configure.log
467 467
468# check for ssize_t
469cat > $test.c <<EOF
470#include <sys/types.h>
471ssize_t dummy = 0;
472EOF
473if try $CC -c $CFLAGS $test.c; then
474 echo "Checking for ssize_t... Yes." | tee -a configure.log
475 need_ssizet=0
476else
477 echo "Checking for ssize_t... No." | tee -a configure.log
478 need_ssizet=1
479fi
480
481echo >> configure.log
482
483# find the size_t integer type, if needed 468# find the size_t integer type, if needed
484if test $need_sizet -eq 1 -o $need_ssizet -eq 1; then 469if test $need_sizet -eq 1; then
485 cat > $test.c <<EOF 470 cat > $test.c <<EOF
486long long dummy = 0; 471long long dummy = 0;
487EOF 472EOF
@@ -521,11 +506,6 @@ if test $need_sizet -eq 1; then
521 SFLAGS="${SFLAGS} -DNO_SIZE_T=${sizet}" 506 SFLAGS="${SFLAGS} -DNO_SIZE_T=${sizet}"
522fi 507fi
523 508
524if test $need_ssizet -eq 1; then
525 CFLAGS="${CFLAGS} -DNO_SSIZE_T=${sizet}"
526 SFLAGS="${SFLAGS} -DNO_SSIZE_T=${sizet}"
527fi
528
529echo >> configure.log 509echo >> configure.log
530 510
531# check for large file support, and if none, check for fseeko() 511# check for large file support, and if none, check for fseeko()