[Library] Update zlibng (#1255)

* Update zlibng

* Set cmake path more directly in zlibng to hopefully fix an issue with the build on drone

* I'm dumb, missing / in path

* Mackal helps with a dumb gitignore issue

* Adding all the files, not sure what's ignoring them and im tired of looking

* Some tweaks to zlibng build to hopefully get it to build properly. works on msvc now
This commit is contained in:
Alex
2021-02-23 17:00:26 -08:00
committed by GitHub
parent e6dee96266
commit 2957f5084d
184 changed files with 22029 additions and 11703 deletions
+25 -54
View File
@@ -3,47 +3,37 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
#include "zbuild.h"
#include "zutil.h"
#ifdef WITH_GZFILEOP
# include "gzguts.h"
#endif
#ifndef UNALIGNED_OK
# include "malloc.h"
#endif
#include "zutil_p.h"
const char * const z_errmsg[10] = {
(const char *)"need dictionary", /* Z_NEED_DICT 2 */
(const char *)"stream end", /* Z_STREAM_END 1 */
(const char *)"", /* Z_OK 0 */
(const char *)"file error", /* Z_ERRNO (-1) */
(const char *)"stream error", /* Z_STREAM_ERROR (-2) */
(const char *)"data error", /* Z_DATA_ERROR (-3) */
(const char *)"insufficient memory", /* Z_MEM_ERROR (-4) */
(const char *)"buffer error", /* Z_BUF_ERROR (-5) */
(const char *)"incompatible version",/* Z_VERSION_ERROR (-6) */
(const char *)""
z_const char * const PREFIX(z_errmsg)[10] = {
(z_const char *)"need dictionary", /* Z_NEED_DICT 2 */
(z_const char *)"stream end", /* Z_STREAM_END 1 */
(z_const char *)"", /* Z_OK 0 */
(z_const char *)"file error", /* Z_ERRNO (-1) */
(z_const char *)"stream error", /* Z_STREAM_ERROR (-2) */
(z_const char *)"data error", /* Z_DATA_ERROR (-3) */
(z_const char *)"insufficient memory", /* Z_MEM_ERROR (-4) */
(z_const char *)"buffer error", /* Z_BUF_ERROR (-5) */
(z_const char *)"incompatible version",/* Z_VERSION_ERROR (-6) */
(z_const char *)""
};
const char zlibng_string[] =
" zlib-ng 1.9.9 forked from zlib 1.2.11 ";
" zlib-ng 2.0.0-RC2 forked from zlib";
#ifdef ZLIB_COMPAT
const char * ZEXPORT zlibVersion(void)
{
const char * Z_EXPORT zlibVersion(void) {
return ZLIB_VERSION;
}
#endif
const char * ZEXPORT zlibng_version(void)
{
const char * Z_EXPORT zlibng_version(void) {
return ZLIBNG_VERSION;
}
unsigned long ZEXPORT PREFIX(zlibCompileFlags)(void)
{
unsigned long Z_EXPORT PREFIX(zlibCompileFlags)(void) {
unsigned long flags;
flags = 0;
@@ -77,12 +67,7 @@ unsigned long ZEXPORT PREFIX(zlibCompileFlags)(void)
#ifdef ZLIB_WINAPI
flags += 1 << 10;
#endif
#ifdef BUILDFIXED
flags += 1 << 12;
#endif
#ifdef DYNAMIC_CRC_TABLE
flags += 1 << 13;
#endif
/* Bit 13 reserved for DYNAMIC_CRC_TABLE */
#ifdef NO_GZCOMPRESS
flags += 1L << 16;
#endif
@@ -96,15 +81,13 @@ unsigned long ZEXPORT PREFIX(zlibCompileFlags)(void)
}
#ifdef ZLIB_DEBUG
#include <stdlib.h>
# include <stdlib.h>
# ifndef verbose
# define verbose 0
# endif
int ZLIB_INTERNAL z_verbose = verbose;
int Z_INTERNAL z_verbose = verbose;
void ZLIB_INTERNAL z_error (m)
char *m;
{
void Z_INTERNAL z_error(char *m) {
fprintf(stderr, "%s\n", m);
exit(1);
}
@@ -113,28 +96,16 @@ void ZLIB_INTERNAL z_error (m)
/* exported to allow conversion of error code to string for compress() and
* uncompress()
*/
const char * ZEXPORT PREFIX(zError)(int err)
{
const char * Z_EXPORT PREFIX(zError)(int err) {
return ERR_MSG(err);
}
#ifndef MY_ZCALLOC /* Any system without a special alloc function */
void ZLIB_INTERNAL *zcalloc (void *opaque, unsigned items, unsigned size)
{
void Z_INTERNAL *zng_calloc(void *opaque, unsigned items, unsigned size) {
(void)opaque;
#ifndef UNALIGNED_OK
return memalign(16, items * size);
#else
return sizeof(unsigned int) > 2 ? (void *)malloc(items * size) :
(void *)calloc(items, size);
#endif
return zng_alloc((size_t)items * (size_t)size);
}
void ZLIB_INTERNAL zcfree (void *opaque, void *ptr)
{
void Z_INTERNAL zng_cfree(void *opaque, void *ptr) {
(void)opaque;
free(ptr);
zng_free(ptr);
}
#endif /* MY_ZCALLOC */