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.
This commit is contained in:
16
configure
vendored
16
configure
vendored
@@ -367,6 +367,21 @@ EOF
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo >> configure.log
|
||||||
|
|
||||||
|
cat > $test.c <<EOF
|
||||||
|
#include <string.h>
|
||||||
|
#include <errno.h>
|
||||||
|
int main() { return strlen(strerror(errno)); }
|
||||||
|
EOF
|
||||||
|
if try $CC $CFLAGS -o $test $test.c; then
|
||||||
|
echo "Checking for strerror... Yes." | tee -a configure.log
|
||||||
|
else
|
||||||
|
CFLAGS="${CFLAGS} -DNO_STRERROR"
|
||||||
|
SFLAGS="${SFLAGS} -DNO_STRERROR"
|
||||||
|
echo "Checking for strerror... No." | tee -a configure.log
|
||||||
|
fi
|
||||||
|
|
||||||
cp -p zconf.h.in zconf.h
|
cp -p zconf.h.in zconf.h
|
||||||
|
|
||||||
echo >> configure.log
|
echo >> configure.log
|
||||||
@@ -435,7 +450,6 @@ int main()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if try $CC -c $CFLAGS $test.c; then
|
if try $CC -c $CFLAGS $test.c; then
|
||||||
echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()." | tee -a configure.log
|
echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()." | tee -a configure.log
|
||||||
|
|
||||||
|
|||||||
2
gzguts.h
2
gzguts.h
@@ -100,7 +100,7 @@
|
|||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
# define zstrerror() gz_strwinerror((DWORD)GetLastError())
|
# define zstrerror() gz_strwinerror((DWORD)GetLastError())
|
||||||
#else
|
#else
|
||||||
# ifdef STDC
|
# ifndef NO_STRERROR
|
||||||
# include <errno.h>
|
# include <errno.h>
|
||||||
# define zstrerror() strerror(errno)
|
# define zstrerror() strerror(errno)
|
||||||
# else
|
# else
|
||||||
|
|||||||
Reference in New Issue
Block a user