diff --git a/Externals/zlib-ng/CMakeLists.txt b/Externals/zlib-ng/CMakeLists.txt index 2119a39983..2b686c0b12 100644 --- a/Externals/zlib-ng/CMakeLists.txt +++ b/Externals/zlib-ng/CMakeLists.txt @@ -1,13 +1,15 @@ -set(BUILD_TESTING OFF) +set(ZLIB_ENABLE_TESTS OFF) set(ZLIB_COMPAT ON) -set(INSTALL_UTILS OFF) -set(BUILD_SHARED_LIBS OFF) +set(SKIP_INSTALL_ALL ON) + +option(BUILD_SHARED_LIBS "Build shared library" OFF) add_subdirectory(zlib-ng) # Set ZLIB variables for find_package used by other projects -set(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/zlib-ng CACHE STRING "Path to zlib include directory") +set(ZLIB_INCLUDE_DIR ${CMAKE_BINARY_DIR}/zlib-ng CACHE STRING "Path to zlib include directory") set(ZLIB_LIBRARY ZLIB::ZLIB CACHE STRING "Path to zlib library") -add_library(ZLIB::ZLIB ALIAS zlib-ng) -dolphin_disable_warnings(zlib-ng) +# Setup zlib alias project so FindZLIB doesn't recreate it +add_library(ZLIB::ZLIB ALIAS zlib) +dolphin_disable_warnings(zlib) diff --git a/Externals/zlib-ng/zconf.h b/Externals/zlib-ng/zconf.h index 8dd6b82c86..f3691639ef 100644 --- a/Externals/zlib-ng/zconf.h +++ b/Externals/zlib-ng/zconf.h @@ -1,5 +1,5 @@ /* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler + * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -35,9 +35,6 @@ * created by gzip. (Files created by minigzip can still be extracted by * gzip.) */ -#ifndef MIN_WBITS -# define MIN_WBITS 8 /* 256 LZ77 window */ -#endif #ifndef MAX_WBITS # define MAX_WBITS 15 /* 32K LZ77 window */ #endif @@ -82,9 +79,6 @@ * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. */ #if defined(ZLIB_WINAPI) && defined(_WIN32) -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif # include /* No need for _export, use ZLIB.DEF instead. */ /* For complete Windows compatibility, use WINAPI, not __stdcall. */ @@ -116,11 +110,8 @@ #ifndef ZEXPORTVA # define ZEXPORTVA Z_EXPORTVA #endif -#ifndef FAR -# define FAR -#endif -/* Legacy zlib typedefs for backwards compatibility. Don't assume stdint.h is defined. */ +/* Fallback for something that includes us. */ typedef unsigned char Byte; typedef Byte Bytef; @@ -136,9 +127,9 @@ typedef void const *voidpc; typedef void *voidpf; typedef void *voidp; -typedef unsigned int z_crc_t; +typedef uint32_t z_crc_t; -#if 0 /* was set to #if 1 by configure/cmake/etc */ +#if 0 /* was set to #if 0 by configure/cmake/etc */ # define Z_HAVE_UNISTD_H #endif @@ -201,6 +192,4 @@ typedef PTRDIFF_TYPE ptrdiff_t; # endif #endif -typedef size_t z_size_t; - #endif /* ZCONF_H */ diff --git a/Externals/zlib-ng/zlib-ng b/Externals/zlib-ng/zlib-ng index 6d9f3dc072..ce01b1e41d 160000 --- a/Externals/zlib-ng/zlib-ng +++ b/Externals/zlib-ng/zlib-ng @@ -1 +1 @@ -Subproject commit 6d9f3dc072369dc719a5fbe71d4e086a96a680bd +Subproject commit ce01b1e41da298334f8214389cc9369540a7560f diff --git a/Externals/zlib-ng/zlib-ng.vcxproj b/Externals/zlib-ng/zlib-ng.vcxproj index bf9b34cd1f..1366e1da77 100644 --- a/Externals/zlib-ng/zlib-ng.vcxproj +++ b/Externals/zlib-ng/zlib-ng.vcxproj @@ -31,17 +31,14 @@ - - - - + - + - - - + + + @@ -51,24 +48,20 @@ - - + + - - - - - - - - + + + + - + @@ -81,10 +74,12 @@ + + @@ -94,54 +89,44 @@ + + - - - - - - + - - - - - + - - - + - + - + - diff --git a/Externals/zlib-ng/zlib.h b/Externals/zlib-ng/zlib.h index 41ade9965c..e595aa88de 100644 --- a/Externals/zlib-ng/zlib.h +++ b/Externals/zlib-ng/zlib.h @@ -1,9 +1,9 @@ #ifndef ZLIB_H_ #define ZLIB_H_ /* zlib.h -- interface of the 'zlib-ng' compression library - Forked from and compatible with zlib 1.3.1 + Forked from and compatible with zlib 1.2.12 - Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler + Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -49,21 +49,20 @@ extern "C" { #endif -#define ZLIBNG_VERSION "2.3.2" -#define ZLIBNG_VERNUM 0x020302F0L /* MMNNRRSM: major minor revision status modified */ +#define ZLIBNG_VERSION "2.1.0.devel" +#define ZLIBNG_VERNUM 0x02010000L /* MMNNRRMS: major minor revision status modified */ #define ZLIBNG_VER_MAJOR 2 -#define ZLIBNG_VER_MINOR 3 -#define ZLIBNG_VER_REVISION 2 -#define ZLIBNG_VER_STATUS F /* 0=devel, 1-E=beta, F=Release (DEPRECATED) */ -#define ZLIBNG_VER_STATUSH 0xF /* Hex values: 0=devel, 1-9=beta, A-E=Release Candidate, F=Release */ +#define ZLIBNG_VER_MINOR 1 +#define ZLIBNG_VER_REVISION 0 +#define ZLIBNG_VER_STATUS 0 /* 0=devel, 1-E=beta, F=Release */ #define ZLIBNG_VER_MODIFIED 0 /* non-zero if modified externally from zlib-ng */ -#define ZLIB_VERSION "1.3.1.zlib-ng" -#define ZLIB_VERNUM 0x131f +#define ZLIB_VERSION "1.2.12.zlib-ng" +#define ZLIB_VERNUM 0x12cf #define ZLIB_VER_MAJOR 1 -#define ZLIB_VER_MINOR 3 -#define ZLIB_VER_REVISION 1 -#define ZLIB_VER_SUBREVISION 15 /* 15=fork (0xf) */ +#define ZLIB_VER_MINOR 2 +#define ZLIB_VER_REVISION 12 +#define ZLIB_VER_SUBREVISION 0 /* The 'zlib' compression library provides in-memory compression and @@ -220,7 +219,7 @@ typedef gz_header *gz_headerp; #define Z_DEFLATED 8 /* The deflate compression method (the only one supported in this version) */ -#define Z_NULL 0 /* for compatibility with zlib, was for initializing zalloc, zfree, opaque */ +#define Z_NULL NULL /* for compatibility with zlib, was for initializing zalloc, zfree, opaque */ #define zlib_version zlibVersion() /* for compatibility with versions < 1.0.2 */ @@ -240,8 +239,8 @@ Z_EXTERN int Z_EXPORT deflateInit (z_stream *strm, int level); Initializes the internal stream state for compression. The fields zalloc, zfree and opaque must be initialized before by the caller. If - zalloc and zfree are set to Z_NULL, deflateInit updates them to use default - allocation functions. total_in, total_out, adler, and msg are initialized. + zalloc and zfree are set to NULL, deflateInit updates them to use default + allocation functions. The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: 1 gives best speed, 9 gives best compression, 0 gives no compression at all @@ -331,8 +330,8 @@ Z_EXTERN int Z_EXPORT deflate(z_stream *strm, int flush); with the same value of the flush parameter and more output space (updated avail_out), until the flush is complete (deflate returns with non-zero avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that - avail_out is greater than six when the flush marker begins, in order to avoid - repeated flush markers upon calling deflate() again when avail_out == 0. + avail_out is greater than six to avoid repeated flush markers due to + avail_out == 0 on return. If the parameter flush is set to Z_FINISH, pending input is processed, pending output is flushed and deflate returns with Z_STREAM_END if there was @@ -393,9 +392,8 @@ Z_EXTERN int Z_EXPORT inflateInit (z_stream *strm); the caller. In the current version of inflate, the provided input is not read or consumed. The allocation of a sliding window will be deferred to the first call of inflate (if the decompression does not complete on the - first call). If zalloc and zfree are set to Z_NULL, inflateInit updates - them to use default allocation functions. total_in, total_out, adler, and - msg are initialized. + first call). If zalloc and zfree are set to NULL, inflateInit updates + them to use default allocation functions. inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the @@ -705,7 +703,7 @@ Z_EXTERN int Z_EXPORT deflateReset(z_stream *strm); This function is equivalent to deflateEnd followed by deflateInit, but does not free and reallocate the internal compression state. The stream will leave the compression level and any other attributes that may have been - set unchanged. total_in, total_out, adler, and msg are initialized. + set unchanged. deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being NULL). @@ -736,7 +734,7 @@ Z_EXTERN int Z_EXPORT deflateParams(z_stream *strm, int level, int strategy); Then no more input data should be provided before the deflateParams() call. If this is done, the old level and strategy will be applied to the data compressed before deflateParams(), and the new level and strategy will be - applied to the data compressed after deflateParams(). + applied to the the data compressed after deflateParams(). deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if @@ -818,9 +816,8 @@ Z_EXTERN int Z_EXPORT deflateSetHeader(z_stream *strm, gz_headerp head); gzip file" and give up. If deflateSetHeader is not used, the default gzip header has text false, - the time set to zero, and os set to the current operating system, with no - extra, name, or comment fields. The gzip header is returned to the default - state by deflateReset(). + the time set to zero, and os set to 255, with no extra, name, or comment + fields. The gzip header is returned to the default state by deflateReset(). deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. @@ -890,7 +887,7 @@ Z_EXTERN int Z_EXPORT inflateSetDictionary(z_stream *strm, const unsigned char * deflateSetDictionary). For raw inflate, this function can be called at any time to set the dictionary. If the provided dictionary is smaller than the window and there is already data in the window, then the provided dictionary - will amend what's there. The application must ensure that the dictionary + will amend what's there. The application must insure that the dictionary that was used for compression is provided. inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a @@ -927,7 +924,7 @@ Z_EXTERN int Z_EXPORT inflateSync(z_stream *strm); inflateSync returns Z_OK if a possible full flush point has been found, Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. - In the success case, the application may save the current value of + In the success case, the application may save the current current value of total_in which indicates where valid compressed data was found. In the error case, the application may repeatedly call inflateSync, providing more input each time, until success or end of the input data. @@ -953,7 +950,6 @@ Z_EXTERN int Z_EXPORT inflateReset(z_stream *strm); This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate the internal decompression state. The stream will keep attributes that may have been set by inflateInit2. - total_in, total_out, adler, and msg are initialized. inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being NULL). @@ -1732,14 +1728,14 @@ Z_EXTERN unsigned long Z_EXPORT crc32_combine(unsigned long crc1, unsigned long seq1 and seq2 with lengths len1 and len2, CRC-32 check values were calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. len2 must be non-negative. + len2. */ /* Z_EXTERN unsigned long Z_EXPORT crc32_combine_gen(z_off_t len2); Return the operator corresponding to length len2, to be used with - crc32_combine_op(). len2 must be non-negative. + crc32_combine_op(). */ Z_EXTERN unsigned long Z_EXPORT crc32_combine_op(unsigned long crc1, unsigned long crc2, diff --git a/Source/Core/Common/CMakeLists.txt b/Source/Core/Common/CMakeLists.txt index 7580cded5d..33a03729ca 100644 --- a/Source/Core/Common/CMakeLists.txt +++ b/Source/Core/Common/CMakeLists.txt @@ -191,7 +191,6 @@ PRIVATE FatFs spng::spng watcher - ZLIB::ZLIB ${VTUNE_LIBRARIES} )