diff options
| author | Mark Adler <madler@alumni.caltech.edu> | 2012-02-18 13:55:09 -0800 |
|---|---|---|
| committer | Mark Adler <madler@alumni.caltech.edu> | 2012-02-18 13:55:09 -0800 |
| commit | 6838df92460eaceaaadd0f13aaea248a6b7c0a1b (patch) | |
| tree | 14d8c840610fb50571cc01ecb6fa502acc0a24ba | |
| parent | d1714a57c59173837fc3d9c027e18ad6a1b6fc52 (diff) | |
| download | zlib-6838df92460eaceaaadd0f13aaea248a6b7c0a1b.tar.gz zlib-6838df92460eaceaaadd0f13aaea248a6b7c0a1b.tar.bz2 zlib-6838df92460eaceaaadd0f13aaea248a6b7c0a1b.zip | |
Test for existence of strerror.
SunOS 4.1 claims that it is __STDC__, but it does not have strerror
in string.h. Instead of using __STDC__, this puts a direct test
for strerror in configure, and uses that information in gzguts.h.
| -rwxr-xr-x | configure | 16 | ||||
| -rw-r--r-- | gzguts.h | 2 |
2 files changed, 16 insertions, 2 deletions
| @@ -367,6 +367,21 @@ EOF | |||
| 367 | fi | 367 | fi |
| 368 | fi | 368 | fi |
| 369 | 369 | ||
| 370 | echo >> configure.log | ||
| 371 | |||
| 372 | cat > $test.c <<EOF | ||
| 373 | #include <string.h> | ||
| 374 | #include <errno.h> | ||
| 375 | int main() { return strlen(strerror(errno)); } | ||
| 376 | EOF | ||
| 377 | if try $CC $CFLAGS -o $test $test.c; then | ||
| 378 | echo "Checking for strerror... Yes." | tee -a configure.log | ||
| 379 | else | ||
| 380 | CFLAGS="${CFLAGS} -DNO_STRERROR" | ||
| 381 | SFLAGS="${SFLAGS} -DNO_STRERROR" | ||
| 382 | echo "Checking for strerror... No." | tee -a configure.log | ||
| 383 | fi | ||
| 384 | |||
| 370 | cp -p zconf.h.in zconf.h | 385 | cp -p zconf.h.in zconf.h |
| 371 | 386 | ||
| 372 | echo >> configure.log | 387 | echo >> configure.log |
| @@ -435,7 +450,6 @@ int main() | |||
| 435 | return 0; | 450 | return 0; |
| 436 | } | 451 | } |
| 437 | EOF | 452 | EOF |
| 438 | |||
| 439 | if try $CC -c $CFLAGS $test.c; then | 453 | if try $CC -c $CFLAGS $test.c; then |
| 440 | echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()." | tee -a configure.log | 454 | echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()." | tee -a configure.log |
| 441 | 455 | ||
| @@ -100,7 +100,7 @@ | |||
| 100 | # include <windows.h> | 100 | # include <windows.h> |
| 101 | # define zstrerror() gz_strwinerror((DWORD)GetLastError()) | 101 | # define zstrerror() gz_strwinerror((DWORD)GetLastError()) |
| 102 | #else | 102 | #else |
| 103 | # ifdef STDC | 103 | # ifndef NO_STRERROR |
| 104 | # include <errno.h> | 104 | # include <errno.h> |
| 105 | # define zstrerror() strerror(errno) | 105 | # define zstrerror() strerror(errno) |
| 106 | # else | 106 | # else |
