1c4fc73ebapt/* gzclose.c contains minimal changes required to be compiled with zlibWrapper:
2c4fc73ebapt * - gz_statep was converted to union to work with -Wstrict-aliasing=1      */
3c4fc73ebapt
4c4fc73ebapt/* gzclose.c -- zlib gzclose() function
5c4fc73ebapt * Copyright (C) 2004, 2010 Mark Adler
6c4fc73ebapt * For conditions of distribution and use, see http://www.zlib.net/zlib_license.html
7c4fc73ebapt */
8c4fc73ebapt
9c4fc73ebapt#include "gzguts.h"
10c4fc73ebapt
11c4fc73ebapt/* gzclose() is in a separate file so that it is linked in only if it is used.
12c4fc73ebapt   That way the other gzclose functions can be used instead to avoid linking in
13c4fc73ebapt   unneeded compression or decompression routines. */
14c4fc73ebaptint ZEXPORT gzclose(file)
15c4fc73ebapt    gzFile file;
16c4fc73ebapt{
17c4fc73ebapt#ifndef NO_GZCOMPRESS
18c4fc73ebapt    gz_statep state;
19c4fc73ebapt
20c4fc73ebapt    if (file == NULL)
21c4fc73ebapt        return Z_STREAM_ERROR;
227b12d76cem    state.file = file;
23c4fc73ebapt
24c4fc73ebapt    return state.state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file);
25c4fc73ebapt#else
26c4fc73ebapt    return gzclose_r(file);
27c4fc73ebapt#endif
28c4fc73ebapt}
29