diff options
author | Guilherme Andrade <[email protected]> | 2016-08-20 20:59:20 +0100 |
---|---|---|
committer | Guilherme Andrade <[email protected]> | 2016-08-22 13:27:52 +0100 |
commit | 640c988fd41f9709b494554b2e5ef1f06f06957e (patch) | |
tree | 81d1f082fbd9cf17898b4b5661dc8fa62bc7d5a0 /erts/emulator/drivers/common | |
parent | f508378290a8b1cac4f54d9a9d6f1ce61dcad800 (diff) | |
download | otp-640c988fd41f9709b494554b2e5ef1f06f06957e.tar.gz otp-640c988fd41f9709b494554b2e5ef1f06f06957e.tar.bz2 otp-640c988fd41f9709b494554b2e5ef1f06f06957e.zip |
zlib: Only link inflateGetDictionary if available
Which at the moment means zlib versions >= 1.2.8.
Diffstat (limited to 'erts/emulator/drivers/common')
-rw-r--r-- | erts/emulator/drivers/common/zlib_drv.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/erts/emulator/drivers/common/zlib_drv.c b/erts/emulator/drivers/common/zlib_drv.c index acbe675c41..066cf87c9d 100644 --- a/erts/emulator/drivers/common/zlib_drv.c +++ b/erts/emulator/drivers/common/zlib_drv.c @@ -252,6 +252,7 @@ static int zlib_output(ZLibData* d) return zlib_output_init(d); } +#ifdef HAVE_ZLIB_INFLATEGETDICTIONARY static int zlib_inflate_get_dictionary(ZLibData* d) { ErlDrvBinary* dbin = driver_alloc_binary(INFL_DICT_SZ); @@ -263,6 +264,7 @@ static int zlib_inflate_get_dictionary(ZLibData* d) driver_free_binary(dbin); return res; } +#endif static int zlib_inflate(ZLibData* d, int flush) { @@ -603,9 +605,14 @@ static ErlDrvSSizeT zlib_ctl(ErlDrvData drv_data, unsigned int command, char *bu return zlib_return(res, rbuf, rlen); case INFLATE_GETDICT: +#ifdef HAVE_ZLIB_INFLATEGETDICTIONARY if (d->state != ST_INFLATE) goto badarg; res = zlib_inflate_get_dictionary(d); return zlib_return(res, rbuf, rlen); +#else + errno = ENOTSUP; + return zlib_return(Z_ERRNO, rbuf, rlen); +#endif case INFLATE_SYNC: if (d->state != ST_INFLATE) goto badarg; |