diff options
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/src/gzip/ftgzip.c')
-rw-r--r-- | Build/source/libs/freetype2/freetype-src/src/gzip/ftgzip.c | 62 |
1 files changed, 30 insertions, 32 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/src/gzip/ftgzip.c b/Build/source/libs/freetype2/freetype-src/src/gzip/ftgzip.c index 34bbe4dafac..8f98a7d17ba 100644 --- a/Build/source/libs/freetype2/freetype-src/src/gzip/ftgzip.c +++ b/Build/source/libs/freetype2/freetype-src/src/gzip/ftgzip.c @@ -8,7 +8,7 @@ * parse compressed PCF fonts, as found with many X11 server * distributions. * - * Copyright (C) 2002-2022 by + * Copyright (C) 2002-2021 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -69,21 +69,10 @@ /* */ /* so that configuration with `FT_CONFIG_OPTION_SYSTEM_ZLIB' might */ /* include the wrong `zconf.h' file, leading to errors. */ +#include "zlib.h" - /* `HAVE_HIDDEN` should be defined if */ - /* */ - /* __attribute__((visibility("hidden"))) */ - /* */ - /* is supported by the compiler, which prevents internal symbols from */ - /* being exported by the library. */ -#if defined( __GNUC__ ) || defined( __clang__ ) -#define HAVE_HIDDEN 1 -#define ZEXPORT -#define ZEXTERN static -#endif - -#define Z_SOLO 1 -#define Z_FREETYPE 1 +#undef SLOW +#define SLOW 1 /* we can't use asm-optimized sources here! */ #if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */ /* We disable the warning `conversion from XXX to YYY, */ @@ -94,23 +83,24 @@ #pragma warning( disable : 4244 ) #endif /* _MSC_VER */ -#if defined( __GNUC__ ) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wstrict-prototypes" -#pragma GCC diagnostic ignored "-Wimplicit-fallthrough" -#pragma GCC diagnostic ignored "-Wredundant-decls" -#endif - + /* Urgh. `inflate_mask' must not be declared twice -- C++ doesn't like + this. We temporarily disable it and load all necessary header files. */ +#define NO_INFLATE_MASK +#include "zutil.h" +#include "inftrees.h" +#include "infblock.h" +#include "infcodes.h" +#include "infutil.h" +#undef NO_INFLATE_MASK + + /* infutil.c must be included before infcodes.c */ #include "zutil.c" -#include "inffast.c" -#include "inflate.c" #include "inftrees.c" +#include "infutil.c" +#include "infcodes.c" +#include "infblock.c" +#include "inflate.c" #include "adler32.c" -#include "crc32.c" - -#if defined( __GNUC__ ) -#pragma GCC diagnostic pop -#endif #if defined( _MSC_VER ) #pragma warning( pop ) @@ -160,7 +150,7 @@ #if !defined( FT_CONFIG_OPTION_SYSTEM_ZLIB ) && !defined( USE_ZLIB_ZCALLOC ) - voidpf ZLIB_INTERNAL + local voidpf zcalloc ( voidpf opaque, unsigned items, unsigned size ) @@ -168,8 +158,7 @@ return ft_gzip_alloc( opaque, items, size ); } - - void ZLIB_INTERNAL + local void zcfree( voidpf opaque, voidpf ptr ) { @@ -762,7 +751,16 @@ stream.zfree = ft_gzip_free; stream.opaque = memory; + /* This is a temporary fix and will be removed once the internal + * copy of zlib is updated to the newest version. The `|32' flag + * is only supported in the new versions of zlib to enable gzip + * encoded header. + */ +#ifdef FT_CONFIG_OPTION_SYSTEM_ZLIB err = inflateInit2( &stream, MAX_WBITS|32 ); +#else + err = inflateInit2( &stream, MAX_WBITS ); +#endif if ( err != Z_OK ) return FT_THROW( Invalid_Argument ); |