diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2016-12-31 10:03:09 -0800 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2016-12-31 10:06:40 -0800 |
commit | cca27e95cf2bf057b2bbea93702135da3ca7be45 (patch) | |
tree | 10eac4a38123691dfcfaf6026a7d32a702f9067e /configure | |
parent | b7fbee215674c3399212dffba1e71323056931d9 (diff) | |
download | zlib-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-x | configure | 22 |
1 files changed, 1 insertions, 21 deletions
@@ -465,23 +465,8 @@ fi | |||
465 | 465 | ||
466 | echo >> configure.log | 466 | echo >> configure.log |
467 | 467 | ||
468 | # check for ssize_t | ||
469 | cat > $test.c <<EOF | ||
470 | #include <sys/types.h> | ||
471 | ssize_t dummy = 0; | ||
472 | EOF | ||
473 | if try $CC -c $CFLAGS $test.c; then | ||
474 | echo "Checking for ssize_t... Yes." | tee -a configure.log | ||
475 | need_ssizet=0 | ||
476 | else | ||
477 | echo "Checking for ssize_t... No." | tee -a configure.log | ||
478 | need_ssizet=1 | ||
479 | fi | ||
480 | |||
481 | echo >> configure.log | ||
482 | |||
483 | # find the size_t integer type, if needed | 468 | # find the size_t integer type, if needed |
484 | if test $need_sizet -eq 1 -o $need_ssizet -eq 1; then | 469 | if test $need_sizet -eq 1; then |
485 | cat > $test.c <<EOF | 470 | cat > $test.c <<EOF |
486 | long long dummy = 0; | 471 | long long dummy = 0; |
487 | EOF | 472 | EOF |
@@ -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}" |
522 | fi | 507 | fi |
523 | 508 | ||
524 | if test $need_ssizet -eq 1; then | ||
525 | CFLAGS="${CFLAGS} -DNO_SSIZE_T=${sizet}" | ||
526 | SFLAGS="${SFLAGS} -DNO_SSIZE_T=${sizet}" | ||
527 | fi | ||
528 | |||
529 | echo >> configure.log | 509 | echo >> 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() |