mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-15 02:37:55 +00:00
- Perform some housekeeping on scalar math function code - Import ARM's Optimized Routines for SIMD string processing - Upgrade to latest Chromium zlib and enable more SIMD optimizations
29 lines
1.1 KiB
C
29 lines
1.1 KiB
C
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│
|
|
│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│
|
|
╚─────────────────────────────────────────────────────────────────────────────*/
|
|
/* gzclose.c -- zlib gzclose() function
|
|
* Copyright (C) 2004, 2010 Mark Adler
|
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
|
*/
|
|
#include "third_party/zlib/gz/gzguts.inc"
|
|
#include "third_party/zlib/macros.internal.h"
|
|
// clang-format off
|
|
|
|
/* gzclose() is in a separate file so that it is linked in only if it is used.
|
|
That way the other gzclose functions can be used instead to avoid linking in
|
|
unneeded compression or decompression routines. */
|
|
int ZEXPORT gzclose(file)
|
|
gzFile file;
|
|
{
|
|
#ifndef NO_GZCOMPRESS
|
|
gz_statep state;
|
|
|
|
if (file == NULL)
|
|
return Z_STREAM_ERROR;
|
|
state = (gz_statep)file;
|
|
|
|
return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file);
|
|
#else
|
|
return gzclose_r(file);
|
|
#endif
|
|
}
|