Commit a607da93 authored by Thomas White's avatar Thomas White
Browse files

Don't use gzbuffer if it's not available

Enables compatability with zlib < 1.2.3.5
parent 6f2ca629
......@@ -16,6 +16,11 @@ set(HAVE_XGANDALF ${XGANDALF_FOUND})
set(HAVE_PINKINDEXER ${PINKINDEXER_FOUND})
set(HAVE_FDIP ${FDIP_FOUND})
# Recent enough version of zlib?
set(CMAKE_REQUIRED_LIBRARIES "-lz")
check_symbol_exists(gzbuffer "zlib.h" HAVE_GZBUFFER)
unset(CMAKE_REQUIRED_LIBRARIES)
# Find out where forkpty() is declared
set(CMAKE_REQUIRED_LIBRARIES "-lutil")
check_symbol_exists(forkpty "pty.h" HAVE_FORKPTY_PTY_H)
......
......@@ -8,6 +8,7 @@
#cmakedefine HAVE_PINKINDEXER
#cmakedefine HAVE_FDIP
#cmakedefine HAVE_CURSES
#cmakedefine HAVE_GZBUFFER
#cmakedefine HAVE_FORKPTY_PTY_H
#cmakedefine HAVE_FORKPTY_UTIL_H
......
......@@ -787,8 +787,10 @@ static float *read_cbf_data(struct imagefile *f, int *w, int *h)
gzfh = gzopen(f->filename, "rb");
if ( gzfh == NULL ) return NULL;
#ifdef HAVE_GZBUFFER
/* Set larger buffer size for hopefully faster uncompression */
gzbuffer(gzfh, 128*1024);
#endif
buf = malloc(bufsz);
if ( buf == NULL ) return NULL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment