Update libraries (#971)

- update fmt to 10.2.1
- update minizip-ng to 4.0.7
- properly link to zlib
- replace the only re2 usage with std::regex
This commit is contained in:
ConfiG 2024-06-25 20:13:47 +03:00 committed by GitHub
parent 2a4b17b9b7
commit 621e3f557c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 2514 additions and 2065 deletions

View file

@ -210,7 +210,7 @@ endif()
set(MAT_JSON_AS_INTERFACE ON) set(MAT_JSON_AS_INTERFACE ON)
CPMAddPackage("gh:geode-sdk/json#3a79c51") CPMAddPackage("gh:geode-sdk/json#3a79c51")
CPMAddPackage("gh:fmtlib/fmt#10.1.1") CPMAddPackage("gh:fmtlib/fmt#10.2.1")
target_compile_definitions(${PROJECT_NAME} INTERFACE MAT_JSON_DYNAMIC=1) target_compile_definitions(${PROJECT_NAME} INTERFACE MAT_JSON_DYNAMIC=1)

View file

@ -241,19 +241,17 @@ if (NOT GEODE_BUILDING_DOCS)
CPMAddPackage("gh:mity/md4c#release-0.5.2") CPMAddPackage("gh:mity/md4c#release-0.5.2")
# Zip support (needed for in-memory streams, which zlib's minizip doesn't support) # Zip support (needed for in-memory streams, which zlib's minizip doesn't support)
set(MZ_LZMA Off CACHE INTERNAL "Enables LZMA & XZ compression") set(MZ_LZMA OFF CACHE INTERNAL "")
set(MZ_ZSTD Off CACHE INTERNAL "") set(MZ_ZSTD OFF CACHE INTERNAL "")
set(MZ_BZIP2 Off CACHE INTERNAL "") set(MZ_BZIP2 OFF CACHE INTERNAL "")
set(MZ_OPENSSL Off CACHE INTERNAL "") set(MZ_OPENSSL OFF CACHE INTERNAL "")
set(MZ_LIBBSD Off CACHE INTERNAL "") set(MZ_LIBBSD OFF CACHE INTERNAL "")
set(SKIP_INSTALL_ALL On CACHE INTERNAL "") set(MZ_FETCH_LIBS ON CACHE INTERNAL "")
set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "" FORCE) set(SKIP_INSTALL_ALL ON CACHE INTERNAL "")
CPMAddPackage( CPMAddPackage("gh:geode-sdk/minizip-ng#83a786f")
GITHUB_REPOSITORY zlib-ng/minizip-ng if (WIN32)
GIT_TAG cee6d8c set_target_properties(zlib PROPERTIES SUFFIX "1.dll")
OPTIONS "CMAKE_POLICY_DEFAULT_CMP0048 OLD" "ZLIB_TAG v1.2.13" endif()
)
set(CMAKE_WARN_DEPRECATED ON CACHE BOOL "" FORCE)
# Silence warnings from dependencies # Silence warnings from dependencies
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
@ -266,19 +264,19 @@ if (NOT GEODE_BUILDING_DOCS)
target_compile_options(zlib PRIVATE -Wno-everything) target_compile_options(zlib PRIVATE -Wno-everything)
endif() endif()
if (TARGET zlibstatic) if (TARGET zlibstatic)
target_compile_options(zlibstatic PRIVATE -Wno-everything) get_property(zlibstatic_ALIASED TARGET zlibstatic PROPERTY ALIASED_TARGET)
if ("${zlibstatic_ALIASED}" STREQUAL "")
target_compile_options(zlibstatic PRIVATE -Wno-everything)
endif()
endif() endif()
endif() endif()
# Regex support
CPMAddPackage("gh:google/re2#c9cba76")
# Cool date library # Cool date library
CPMAddPackage("gh:HowardHinnant/date#1ead671") CPMAddPackage("gh:HowardHinnant/date#1ead671")
target_include_directories(${PROJECT_NAME} PRIVATE ${md4c_SOURCE_DIR}/src) target_include_directories(${PROJECT_NAME} PRIVATE ${md4c_SOURCE_DIR}/src)
target_link_libraries(${PROJECT_NAME} md4c re2 minizip date) target_link_libraries(${PROJECT_NAME} md4c minizip date)
endif() endif()
target_link_libraries(${PROJECT_NAME} TulipHook geode-sdk mat-json-impl) target_link_libraries(${PROJECT_NAME} TulipHook geode-sdk mat-json-impl)

View file

@ -1,428 +1,551 @@
/* zconf.h -- configuration of the zlib compression library /* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995-2010 Jean-loup Gailly. * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h * For conditions of distribution and use, see copyright notice in zlib.h
*/ */
/* @(#) $Id$ */ /* @(#) $Id$ */
#ifndef ZCONF_H #ifndef ZCONF_H
#define ZCONF_H #define ZCONF_H
/* /*
* If you *really* need a unique prefix for all types and library functions, * If you *really* need a unique prefix for all types and library functions,
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
* Even better than compiling with -DZ_PREFIX would be to use configure to set * Even better than compiling with -DZ_PREFIX would be to use configure to set
* this permanently in zconf.h using "./configure --zprefix". * this permanently in zconf.h using "./configure --zprefix".
*/ */
#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
# define Z_PREFIX_SET
/* all linked symbols */
# define _dist_code z__dist_code /* all linked symbols and init macros */
# define _length_code z__length_code # define _dist_code z__dist_code
# define _tr_align z__tr_align # define _length_code z__length_code
# define _tr_flush_block z__tr_flush_block # define _tr_align z__tr_align
# define _tr_init z__tr_init # define _tr_flush_bits z__tr_flush_bits
# define _tr_stored_block z__tr_stored_block # define _tr_flush_block z__tr_flush_block
# define _tr_tally z__tr_tally # define _tr_init z__tr_init
# define adler32 z_adler32 # define _tr_stored_block z__tr_stored_block
# define adler32_combine z_adler32_combine # define _tr_tally z__tr_tally
# define adler32_combine64 z_adler32_combine64 # define adler32 z_adler32
# define compress z_compress # define adler32_combine z_adler32_combine
# define compress2 z_compress2 # define adler32_combine64 z_adler32_combine64
# define compressBound z_compressBound # define adler32_z z_adler32_z
# define crc32 z_crc32 # ifndef Z_SOLO
# define crc32_combine z_crc32_combine # define compress z_compress
# define crc32_combine64 z_crc32_combine64 # define compress2 z_compress2
# define deflate z_deflate # define compressBound z_compressBound
# define deflateBound z_deflateBound # endif
# define deflateCopy z_deflateCopy # define crc32 z_crc32
# define deflateEnd z_deflateEnd # define crc32_combine z_crc32_combine
# define deflateInit2_ z_deflateInit2_ # define crc32_combine64 z_crc32_combine64
# define deflateInit_ z_deflateInit_ # define crc32_combine_gen z_crc32_combine_gen
# define deflateParams z_deflateParams # define crc32_combine_gen64 z_crc32_combine_gen64
# define deflatePrime z_deflatePrime # define crc32_combine_op z_crc32_combine_op
# define deflateReset z_deflateReset # define crc32_z z_crc32_z
# define deflateSetDictionary z_deflateSetDictionary # define deflate z_deflate
# define deflateSetHeader z_deflateSetHeader # define deflateBound z_deflateBound
# define deflateTune z_deflateTune # define deflateCopy z_deflateCopy
# define deflate_copyright z_deflate_copyright # define deflateEnd z_deflateEnd
# define get_crc_table z_get_crc_table # define deflateGetDictionary z_deflateGetDictionary
# define gz_error z_gz_error # define deflateInit z_deflateInit
# define gz_intmax z_gz_intmax # define deflateInit2 z_deflateInit2
# define gz_strwinerror z_gz_strwinerror # define deflateInit2_ z_deflateInit2_
# define gzbuffer z_gzbuffer # define deflateInit_ z_deflateInit_
# define gzclearerr z_gzclearerr # define deflateParams z_deflateParams
# define gzclose z_gzclose # define deflatePending z_deflatePending
# define gzclose_r z_gzclose_r # define deflatePrime z_deflatePrime
# define gzclose_w z_gzclose_w # define deflateReset z_deflateReset
# define gzdirect z_gzdirect # define deflateResetKeep z_deflateResetKeep
# define gzdopen z_gzdopen # define deflateSetDictionary z_deflateSetDictionary
# define gzeof z_gzeof # define deflateSetHeader z_deflateSetHeader
# define gzerror z_gzerror # define deflateTune z_deflateTune
# define gzflush z_gzflush # define deflate_copyright z_deflate_copyright
# define gzgetc z_gzgetc # define get_crc_table z_get_crc_table
# define gzgets z_gzgets # ifndef Z_SOLO
# define gzoffset z_gzoffset # define gz_error z_gz_error
# define gzoffset64 z_gzoffset64 # define gz_intmax z_gz_intmax
# define gzopen z_gzopen # define gz_strwinerror z_gz_strwinerror
# define gzopen64 z_gzopen64 # define gzbuffer z_gzbuffer
# define gzprintf z_gzprintf # define gzclearerr z_gzclearerr
# define gzputc z_gzputc # define gzclose z_gzclose
# define gzputs z_gzputs # define gzclose_r z_gzclose_r
# define gzread z_gzread # define gzclose_w z_gzclose_w
# define gzrewind z_gzrewind # define gzdirect z_gzdirect
# define gzseek z_gzseek # define gzdopen z_gzdopen
# define gzseek64 z_gzseek64 # define gzeof z_gzeof
# define gzsetparams z_gzsetparams # define gzerror z_gzerror
# define gztell z_gztell # define gzflush z_gzflush
# define gztell64 z_gztell64 # define gzfread z_gzfread
# define gzungetc z_gzungetc # define gzfwrite z_gzfwrite
# define gzwrite z_gzwrite # define gzgetc z_gzgetc
# define inflate z_inflate # define gzgetc_ z_gzgetc_
# define inflateBack z_inflateBack # define gzgets z_gzgets
# define inflateBackEnd z_inflateBackEnd # define gzoffset z_gzoffset
# define inflateBackInit_ z_inflateBackInit_ # define gzoffset64 z_gzoffset64
# define inflateCopy z_inflateCopy # define gzopen z_gzopen
# define inflateEnd z_inflateEnd # define gzopen64 z_gzopen64
# define inflateGetHeader z_inflateGetHeader # ifdef _WIN32
# define inflateInit2_ z_inflateInit2_ # define gzopen_w z_gzopen_w
# define inflateInit_ z_inflateInit_ # endif
# define inflateMark z_inflateMark # define gzprintf z_gzprintf
# define inflatePrime z_inflatePrime # define gzputc z_gzputc
# define inflateReset z_inflateReset # define gzputs z_gzputs
# define inflateReset2 z_inflateReset2 # define gzread z_gzread
# define inflateSetDictionary z_inflateSetDictionary # define gzrewind z_gzrewind
# define inflateSync z_inflateSync # define gzseek z_gzseek
# define inflateSyncPoint z_inflateSyncPoint # define gzseek64 z_gzseek64
# define inflateUndermine z_inflateUndermine # define gzsetparams z_gzsetparams
# define inflate_copyright z_inflate_copyright # define gztell z_gztell
# define inflate_fast z_inflate_fast # define gztell64 z_gztell64
# define inflate_table z_inflate_table # define gzungetc z_gzungetc
# define uncompress z_uncompress # define gzvprintf z_gzvprintf
# define zError z_zError # define gzwrite z_gzwrite
# define zcalloc z_zcalloc # endif
# define zcfree z_zcfree # define inflate z_inflate
# define zlibCompileFlags z_zlibCompileFlags # define inflateBack z_inflateBack
# define zlibVersion z_zlibVersion # define inflateBackEnd z_inflateBackEnd
# define inflateBackInit z_inflateBackInit
/* all zlib typedefs in zlib.h and zconf.h */ # define inflateBackInit_ z_inflateBackInit_
# define Byte z_Byte # define inflateCodesUsed z_inflateCodesUsed
# define Bytef z_Bytef # define inflateCopy z_inflateCopy
# define alloc_func z_alloc_func # define inflateEnd z_inflateEnd
# define charf z_charf # define inflateGetDictionary z_inflateGetDictionary
# define free_func z_free_func # define inflateGetHeader z_inflateGetHeader
# define gzFile z_gzFile # define inflateInit z_inflateInit
# define gz_header z_gz_header # define inflateInit2 z_inflateInit2
# define gz_headerp z_gz_headerp # define inflateInit2_ z_inflateInit2_
# define in_func z_in_func # define inflateInit_ z_inflateInit_
# define intf z_intf # define inflateMark z_inflateMark
# define out_func z_out_func # define inflatePrime z_inflatePrime
# define uInt z_uInt # define inflateReset z_inflateReset
# define uIntf z_uIntf # define inflateReset2 z_inflateReset2
# define uLong z_uLong # define inflateResetKeep z_inflateResetKeep
# define uLongf z_uLongf # define inflateSetDictionary z_inflateSetDictionary
# define voidp z_voidp # define inflateSync z_inflateSync
# define voidpc z_voidpc # define inflateSyncPoint z_inflateSyncPoint
# define voidpf z_voidpf # define inflateUndermine z_inflateUndermine
# define inflateValidate z_inflateValidate
/* all zlib structs in zlib.h and zconf.h */ # define inflate_copyright z_inflate_copyright
# define gz_header_s z_gz_header_s # define inflate_fast z_inflate_fast
# define internal_state z_internal_state # define inflate_table z_inflate_table
# ifndef Z_SOLO
#endif # define uncompress z_uncompress
# define uncompress2 z_uncompress2
#if defined(__MSDOS__) && !defined(MSDOS) # endif
# define MSDOS # define zError z_zError
#endif # ifndef Z_SOLO
#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) # define zcalloc z_zcalloc
# define OS2 # define zcfree z_zcfree
#endif # endif
#if defined(_WINDOWS) && !defined(WINDOWS) # define zlibCompileFlags z_zlibCompileFlags
# define WINDOWS # define zlibVersion z_zlibVersion
#endif
#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) /* all zlib typedefs in zlib.h and zconf.h */
# ifndef WIN32 # define Byte z_Byte
# define WIN32 # define Bytef z_Bytef
# endif # define alloc_func z_alloc_func
#endif # define charf z_charf
#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) # define free_func z_free_func
# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) # ifndef Z_SOLO
# ifndef SYS16BIT # define gzFile z_gzFile
# define SYS16BIT # endif
# endif # define gz_header z_gz_header
# endif # define gz_headerp z_gz_headerp
#endif # define in_func z_in_func
# define intf z_intf
/* # define out_func z_out_func
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more # define uInt z_uInt
* than 64k bytes at a time (needed on systems with 16-bit int). # define uIntf z_uIntf
*/ # define uLong z_uLong
#ifdef SYS16BIT # define uLongf z_uLongf
# define MAXSEG_64K # define voidp z_voidp
#endif # define voidpc z_voidpc
#ifdef MSDOS # define voidpf z_voidpf
# define UNALIGNED_OK
#endif /* all zlib structs in zlib.h and zconf.h */
# define gz_header_s z_gz_header_s
#ifdef __STDC_VERSION__ # define internal_state z_internal_state
# ifndef STDC
# define STDC #endif
# endif
# if __STDC_VERSION__ >= 199901L #if defined(__MSDOS__) && !defined(MSDOS)
# ifndef STDC99 # define MSDOS
# define STDC99 #endif
# endif #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
# endif # define OS2
#endif #endif
#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) #if defined(_WINDOWS) && !defined(WINDOWS)
# define STDC # define WINDOWS
#endif #endif
#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
# define STDC # ifndef WIN32
#endif # define WIN32
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) # endif
# define STDC #endif
#endif #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
# define STDC # ifndef SYS16BIT
#endif # define SYS16BIT
# endif
#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ # endif
# define STDC #endif
#endif
/*
#ifndef STDC * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ * than 64k bytes at a time (needed on systems with 16-bit int).
# define const /* note: need a more gentle solution here */ */
# endif #ifdef SYS16BIT
#endif # define MAXSEG_64K
#endif
/* Some Mac compilers merge all .h files incorrectly: */ #ifdef MSDOS
#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) # define UNALIGNED_OK
# define NO_DUMMY_DECL #endif
#endif
#ifdef __STDC_VERSION__
/* Maximum value for memLevel in deflateInit2 */ # ifndef STDC
#ifndef MAX_MEM_LEVEL # define STDC
# ifdef MAXSEG_64K # endif
# define MAX_MEM_LEVEL 8 # if __STDC_VERSION__ >= 199901L
# else # ifndef STDC99
# define MAX_MEM_LEVEL 9 # define STDC99
# endif # endif
#endif # endif
#endif
/* Maximum value for windowBits in deflateInit2 and inflateInit2. #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files # define STDC
* created by gzip. (Files created by minigzip can still be extracted by #endif
* gzip.) #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
*/ # define STDC
#ifndef MAX_WBITS #endif
# define MAX_WBITS 15 /* 32K LZ77 window */ #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
#endif # define STDC
#endif
/* The memory requirements for deflate are (in bytes): #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
(1 << (windowBits+2)) + (1 << (memLevel+9)) # define STDC
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) #endif
plus a few kilobytes for small objects. For example, if you want to reduce
the default memory requirements from 256K to 128K, compile with #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" # define STDC
Of course this will generally degrade compression (there's no free lunch). #endif
The memory requirements for inflate are (in bytes) 1 << windowBits #ifndef STDC
that is, 32K for windowBits=15 (default value) plus a few kilobytes # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
for small objects. # define const /* note: need a more gentle solution here */
*/ # endif
#endif
/* Type declarations */
#if defined(ZLIB_CONST) && !defined(z_const)
#ifndef OF /* function prototypes */ # define z_const const
# ifdef STDC #else
# define OF(args) args # define z_const
# else #endif
# define OF(args) ()
# endif #ifdef Z_SOLO
#endif # ifdef _WIN64
typedef unsigned long long z_size_t;
/* The following definitions for FAR are needed only for MSDOS mixed # else
* model programming (small or medium model with some far allocations). typedef unsigned long z_size_t;
* This was tested only with MSC; for other MSDOS compilers you may have # endif
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model, #else
* just define FAR to be empty. # define z_longlong long long
*/ # if defined(NO_SIZE_T)
#ifdef SYS16BIT typedef unsigned NO_SIZE_T z_size_t;
# if defined(M_I86SM) || defined(M_I86MM) # elif defined(STDC)
/* MSC small or medium model */ # include <stddef.h>
# define SMALL_MEDIUM typedef size_t z_size_t;
# ifdef _MSC_VER # else
# define FAR _far typedef unsigned long z_size_t;
# else # endif
# define FAR far # undef z_longlong
# endif #endif
# endif
# if (defined(__SMALL__) || defined(__MEDIUM__)) /* Maximum value for memLevel in deflateInit2 */
/* Turbo C small or medium model */ #ifndef MAX_MEM_LEVEL
# define SMALL_MEDIUM # ifdef MAXSEG_64K
# ifdef __BORLANDC__ # define MAX_MEM_LEVEL 8
# define FAR _far # else
# else # define MAX_MEM_LEVEL 9
# define FAR far # endif
# endif #endif
# endif
#endif /* Maximum value for windowBits in deflateInit2 and inflateInit2.
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
#if defined(WINDOWS) || defined(WIN32) * created by gzip. (Files created by minigzip can still be extracted by
/* If building or using zlib as a DLL, define ZLIB_DLL. * gzip.)
* This is not mandatory, but it offers a little performance increase. */
*/ #ifndef MAX_WBITS
# ifdef ZLIB_DLL # define MAX_WBITS 15 /* 32K LZ77 window */
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) #endif
# ifdef ZLIB_INTERNAL
# define ZEXTERN extern __declspec(dllexport) /* The memory requirements for deflate are (in bytes):
# else (1 << (windowBits+2)) + (1 << (memLevel+9))
# define ZEXTERN extern __declspec(dllimport) that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
# endif plus a few kilobytes for small objects. For example, if you want to reduce
# endif the default memory requirements from 256K to 128K, compile with
# endif /* ZLIB_DLL */ make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
/* If building or using zlib with the WINAPI/WINAPIV calling convention, Of course this will generally degrade compression (there's no free lunch).
* define ZLIB_WINAPI.
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. The memory requirements for inflate are (in bytes) 1 << windowBits
*/ that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
# ifdef ZLIB_WINAPI for small objects.
# ifdef FAR */
# undef FAR
# endif /* Type declarations */
# include <windows.h>
/* No need for _export, use ZLIB.DEF instead. */ #ifndef OF /* function prototypes */
/* For complete Windows compatibility, use WINAPI, not __stdcall. */ # ifdef STDC
# define ZEXPORT WINAPI # define OF(args) args
# ifdef WIN32 # else
# define ZEXPORTVA WINAPIV # define OF(args) ()
# else # endif
# define ZEXPORTVA FAR CDECL #endif
# endif
# endif #ifndef Z_ARG /* function prototypes for stdarg */
#endif # if defined(STDC) || defined(Z_HAVE_STDARG_H)
# define Z_ARG(args) args
#if defined (__BEOS__) # else
# ifdef ZLIB_DLL # define Z_ARG(args) ()
# ifdef ZLIB_INTERNAL # endif
# define ZEXPORT __declspec(dllexport) #endif
# define ZEXPORTVA __declspec(dllexport)
# else /* The following definitions for FAR are needed only for MSDOS mixed
# define ZEXPORT __declspec(dllimport) * model programming (small or medium model with some far allocations).
# define ZEXPORTVA __declspec(dllimport) * This was tested only with MSC; for other MSDOS compilers you may have
# endif * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
# endif * just define FAR to be empty.
#endif */
#ifdef SYS16BIT
#ifndef ZEXTERN # if defined(M_I86SM) || defined(M_I86MM)
# define ZEXTERN extern /* MSC small or medium model */
#endif # define SMALL_MEDIUM
#ifndef ZEXPORT # ifdef _MSC_VER
# define ZEXPORT # define FAR _far
#endif # else
#ifndef ZEXPORTVA # define FAR far
# define ZEXPORTVA # endif
#endif # endif
# if (defined(__SMALL__) || defined(__MEDIUM__))
#ifndef FAR /* Turbo C small or medium model */
# define FAR # define SMALL_MEDIUM
#endif # ifdef __BORLANDC__
# define FAR _far
#if !defined(__MACTYPES__) # else
typedef unsigned char Byte; /* 8 bits */ # define FAR far
#endif # endif
typedef unsigned int uInt; /* 16 bits or more */ # endif
typedef unsigned long uLong; /* 32 bits or more */ #endif
#ifdef SMALL_MEDIUM #if defined(WINDOWS) || defined(WIN32)
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ /* If building or using zlib as a DLL, define ZLIB_DLL.
# define Bytef Byte FAR * This is not mandatory, but it offers a little performance increase.
#else */
typedef Byte FAR Bytef; # ifdef ZLIB_DLL
#endif # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
typedef char FAR charf; # ifdef ZLIB_INTERNAL
typedef int FAR intf; # define ZEXTERN extern __declspec(dllexport)
typedef uInt FAR uIntf; # else
typedef uLong FAR uLongf; # define ZEXTERN extern __declspec(dllimport)
# endif
#ifdef STDC # endif
typedef void const *voidpc; # endif /* ZLIB_DLL */
typedef void FAR *voidpf; /* If building or using zlib with the WINAPI/WINAPIV calling convention,
typedef void *voidp; * define ZLIB_WINAPI.
#else * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
typedef Byte const *voidpc; */
typedef Byte FAR *voidpf; # ifdef ZLIB_WINAPI
typedef Byte *voidp; # ifdef FAR
#endif # undef FAR
# endif
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ # ifndef WIN32_LEAN_AND_MEAN
# define Z_HAVE_UNISTD_H # define WIN32_LEAN_AND_MEAN
#endif # endif
# include <windows.h>
#ifdef STDC /* No need for _export, use ZLIB.DEF instead. */
# include <sys/types.h> /* for off_t */ /* For complete Windows compatibility, use WINAPI, not __stdcall. */
#endif # define ZEXPORT WINAPI
# ifdef WIN32
/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and # define ZEXPORTVA WINAPIV
* "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even # else
* though the former does not conform to the LFS document), but considering # define ZEXPORTVA FAR CDECL
* both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as # endif
* equivalently requesting no 64-bit operations # endif
*/ #endif
#if -_LARGEFILE64_SOURCE - -1 == 1
# undef _LARGEFILE64_SOURCE #if defined (__BEOS__)
#endif # ifdef ZLIB_DLL
# ifdef ZLIB_INTERNAL
#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) # define ZEXPORT __declspec(dllexport)
# include <unistd.h> /* for SEEK_* and off_t */ # define ZEXPORTVA __declspec(dllexport)
# ifdef VMS # else
# include <unixio.h> /* for off_t */ # define ZEXPORT __declspec(dllimport)
# endif # define ZEXPORTVA __declspec(dllimport)
# ifndef z_off_t # endif
# define z_off_t off_t # endif
# endif #endif
#endif
#ifndef ZEXTERN
#ifndef SEEK_SET # define ZEXTERN extern
# define SEEK_SET 0 /* Seek from beginning of file. */ #endif
# define SEEK_CUR 1 /* Seek from current position. */ #ifndef ZEXPORT
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ # define ZEXPORT
#endif #endif
#ifndef ZEXPORTVA
#ifndef z_off_t # define ZEXPORTVA
# define z_off_t long #endif
#endif
#ifndef FAR
#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 # define FAR
# define z_off64_t off64_t #endif
#else
# define z_off64_t z_off_t #if !defined(__MACTYPES__)
#endif typedef unsigned char Byte; /* 8 bits */
#endif
#if defined(__OS400__) typedef unsigned int uInt; /* 16 bits or more */
# define NO_vsnprintf typedef unsigned long uLong; /* 32 bits or more */
#endif
#ifdef SMALL_MEDIUM
#if defined(__MVS__) /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
# define NO_vsnprintf # define Bytef Byte FAR
#endif #else
typedef Byte FAR Bytef;
/* MVS linker does not support external names larger than 8 bytes */ #endif
#if defined(__MVS__) typedef char FAR charf;
#pragma map(deflateInit_,"DEIN") typedef int FAR intf;
#pragma map(deflateInit2_,"DEIN2") typedef uInt FAR uIntf;
#pragma map(deflateEnd,"DEEND") typedef uLong FAR uLongf;
#pragma map(deflateBound,"DEBND")
#pragma map(inflateInit_,"ININ") #ifdef STDC
#pragma map(inflateInit2_,"ININ2") typedef void const *voidpc;
#pragma map(inflateEnd,"INEND") typedef void FAR *voidpf;
#pragma map(inflateSync,"INSY") typedef void *voidp;
#pragma map(inflateSetDictionary,"INSEDI") #else
#pragma map(compressBound,"CMBND") typedef Byte const *voidpc;
#pragma map(inflate_table,"INTABL") typedef Byte FAR *voidpf;
#pragma map(inflate_fast,"INFA") typedef Byte *voidp;
#pragma map(inflate_copyright,"INCOPY") #endif
#endif
#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
#endif /* ZCONF_H */ # include <limits.h>
# if (UINT_MAX == 0xffffffffUL)
# define Z_U4 unsigned
# elif (ULONG_MAX == 0xffffffffUL)
# define Z_U4 unsigned long
# elif (USHRT_MAX == 0xffffffffUL)
# define Z_U4 unsigned short
# endif
#endif
#ifdef Z_U4
typedef Z_U4 z_crc_t;
#else
typedef unsigned long z_crc_t;
#endif
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
# define Z_HAVE_UNISTD_H
#endif
#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
# define Z_HAVE_STDARG_H
#endif
#ifdef STDC
# ifndef Z_SOLO
# include <sys/types.h> /* for off_t */
# endif
#endif
#if defined(STDC) || defined(Z_HAVE_STDARG_H)
# ifndef Z_SOLO
# include <stdarg.h> /* for va_list */
# endif
#endif
#ifdef _WIN32
# ifndef Z_SOLO
# include <stddef.h> /* for wchar_t */
# endif
#endif
/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
* "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
* though the former does not conform to the LFS document), but considering
* both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
* equivalently requesting no 64-bit operations
*/
#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
# undef _LARGEFILE64_SOURCE
#endif
#ifndef Z_HAVE_UNISTD_H
# ifdef __WATCOMC__
# define Z_HAVE_UNISTD_H
# endif
#endif
#ifndef Z_HAVE_UNISTD_H
# if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32)
# define Z_HAVE_UNISTD_H
# endif
#endif
#ifndef Z_SOLO
# if defined(Z_HAVE_UNISTD_H)
# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
# ifdef VMS
# include <unixio.h> /* for off_t */
# endif
# ifndef z_off_t
# define z_off_t off_t
# endif
# endif
#endif
#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
# define Z_LFS64
#endif
#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
# define Z_LARGE64
#endif
#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
# define Z_WANT64
#endif
#if !defined(SEEK_SET) && !defined(Z_SOLO)
# define SEEK_SET 0 /* Seek from beginning of file. */
# define SEEK_CUR 1 /* Seek from current position. */
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
#endif
#ifndef z_off_t
# define z_off_t long
#endif
#if !defined(_WIN32) && defined(Z_LARGE64)
# define z_off64_t off64_t
#else
# if defined(_WIN32) && !defined(__GNUC__)
# define z_off64_t __int64
# else
# define z_off64_t z_off_t
# endif
#endif
/* MVS linker does not support external names larger than 8 bytes */
#if defined(__MVS__)
#pragma map(deflateInit_,"DEIN")
#pragma map(deflateInit2_,"DEIN2")
#pragma map(deflateEnd,"DEEND")
#pragma map(deflateBound,"DEBND")
#pragma map(inflateInit_,"ININ")
#pragma map(inflateInit2_,"ININ2")
#pragma map(inflateEnd,"INEND")
#pragma map(inflateSync,"INSY")
#pragma map(inflateSetDictionary,"INSEDI")
#pragma map(compressBound,"CMBND")
#pragma map(inflate_table,"INTABL")
#pragma map(inflate_fast,"INFA")
#pragma map(inflate_copyright,"INCOPY")
#endif
#endif /* ZCONF_H */

