Check for zlib.h in addition to libz.
This commit is contained in:
@@ -76,7 +76,7 @@
|
||||
#ifdef HAVE_REGCOMP
|
||||
# include <regex.h>
|
||||
#endif
|
||||
#ifdef HAVE_ZLIB
|
||||
#ifdef HAVE_ZLIB_H
|
||||
# include <zlib.h>
|
||||
#endif
|
||||
#include <signal.h>
|
||||
@@ -107,7 +107,7 @@ extern int optind;
|
||||
|
||||
union io_fd {
|
||||
FILE *f;
|
||||
#ifdef HAVE_ZLIB
|
||||
#ifdef HAVE_ZLIB_H
|
||||
gzFile g;
|
||||
#endif
|
||||
void *v;
|
||||
@@ -337,7 +337,7 @@ main(int argc, char *argv[])
|
||||
/*
|
||||
* Timing file consists of line of the format: "%f %d\n"
|
||||
*/
|
||||
#ifdef HAVE_ZLIB
|
||||
#ifdef HAVE_ZLIB_H
|
||||
while (gzgets(io_fds[IOFD_TIMING].g, buf, sizeof(buf)) != NULL) {
|
||||
#else
|
||||
while (fgets(buf, sizeof(buf), io_fds[IOFD_TIMING].f) != NULL) {
|
||||
@@ -379,7 +379,7 @@ main(int argc, char *argv[])
|
||||
len = sizeof(buf);
|
||||
else
|
||||
len = nbytes;
|
||||
#ifdef HAVE_ZLIB
|
||||
#ifdef HAVE_ZLIB_H
|
||||
nread = gzread(io_fds[idx].g, buf, len);
|
||||
#else
|
||||
nread = fread(buf, 1, len, io_fds[idx].f);
|
||||
@@ -439,7 +439,7 @@ open_io_fd(char *path, int len, const char *suffix)
|
||||
path[len] = '\0';
|
||||
strlcat(path, suffix, PATH_MAX);
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
#ifdef HAVE_ZLIB_H
|
||||
return gzopen(path, "r");
|
||||
#else
|
||||
return fopen(path, "r");
|
||||
|
Reference in New Issue
Block a user