diff options
author | Nathan Moinvaziri <nathan@nathanm.com> | 2020-09-13 21:58:57 -0700 |
---|---|---|
committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2020-09-16 09:10:28 +0200 |
commit | 601a99764444dcd4cb85dc828a3821fdaff444ec (patch) | |
tree | 7ae70190d7454b114a7171784737577775227486 /gzlib.c | |
parent | febeec521859b908e34208cf6f6ff29df2cbf4b9 (diff) |
Move gzclose() to gzlib.c. Modern linkers should be smart enough to link it in only if it is used.
Diffstat (limited to 'gzlib.c')
-rw-r--r-- | gzlib.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -242,6 +242,20 @@ gzFile Z_EXPORT PREFIX(gzopen_w)(const wchar_t *path, const char *mode) { } #endif +int Z_EXPORT PREFIX(gzclose)(gzFile file) { +#ifndef NO_GZCOMPRESS + gz_state *state; + + if (file == NULL) + return Z_STREAM_ERROR; + state = (gz_state *)file; + + return state->mode == GZ_READ ? PREFIX(gzclose_r)(file) : PREFIX(gzclose_w)(file); +#else + return PREFIX(gzclose_r)(file); +#endif +} + /* -- see zlib.h -- */ int Z_EXPORT PREFIX(gzbuffer)(gzFile file, unsigned size) { gz_state *state; |