File diff suppressed because it is too large Load diff

View file

@ -5,7 +5,7 @@
#include <Geode/loader/SettingNode.hpp> #include <Geode/loader/SettingNode.hpp>
#include <Geode/utils/general.hpp> #include <Geode/utils/general.hpp>
#include <Geode/utils/JsonValidation.hpp> #include <Geode/utils/JsonValidation.hpp>
#include <re2/re2.h> #include <regex>
using namespace geode::prelude; using namespace geode::prelude;
@ -390,7 +390,7 @@ IMPL_TO_VALID(Float) {
IMPL_TO_VALID(String) { IMPL_TO_VALID(String) {
if (m_definition.controls->match) { if (m_definition.controls->match) {
if (!re2::RE2::FullMatch(value, m_definition.controls->match.value())) { if (!std::regex_match(value, std::regex{m_definition.controls->match.value()})) {
return { return {
m_definition.defaultValue, m_definition.defaultValue,
fmt::format( fmt::format(

View file

@ -187,7 +187,8 @@ private:
if (std::holds_alternative<Path>(m_srcDest)) { if (std::holds_alternative<Path>(m_srcDest)) {
auto& path = std::get<Path>(m_srcDest); auto& path = std::get<Path>(m_srcDest);
// open file // open file
if (!mz_stream_os_create(&m_stream)) { m_stream = mz_stream_os_create();
if (!m_stream) {
return Err("Unable to open file"); return Err("Unable to open file");
} }
if (mz_stream_os_open( if (mz_stream_os_open(
@ -201,7 +202,8 @@ private:
// open stream from memory stream // open stream from memory stream
else { else {
auto& src = std::get<ByteVector>(m_srcDest); auto& src = std::get<ByteVector>(m_srcDest);
if (!mz_stream_mem_create(&m_stream)) { m_stream = mz_stream_mem_create();
if (!m_stream) {
return Err("Unable to create memory stream"); return Err("Unable to create memory stream");
} }
// mz_stream_mem_set_buffer doesn't memcpy so we gotta store the data // mz_stream_mem_set_buffer doesn't memcpy so we gotta store the data
@ -218,7 +220,8 @@ private:
} }
// open zip // open zip
if (!mz_zip_create(&m_handle)) { m_handle = mz_zip_create();
if (!m_handle) {
return Err("Unable to create zip handler"); return Err("Unable to create zip handler");
} }
if (mz_zip_open(m_handle, m_stream, m_mode) != MZ_OK) { if (mz_zip_open(m_handle, m_stream, m_mode) != MZ_OK) {