freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Git][freetype/freetype][master] 2 commits: * src/gzip/ftzconf.h: Update


From: Werner Lemberg (@wl)
Subject: [Git][freetype/freetype][master] 2 commits: * src/gzip/ftzconf.h: Updated to zlib 1.2.13.
Date: Wed, 14 Dec 2022 09:48:49 +0000

Werner Lemberg pushed to branch master at FreeType / FreeType

Commits:

  • bc3aa767
    by Werner Lemberg at 2022-12-14T10:32:53+01:00
    * src/gzip/ftzconf.h: Updated to zlib 1.2.13.
    
    I forgot to copy that file.
    
  • ace97a02
    by David Vanderson at 2022-12-14T10:44:03+01:00
    [gzip] Make static compilation not leak global symbols.
    
    * src/gzip/ftgzip.c (HAVE_HIDDEN): Do not define; it is no longer needed
    because everything is static.
    (HAVE_MEMCPY): Define.
    (zcalloc, zcfree): Remove no longer needed definitions (because `Z_SOLO` is
    active).
    
    * src/gzip/patches/freetype-zlib.diff: Regenerated.
    
    Fixes #1146.
    
    Co-authored-by: Werner Lemberg <wl@gnu.org>
    

12 changed files:

Changes:

  • src/gzip/README.freetype
    ... ... @@ -18,5 +18,6 @@ The files in this directory have been prepared as follows.
    18 18
     
    
    19 19
      - Take the unmodified source code files from the zlib distribution that are
    
    20 20
        included by `ftgzip.c`.
    
    21
    + - Copy `zconf.h` to `ftzconf.h` (which stays unmodified otherwise).
    
    21 22
      - Run zlib's `zlib2ansi` script on all `.c` files.
    
    22 23
      - Apply the diff file(s) in the `patches` folder.

  • src/gzip/crc32.c
    ... ... @@ -103,9 +103,11 @@
    103 103
     #  define ARMCRC32
    
    104 104
     #endif
    
    105 105
     
    
    106
    +#ifndef Z_FREETYPE
    
    106 107
     /* Local functions. */
    
    107 108
     local z_crc_t multmodp OF((z_crc_t a, z_crc_t b));
    
    108 109
     local z_crc_t x2nmodp OF((z_off64_t n, unsigned k));
    
    110
    +#endif  /* Z_FREETYPE */
    
    109 111
     
    
    110 112
     #if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE))
    
    111 113
         local z_word_t byte_swap OF((z_word_t word));
    
    ... ... @@ -544,6 +546,8 @@ local void braid(ltl, big, n, w)
    544 546
      * generation above.
    
    545 547
      */
    
    546 548
     
    
    549
    +#ifndef Z_FREETYPE
    
    550
    +
    
    547 551
     /*
    
    548 552
       Return a(x) multiplied by b(x) modulo p(x), where p(x) is the CRC polynomial,
    
    549 553
       reflected. For speed, this requires that a not be zero.
    
    ... ... @@ -600,6 +604,8 @@ const z_crc_t FAR * ZEXPORT get_crc_table()
    600 604
         return (const z_crc_t FAR *)crc_table;
    
    601 605
     }
    
    602 606
     
    
    607
    +#endif  /* Z_FREETYPE */
    
    608
    +
    
    603 609
     /* =========================================================================
    
    604 610
      * Use ARM machine instructions if available. This will compute the CRC about
    
    605 611
      * ten times faster than the braided calculation. This code does not check for
    
    ... ... @@ -1077,6 +1083,8 @@ unsigned long ZEXPORT crc32(
    1077 1083
         return crc32_z(crc, buf, len);
    
    1078 1084
     }
    
    1079 1085
     
    
    1086
    +#ifndef Z_FREETYPE
    
    1087
    +
    
    1080 1088
     /* ========================================================================= */
    
    1081 1089
     uLong ZEXPORT crc32_combine64(
    
    1082 1090
         uLong crc1,
    
    ... ... @@ -1123,3 +1131,5 @@ uLong ZEXPORT crc32_combine_op(
    1123 1131
     {
    
    1124 1132
         return multmodp(op, crc1) ^ (crc2 & 0xffffffff);
    
    1125 1133
     }
    
    1134
    +
    
    1135
    +#endif  /* Z_FREETYPE */

  • src/gzip/ftgzip.c
    ... ... @@ -70,20 +70,14 @@
    70 70
       /* so that configuration with `FT_CONFIG_OPTION_SYSTEM_ZLIB' might   */
    
    71 71
       /* include the wrong `zconf.h' file, leading to errors.              */
    
    72 72
     
    
    73
    -  /* `HAVE_HIDDEN` should be defined if                                 */
    
    74
    -  /*                                                                    */
    
    75
    -  /*   __attribute__((visibility("hidden")))                            */
    
    76
    -  /*                                                                    */
    
    77
    -  /* is supported by the compiler, which prevents internal symbols from */
    
    78
    -  /* being exported by the library.                                     */
    
    79 73
     #if defined( __GNUC__ ) ||  defined( __clang__ )
    
    80
    -#define HAVE_HIDDEN  1
    
    81 74
     #define ZEXPORT
    
    82 75
     #define ZEXTERN      static
    
    83 76
     #endif
    
    84 77
     
    
    85
    -#define Z_SOLO      1
    
    86
    -#define Z_FREETYPE  1
    
    78
    +#define HAVE_MEMCPY  1
    
    79
    +#define Z_SOLO       1
    
    80
    +#define Z_FREETYPE   1
    
    87 81
     
    
    88 82
     #if defined( _MSC_VER )      /* Visual C++ (and Intel C++)   */
    
    89 83
       /* We disable the warning `conversion from XXX to YYY,     */
    
    ... ... @@ -157,28 +151,6 @@
    157 151
         FT_MEM_FREE( address );
    
    158 152
       }
    
    159 153
     
    
    160
    -
    
    161
    -#if !defined( FT_CONFIG_OPTION_SYSTEM_ZLIB ) && !defined( USE_ZLIB_ZCALLOC )
    
    162
    -
    
    163
    -  voidpf ZLIB_INTERNAL
    
    164
    -  zcalloc ( voidpf    opaque,
    
    165
    -            unsigned  items,
    
    166
    -            unsigned  size )
    
    167
    -  {
    
    168
    -    return ft_gzip_alloc( opaque, items, size );
    
    169
    -  }
    
    170
    -
    
    171
    -
    
    172
    -  void ZLIB_INTERNAL
    
    173
    -  zcfree( voidpf  opaque,
    
    174
    -          voidpf  ptr )
    
    175
    -  {
    
    176
    -    ft_gzip_free( opaque, ptr );
    
    177
    -  }
    
    178
    -
    
    179
    -#endif /* !SYSTEM_ZLIB && !USE_ZLIB_ZCALLOC */
    
    180
    -
    
    181
    -
    
    182 154
     /***************************************************************************/
    
    183 155
     /***************************************************************************/
    
    184 156
     /*****                                                                 *****/
    

  • src/gzip/ftzconf.h
    ... ... @@ -38,6 +38,9 @@
    38 38
     #  define crc32                 z_crc32
    
    39 39
     #  define crc32_combine         z_crc32_combine
    
    40 40
     #  define crc32_combine64       z_crc32_combine64
    
    41
    +#  define crc32_combine_gen     z_crc32_combine_gen
    
    42
    +#  define crc32_combine_gen64   z_crc32_combine_gen64
    
    43
    +#  define crc32_combine_op      z_crc32_combine_op
    
    41 44
     #  define crc32_z               z_crc32_z
    
    42 45
     #  define deflate               z_deflate
    
    43 46
     #  define deflateBound          z_deflateBound
    
    ... ... @@ -349,6 +352,9 @@
    349 352
     #    ifdef FAR
    
    350 353
     #      undef FAR
    
    351 354
     #    endif
    
    355
    +#    ifndef WIN32_LEAN_AND_MEAN
    
    356
    +#      define WIN32_LEAN_AND_MEAN
    
    357
    +#    endif
    
    352 358
     #    include <windows.h>
    
    353 359
          /* No need for _export, use ZLIB.DEF instead. */
    
    354 360
          /* For complete Windows compatibility, use WINAPI, not __stdcall. */
    
    ... ... @@ -467,11 +473,18 @@ typedef uLong FAR uLongf;
    467 473
     #  undef _LARGEFILE64_SOURCE
    
    468 474
     #endif
    
    469 475
     
    
    470
    -#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
    
    471
    -#  define Z_HAVE_UNISTD_H
    
    476
    +#ifndef Z_HAVE_UNISTD_H
    
    477
    +#  ifdef __WATCOMC__
    
    478
    +#    define Z_HAVE_UNISTD_H
    
    479
    +#  endif
    
    480
    +#endif
    
    481
    +#ifndef Z_HAVE_UNISTD_H
    
    482
    +#  if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32)
    
    483
    +#    define Z_HAVE_UNISTD_H
    
    484
    +#  endif
    
    472 485
     #endif
    
    473 486
     #ifndef Z_SOLO
    
    474
    -#  if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
    
    487
    +#  if defined(Z_HAVE_UNISTD_H)
    
    475 488
     #    include <unistd.h>         /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
    
    476 489
     #    ifdef VMS
    
    477 490
     #      include <unixio.h>       /* for off_t */
    

  • src/gzip/inffast.h
    ... ... @@ -8,4 +8,4 @@
    8 8
        subject to change. Applications should only use zlib.h.
    
    9 9
      */
    
    10 10
     
    
    11
    -void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));
    11
    +static void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));

  • src/gzip/inflate.c
    ... ... @@ -241,6 +241,8 @@ int ZEXPORT inflateInit2_(
    241 241
         return ret;
    
    242 242
     }
    
    243 243
     
    
    244
    +#ifndef Z_FREETYPE
    
    245
    +
    
    244 246
     int ZEXPORT inflateInit_(
    
    245 247
         z_streamp strm,
    
    246 248
         const char *version,
    
    ... ... @@ -249,8 +251,6 @@ int ZEXPORT inflateInit_(
    249 251
         return inflateInit2_(strm, DEF_WBITS, version, stream_size);
    
    250 252
     }
    
    251 253
     
    
    252
    -#ifndef Z_FREETYPE
    
    253
    -
    
    254 254
     int ZEXPORT inflatePrime(
    
    255 255
         z_streamp strm,
    
    256 256
         int bits,
    
    ... ... @@ -1482,8 +1482,6 @@ int ZEXPORT inflateSync(
    1482 1482
         return Z_OK;
    
    1483 1483
     }
    
    1484 1484
     
    
    1485
    -#endif  /* !Z_FREETYPE */
    
    1486
    -
    
    1487 1485
     /*
    
    1488 1486
        Returns true if inflate is currently at the end of a block generated by
    
    1489 1487
        Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
    
    ... ... @@ -1502,8 +1500,6 @@ int ZEXPORT inflateSyncPoint(
    1502 1500
         return state->mode == STORED && state->bits == 0;
    
    1503 1501
     }
    
    1504 1502
     
    
    1505
    -#ifndef Z_FREETYPE
    
    1506
    -
    
    1507 1503
     int ZEXPORT inflateCopy(
    
    1508 1504
         z_streamp dest,
    
    1509 1505
         z_streamp source)
    
    ... ... @@ -1551,8 +1547,6 @@ int ZEXPORT inflateCopy(
    1551 1547
         return Z_OK;
    
    1552 1548
     }
    
    1553 1549
     
    
    1554
    -#endif  /* !Z_FREETYPE */
    
    1555
    -
    
    1556 1550
     int ZEXPORT inflateUndermine(
    
    1557 1551
         z_streamp strm,
    
    1558 1552
         int subvert)
    
    ... ... @@ -1586,8 +1580,6 @@ int ZEXPORT inflateValidate(
    1586 1580
         return Z_OK;
    
    1587 1581
     }
    
    1588 1582
     
    
    1589
    -#ifndef Z_FREETYPE
    
    1590
    -
    
    1591 1583
     long ZEXPORT inflateMark(
    
    1592 1584
         z_streamp strm)
    
    1593 1585
     {
    

  • src/gzip/inftrees.c
    ... ... @@ -8,7 +8,7 @@
    8 8
     
    
    9 9
     #define MAXBITS 15
    
    10 10
     
    
    11
    -const char inflate_copyright[] =
    
    11
    +static const char inflate_copyright[] =
    
    12 12
        " inflate 1.2.13 Copyright 1995-2022 Mark Adler ";
    
    13 13
     /*
    
    14 14
       If you use the zlib library in a product, an acknowledgment is welcome
    

  • src/gzip/inftrees.h
    ... ... @@ -60,7 +60,7 @@ typedef enum {
    60 60
         DISTS
    
    61 61
     } codetype;
    
    62 62
     
    
    63
    -int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
    
    63
    +static int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
    
    64 64
                                  unsigned codes, code FAR * FAR *table,
    
    65 65
                                  unsigned FAR *bits, unsigned short FAR *work));
    
    66 66
     
    

  • src/gzip/patches/freetype-zlib.diff
    ... ... @@ -3,19 +3,22 @@
    3 3
     We must ensure that they do not issue compiler errors or warnings when they
    
    4 4
     are compiled as part of `src/gzip/ftgzip.c`.
    
    5 5
     
    
    6
    -* src/gzip/adler32.c: Do not define unused functions when `Z_FREETYPE`
    
    7
    -is set.
    
    8
    -
    
    9 6
     * src/gzip/gzguts.h (COPY): Rename to...
    
    10 7
     (COPY__): ... this since `COPY` and `COPY_` conflict with enum values,
    
    11 8
     which have the same name in `zlib.h`.
    
    12 9
     
    
    13
    -* src/gzip/inflate.c, src/gzip/adler32.c: Omit unused function
    
    14
    -declarations when `Z_FREETYPE` is defined.
    
    10
    +* src/gzip/inflate.c, src/gzip/adler32.c, src/gzip/crc32.c,
    
    11
    +src/gzip/zutil.c: Omit unused function declarations and definitions when
    
    12
    +`Z_FREETYPE` is defined.
    
    13
    +
    
    14
    +* src/gzip/inffast.h (inflate_fast): Declare as static.
    
    15
    +
    
    16
    +* src/gzip/inftrees.c (inflate_copyright): Declare as static.
    
    15 17
     
    
    16 18
     * src/gzip/zlib.h: Include `ftzconf.h` instead of `zconf.h` to avoid
    
    17 19
     conflicts with system-installed headers.
    
    18 20
     Omit unused function declarations when `Z_FREETYPE` is defined.
    
    21
    +(inflateInit2)[Z_FREETYPE]: Provide proper declaration.
    
    19 22
     
    
    20 23
     * src/gzip/zutil.h: Use `ft_memxxx` functions instead of `memxxx`.
    
    21 24
     Omit unused function declarations when `Z_FREETYPE` is defined.
    
    ... ... @@ -23,10 +26,13 @@ Omit unused function declarations when `Z_FREETYPE` is defined.
    23 26
     * src/gzip/inflate.h, src/gzip/inftrees.h: Add header guard macros to
    
    24 27
     prevent compiler errors.
    
    25 28
     
    
    26
    -diff --git a/src/gzip/adler32.c b/src/gzip/adler32.c
    
    29
    +* src/gzip/inftrees.h: Add header guard macros to prevent compiler errors.
    
    30
    +(inflate_table): Declare as static.
    
    31
    +
    
    32
    +diff --git b/src/gzip/adler32.c a/src/gzip/adler32.c
    
    27 33
     index be5e8a247..aa032e1dd 100644
    
    28
    ---- a/src/gzip/adler32.c
    
    29
    -+++ b/src/gzip/adler32.c
    
    34
    +--- b/src/gzip/adler32.c
    
    35
    ++++ a/src/gzip/adler32.c
    
    30 36
     @@ -7,7 +7,9 @@
    
    31 37
      
    
    32 38
      #include "zutil.h"
    
    ... ... @@ -52,10 +58,59 @@ index be5e8a247..aa032e1dd 100644
    52 58
      }
    
    53 59
     +
    
    54 60
     +#endif  /* !Z_FREETYPE */
    
    55
    -diff --git a/src/gzip/gzguts.h b/src/gzip/gzguts.h
    
    61
    +diff --git b/src/gzip/crc32.c a/src/gzip/crc32.c
    
    62
    +index 3a52aa89d..6cd1b09d5 100644
    
    63
    +--- b/src/gzip/crc32.c
    
    64
    ++++ a/src/gzip/crc32.c
    
    65
    +@@ -103,9 +103,11 @@
    
    66
    + #  define ARMCRC32
    
    67
    + #endif
    
    68
    + 
    
    69
    ++#ifndef Z_FREETYPE
    
    70
    + /* Local functions. */
    
    71
    + local z_crc_t multmodp OF((z_crc_t a, z_crc_t b));
    
    72
    + local z_crc_t x2nmodp OF((z_off64_t n, unsigned k));
    
    73
    ++#endif  /* Z_FREETYPE */
    
    74
    + 
    
    75
    + #if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE))
    
    76
    +     local z_word_t byte_swap OF((z_word_t word));
    
    77
    +@@ -544,6 +546,8 @@ local void braid(ltl, big, n, w)
    
    78
    +  * generation above.
    
    79
    +  */
    
    80
    + 
    
    81
    ++#ifndef Z_FREETYPE
    
    82
    ++
    
    83
    + /*
    
    84
    +   Return a(x) multiplied by b(x) modulo p(x), where p(x) is the CRC polynomial,
    
    85
    +   reflected. For speed, this requires that a not be zero.
    
    86
    +@@ -600,6 +604,8 @@ const z_crc_t FAR * ZEXPORT get_crc_table()
    
    87
    +     return (const z_crc_t FAR *)crc_table;
    
    88
    + }
    
    89
    + 
    
    90
    ++#endif  /* Z_FREETYPE */
    
    91
    ++
    
    92
    + /* =========================================================================
    
    93
    +  * Use ARM machine instructions if available. This will compute the CRC about
    
    94
    +  * ten times faster than the braided calculation. This code does not check for
    
    95
    +@@ -1077,6 +1083,8 @@ unsigned long ZEXPORT crc32(
    
    96
    +     return crc32_z(crc, buf, len);
    
    97
    + }
    
    98
    + 
    
    99
    ++#ifndef Z_FREETYPE
    
    100
    ++
    
    101
    + /* ========================================================================= */
    
    102
    + uLong ZEXPORT crc32_combine64(
    
    103
    +     uLong crc1,
    
    104
    +@@ -1123,3 +1131,5 @@ uLong ZEXPORT crc32_combine_op(
    
    105
    + {
    
    106
    +     return multmodp(op, crc1) ^ (crc2 & 0xffffffff);
    
    107
    + }
    
    108
    ++
    
    109
    ++#endif  /* Z_FREETYPE */
    
    110
    +diff --git b/src/gzip/gzguts.h a/src/gzip/gzguts.h
    
    56 111
     index 57faf3716..4f09a52a7 100644
    
    57
    ---- a/src/gzip/gzguts.h
    
    58
    -+++ b/src/gzip/gzguts.h
    
    112
    +--- b/src/gzip/gzguts.h
    
    113
    ++++ a/src/gzip/gzguts.h
    
    59 114
     @@ -163,7 +163,7 @@
    
    60 115
      
    
    61 116
      /* values for gz_state how */
    
    ... ... @@ -65,10 +120,20 @@ index 57faf3716..4f09a52a7 100644
    65 120
      #define GZIP 2      /* decompress a gzip stream */
    
    66 121
      
    
    67 122
      /* internal gzip file state data structure */
    
    68
    -diff --git a/src/gzip/inflate.c b/src/gzip/inflate.c
    
    69
    -index c9e566b03..33c7cf2fe 100644
    
    70
    ---- a/src/gzip/inflate.c
    
    71
    -+++ b/src/gzip/inflate.c
    
    123
    +diff --git b/src/gzip/inffast.h a/src/gzip/inffast.h
    
    124
    +index e5c1aa4ca..684ae878c 100644
    
    125
    +--- b/src/gzip/inffast.h
    
    126
    ++++ a/src/gzip/inffast.h
    
    127
    +@@ -8,4 +8,4 @@
    
    128
    +    subject to change. Applications should only use zlib.h.
    
    129
    +  */
    
    130
    + 
    
    131
    +-void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));
    
    132
    ++static void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));
    
    133
    +diff --git b/src/gzip/inflate.c a/src/gzip/inflate.c
    
    134
    +index c9e566b03..5117e2e26 100644
    
    135
    +--- b/src/gzip/inflate.c
    
    136
    ++++ a/src/gzip/inflate.c
    
    72 137
     @@ -99,8 +99,10 @@ local int updatewindow OF((z_streamp strm, const unsigned char FAR *end,
    
    73 138
      #ifdef BUILDFIXED
    
    74 139
         void makefixed OF((void));
    
    ... ... @@ -80,15 +145,15 @@ index c9e566b03..33c7cf2fe 100644
    80 145
      
    
    81 146
      local int inflateStateCheck(
    
    82 147
          z_streamp strm)
    
    83
    -@@ -247,6 +249,8 @@ int ZEXPORT inflateInit_(
    
    84
    -     return inflateInit2_(strm, DEF_WBITS, version, stream_size);
    
    148
    +@@ -239,6 +241,8 @@ int ZEXPORT inflateInit2_(
    
    149
    +     return ret;
    
    85 150
      }
    
    86 151
      
    
    87 152
     +#ifndef Z_FREETYPE
    
    88 153
     +
    
    89
    - int ZEXPORT inflatePrime(
    
    154
    + int ZEXPORT inflateInit_(
    
    90 155
          z_streamp strm,
    
    91
    -     int bits,
    
    156
    +     const char *version,
    
    92 157
     @@ -268,6 +272,8 @@ int ZEXPORT inflatePrime(
    
    93 158
          return Z_OK;
    
    94 159
      }
    
    ... ... @@ -107,52 +172,16 @@ index c9e566b03..33c7cf2fe 100644
    107 172
      int ZEXPORT inflateGetDictionary(
    
    108 173
          z_streamp strm,
    
    109 174
          Bytef *dictionary,
    
    110
    -@@ -1474,6 +1482,8 @@ int ZEXPORT inflateSync(
    
    111
    -     return Z_OK;
    
    112
    - }
    
    113
    - 
    
    114
    -+#endif  /* !Z_FREETYPE */
    
    115
    -+
    
    116
    - /*
    
    117
    -    Returns true if inflate is currently at the end of a block generated by
    
    118
    -    Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
    
    119
    -@@ -1492,6 +1502,8 @@ int ZEXPORT inflateSyncPoint(
    
    120
    -     return state->mode == STORED && state->bits == 0;
    
    121
    - }
    
    122
    - 
    
    123
    -+#ifndef Z_FREETYPE
    
    124
    -+
    
    125
    - int ZEXPORT inflateCopy(
    
    126
    -     z_streamp dest,
    
    127
    -     z_streamp source)
    
    128
    -@@ -1539,6 +1551,8 @@ int ZEXPORT inflateCopy(
    
    129
    -     return Z_OK;
    
    130
    - }
    
    131
    - 
    
    132
    -+#endif  /* !Z_FREETYPE */
    
    133
    -+
    
    134
    - int ZEXPORT inflateUndermine(
    
    135
    -     z_streamp strm,
    
    136
    -     int subvert)
    
    137
    -@@ -1572,6 +1586,8 @@ int ZEXPORT inflateValidate(
    
    138
    -     return Z_OK;
    
    139
    - }
    
    140
    - 
    
    141
    -+#ifndef Z_FREETYPE
    
    142
    -+
    
    143
    - long ZEXPORT inflateMark(
    
    144
    -     z_streamp strm)
    
    145
    - {
    
    146
    -@@ -1593,3 +1609,5 @@ unsigned long ZEXPORT inflateCodesUsed(
    
    175
    +@@ -1593,3 +1601,5 @@ unsigned long ZEXPORT inflateCodesUsed(
    
    147 176
          state = (struct inflate_state FAR *)strm->state;
    
    148 177
          return (unsigned long)(state->next - state->codes);
    
    149 178
      }
    
    150 179
     +
    
    151 180
     +#endif  /* !Z_FREETYPE */
    
    152
    -diff --git a/src/gzip/inflate.h b/src/gzip/inflate.h
    
    181
    +diff --git b/src/gzip/inflate.h a/src/gzip/inflate.h
    
    153 182
     index f127b6b1f..c6f5a52e1 100644
    
    154
    ---- a/src/gzip/inflate.h
    
    155
    -+++ b/src/gzip/inflate.h
    
    183
    +--- b/src/gzip/inflate.h
    
    184
    ++++ a/src/gzip/inflate.h
    
    156 185
     @@ -3,6 +3,9 @@
    
    157 186
       * For conditions of distribution and use, see copyright notice in zlib.h
    
    158 187
       */
    
    ... ... @@ -169,10 +198,23 @@ index f127b6b1f..c6f5a52e1 100644
    169 198
      };
    
    170 199
     +
    
    171 200
     +#endif  /* INFLATE_H */
    
    172
    -diff --git a/src/gzip/inftrees.h b/src/gzip/inftrees.h
    
    173
    -index f53665311..2daa00063 100644
    
    174
    ---- a/src/gzip/inftrees.h
    
    175
    -+++ b/src/gzip/inftrees.h
    
    201
    +diff --git b/src/gzip/inftrees.c a/src/gzip/inftrees.c
    
    202
    +index d8405a24c..dd4965e9a 100644
    
    203
    +--- b/src/gzip/inftrees.c
    
    204
    ++++ a/src/gzip/inftrees.c
    
    205
    +@@ -8,7 +8,7 @@
    
    206
    + 
    
    207
    + #define MAXBITS 15
    
    208
    + 
    
    209
    +-const char inflate_copyright[] =
    
    210
    ++static const char inflate_copyright[] =
    
    211
    +    " inflate 1.2.13 Copyright 1995-2022 Mark Adler ";
    
    212
    + /*
    
    213
    +   If you use the zlib library in a product, an acknowledgment is welcome
    
    214
    +diff --git b/src/gzip/inftrees.h a/src/gzip/inftrees.h
    
    215
    +index f53665311..a2207efb1 100644
    
    216
    +--- b/src/gzip/inftrees.h
    
    217
    ++++ a/src/gzip/inftrees.h
    
    176 218
     @@ -3,6 +3,9 @@
    
    177 219
       * For conditions of distribution and use, see copyright notice in zlib.h
    
    178 220
       */
    
    ... ... @@ -183,16 +225,20 @@ index f53665311..2daa00063 100644
    183 225
      /* WARNING: this file should *not* be used by applications. It is
    
    184 226
         part of the implementation of the compression library and is
    
    185 227
         subject to change. Applications should only use zlib.h.
    
    186
    -@@ -60,3 +63,5 @@ typedef enum {
    
    187
    - int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
    
    228
    +@@ -57,6 +60,8 @@ typedef enum {
    
    229
    +     DISTS
    
    230
    + } codetype;
    
    231
    + 
    
    232
    +-int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
    
    233
    ++static int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
    
    188 234
                                   unsigned codes, code FAR * FAR *table,
    
    189 235
                                   unsigned FAR *bits, unsigned short FAR *work));
    
    190 236
     +
    
    191 237
     +#endif  /* INFTREES_H_ */
    
    192
    -diff --git a/src/gzip/zlib.h b/src/gzip/zlib.h
    
    193
    -index 953cb5012..bbbf75151 100644
    
    194
    ---- a/src/gzip/zlib.h
    
    195
    -+++ b/src/gzip/zlib.h
    
    238
    +diff --git b/src/gzip/zlib.h a/src/gzip/zlib.h
    
    239
    +index 953cb5012..3f2f76e3c 100644
    
    240
    +--- b/src/gzip/zlib.h
    
    241
    ++++ a/src/gzip/zlib.h
    
    196 242
     @@ -31,7 +31,7 @@
    
    197 243
      #ifndef ZLIB_H
    
    198 244
      #define ZLIB_H
    
    ... ... @@ -211,15 +257,7 @@ index 953cb5012..bbbf75151 100644
    211 257
      #define zlib_version zlibVersion()
    
    212 258
      /* for compatibility with versions < 1.0.2 */
    
    213 259
      
    
    214
    -@@ -246,7 +248,6 @@ ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
    
    215
    -    this will be done by deflate().
    
    216
    - */
    
    217
    - 
    
    218
    --
    
    219
    - ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
    
    220
    - /*
    
    221
    -     deflate compresses as much data as possible, and stops when the input
    
    222
    -@@ -373,6 +374,7 @@ ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
    
    260
    +@@ -373,6 +375,7 @@ ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
    
    223 261
         deallocated).
    
    224 262
      */
    
    225 263
      
    
    ... ... @@ -227,7 +265,7 @@ index 953cb5012..bbbf75151 100644
    227 265
      
    
    228 266
      /*
    
    229 267
      ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
    
    230
    -@@ -534,6 +536,8 @@ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
    
    268
    +@@ -534,6 +537,8 @@ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
    
    231 269
          The following functions are needed only in some special applications.
    
    232 270
      */
    
    233 271
      
    
    ... ... @@ -236,7 +274,7 @@ index 953cb5012..bbbf75151 100644
    236 274
      /*
    
    237 275
      ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
    
    238 276
                                           int  level,
    
    239
    -@@ -956,6 +960,8 @@ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
    
    277
    +@@ -956,6 +961,8 @@ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
    
    240 278
         destination.
    
    241 279
      */
    
    242 280
      
    
    ... ... @@ -245,7 +283,7 @@ index 953cb5012..bbbf75151 100644
    245 283
      ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
    
    246 284
      /*
    
    247 285
           This function is equivalent to inflateEnd followed by inflateInit,
    
    248
    -@@ -980,6 +986,8 @@ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
    
    286
    +@@ -980,6 +987,8 @@ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
    
    249 287
         the windowBits parameter is invalid.
    
    250 288
      */
    
    251 289
      
    
    ... ... @@ -254,7 +292,7 @@ index 953cb5012..bbbf75151 100644
    254 292
      ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
    
    255 293
                                           int bits,
    
    256 294
                                           int value));
    
    257
    -@@ -1069,6 +1077,8 @@ ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
    
    295
    +@@ -1069,6 +1078,8 @@ ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
    
    258 296
         stream state was inconsistent.
    
    259 297
      */
    
    260 298
      
    
    ... ... @@ -263,7 +301,7 @@ index 953cb5012..bbbf75151 100644
    263 301
      /*
    
    264 302
      ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
    
    265 303
                                              unsigned char FAR *window));
    
    266
    -@@ -1095,6 +1105,8 @@ typedef unsigned (*in_func) OF((void FAR *,
    
    304
    +@@ -1095,6 +1106,8 @@ typedef unsigned (*in_func) OF((void FAR *,
    
    267 305
                                      z_const unsigned char FAR * FAR *));
    
    268 306
      typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
    
    269 307
      
    
    ... ... @@ -272,7 +310,7 @@ index 953cb5012..bbbf75151 100644
    272 310
      ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
    
    273 311
                                          in_func in, void FAR *in_desc,
    
    274 312
                                          out_func out, void FAR *out_desc));
    
    275
    -@@ -1214,6 +1226,8 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
    
    313
    +@@ -1214,6 +1227,8 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
    
    276 314
           27-31: 0 (reserved)
    
    277 315
       */
    
    278 316
      
    
    ... ... @@ -281,16 +319,16 @@ index 953cb5012..bbbf75151 100644
    281 319
      #ifndef Z_SOLO
    
    282 320
      
    
    283 321
                              /* utility functions */
    
    284
    -@@ -1742,6 +1756,8 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
    
    285
    -      if (crc != original_crc) error();
    
    322
    +@@ -1765,6 +1780,8 @@ ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2));
    
    323
    +    crc32_combine_op().
    
    286 324
      */
    
    287 325
      
    
    288 326
     +#ifndef Z_FREETYPE
    
    289 327
     +
    
    290
    - ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf,
    
    291
    -                                   z_size_t len));
    
    328
    + ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op));
    
    292 329
      /*
    
    293
    -@@ -1822,6 +1838,19 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
    
    330
    +      Give the same result as crc32_combine(), using op in place of len2. op is
    
    331
    +@@ -1822,6 +1839,19 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
    
    294 332
                                 ZLIB_VERSION, (int)sizeof(z_stream))
    
    295 333
      #endif
    
    296 334
      
    
    ... ... @@ -310,7 +348,7 @@ index 953cb5012..bbbf75151 100644
    310 348
      #ifndef Z_SOLO
    
    311 349
      
    
    312 350
      /* gzgetc() macro and its supporting function and exposed data structure.  Note
    
    313
    -@@ -1901,13 +1930,16 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file));  /* backward compatibility */
    
    351
    +@@ -1901,20 +1931,25 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file));  /* backward compatibility */
    
    314 352
      
    
    315 353
      #else /* Z_SOLO */
    
    316 354
      
    
    ... ... @@ -327,7 +365,16 @@ index 953cb5012..bbbf75151 100644
    327 365
      ZEXTERN const char   * ZEXPORT zError           OF((int));
    
    328 366
      ZEXTERN int            ZEXPORT inflateSyncPoint OF((z_streamp));
    
    329 367
      ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table    OF((void));
    
    330
    -@@ -1927,6 +1959,7 @@ ZEXTERN int            ZEXPORTVA gzvprintf Z_ARG((gzFile file,
    
    368
    + ZEXTERN int            ZEXPORT inflateUndermine OF((z_streamp, int));
    
    369
    + ZEXTERN int            ZEXPORT inflateValidate OF((z_streamp, int));
    
    370
    + ZEXTERN unsigned long  ZEXPORT inflateCodesUsed OF((z_streamp));
    
    371
    ++#endif  /* !Z_FREETYPE */
    
    372
    + ZEXTERN int            ZEXPORT inflateResetKeep OF((z_streamp));
    
    373
    ++#ifndef Z_FREETYPE
    
    374
    + ZEXTERN int            ZEXPORT deflateResetKeep OF((z_streamp));
    
    375
    + #if defined(_WIN32) && !defined(Z_SOLO)
    
    376
    + ZEXTERN gzFile         ZEXPORT gzopen_w OF((const wchar_t *path,
    
    377
    +@@ -1927,6 +1962,7 @@ ZEXTERN int            ZEXPORTVA gzvprintf Z_ARG((gzFile file,
    
    331 378
                                                        va_list va));
    
    332 379
      #  endif
    
    333 380
      #endif
    
    ... ... @@ -335,11 +382,61 @@ index 953cb5012..bbbf75151 100644
    335 382
      
    
    336 383
      #ifdef __cplusplus
    
    337 384
      }
    
    338
    -diff --git a/src/gzip/zutil.h b/src/gzip/zutil.h
    
    339
    -index 0bc7f4ecd..d309bd069 100644
    
    340
    ---- a/src/gzip/zutil.h
    
    341
    -+++ b/src/gzip/zutil.h
    
    342
    -@@ -188,6 +188,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
    
    385
    +diff --git b/src/gzip/zutil.c a/src/gzip/zutil.c
    
    386
    +index ef174ca64..542706ca0 100644
    
    387
    +--- b/src/gzip/zutil.c
    
    388
    ++++ a/src/gzip/zutil.c
    
    389
    +@@ -10,6 +10,8 @@
    
    390
    + #  include "gzguts.h"
    
    391
    + #endif
    
    392
    + 
    
    393
    ++#ifndef Z_FREETYPE
    
    394
    ++
    
    395
    + z_const char * const z_errmsg[10] = {
    
    396
    +     (z_const char *)"need dictionary",     /* Z_NEED_DICT       2  */
    
    397
    +     (z_const char *)"stream end",          /* Z_STREAM_END      1  */
    
    398
    +@@ -138,6 +140,8 @@ const char * ZEXPORT zError(
    
    399
    +     return ERR_MSG(err);
    
    400
    + }
    
    401
    + 
    
    402
    ++#endif  /* !Z_FREETYPE */
    
    403
    ++
    
    404
    + #if defined(_WIN32_WCE) && _WIN32_WCE < 0x800
    
    405
    +     /* The older Microsoft C Run-Time Library for Windows CE doesn't have
    
    406
    +      * errno.  We define it as a global variable to simplify porting.
    
    407
    +@@ -159,6 +163,8 @@ void ZLIB_INTERNAL zmemcpy(
    
    408
    +     } while (--len != 0);
    
    409
    + }
    
    410
    + 
    
    411
    ++#ifndef Z_FREETYPE
    
    412
    ++
    
    413
    + int ZLIB_INTERNAL zmemcmp(
    
    414
    +     const Bytef* s1,
    
    415
    +     const Bytef* s2,
    
    416
    +@@ -181,6 +187,7 @@ void ZLIB_INTERNAL zmemzero(
    
    417
    +         *dest++ = 0;  /* ??? to be unrolled */
    
    418
    +     } while (--len != 0);
    
    419
    + }
    
    420
    ++#endif  /* !Z_FREETYPE */
    
    421
    + #endif
    
    422
    + 
    
    423
    + #ifndef Z_SOLO
    
    424
    +diff --git b/src/gzip/zutil.h a/src/gzip/zutil.h
    
    425
    +index 0bc7f4ecd..055ba8b62 100644
    
    426
    +--- b/src/gzip/zutil.h
    
    427
    ++++ a/src/gzip/zutil.h
    
    428
    +@@ -53,8 +53,10 @@ typedef unsigned long  ulg;
    
    429
    + #  endif
    
    430
    + #endif
    
    431
    + 
    
    432
    ++#ifndef Z_FREETYPE
    
    433
    + extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
    
    434
    + /* (size given to avoid silly warnings with Visual C++) */
    
    435
    ++#endif  /* !Z_FREETYPE */
    
    436
    + 
    
    437
    + #define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
    
    438
    + 
    
    439
    +@@ -188,6 +190,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
    
    343 440
        #pragma warn -8066
    
    344 441
      #endif
    
    345 442
      
    
    ... ... @@ -348,7 +445,7 @@ index 0bc7f4ecd..d309bd069 100644
    348 445
      /* provide prototypes for these when building zlib without LFS */
    
    349 446
      #if !defined(_WIN32) && \
    
    350 447
          (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
    
    351
    -@@ -196,6 +198,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
    
    448
    +@@ -196,6 +200,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
    
    352 449
          ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t));
    
    353 450
      #endif
    
    354 451
      
    
    ... ... @@ -357,7 +454,7 @@ index 0bc7f4ecd..d309bd069 100644
    357 454
              /* common defaults */
    
    358 455
      
    
    359 456
      #ifndef OS_CODE
    
    360
    -@@ -227,9 +231,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
    
    457
    +@@ -227,9 +233,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
    
    361 458
      #    define zmemcmp _fmemcmp
    
    362 459
      #    define zmemzero(dest, len) _fmemset(dest, 0, len)
    
    363 460
      #  else
    

  • src/gzip/zlib.h
    ... ... @@ -248,6 +248,7 @@ ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
    248 248
        this will be done by deflate().
    
    249 249
     */
    
    250 250
     
    
    251
    +
    
    251 252
     ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
    
    252 253
     /*
    
    253 254
         deflate compresses as much data as possible, and stops when the input
    
    ... ... @@ -1756,8 +1757,6 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
    1756 1757
          if (crc != original_crc) error();
    
    1757 1758
     */
    
    1758 1759
     
    
    1759
    -#ifndef Z_FREETYPE
    
    1760
    -
    
    1761 1760
     ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf,
    
    1762 1761
                                       z_size_t len));
    
    1763 1762
     /*
    
    ... ... @@ -1781,6 +1780,8 @@ ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2));
    1781 1780
        crc32_combine_op().
    
    1782 1781
     */
    
    1783 1782
     
    
    1783
    +#ifndef Z_FREETYPE
    
    1784
    +
    
    1784 1785
     ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op));
    
    1785 1786
     /*
    
    1786 1787
          Give the same result as crc32_combine(), using op in place of len2. op is
    
    ... ... @@ -1946,7 +1947,9 @@ ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void));
    1946 1947
     ZEXTERN int            ZEXPORT inflateUndermine OF((z_streamp, int));
    
    1947 1948
     ZEXTERN int            ZEXPORT inflateValidate OF((z_streamp, int));
    
    1948 1949
     ZEXTERN unsigned long  ZEXPORT inflateCodesUsed OF((z_streamp));
    
    1950
    +#endif  /* !Z_FREETYPE */
    
    1949 1951
     ZEXTERN int            ZEXPORT inflateResetKeep OF((z_streamp));
    
    1952
    +#ifndef Z_FREETYPE
    
    1950 1953
     ZEXTERN int            ZEXPORT deflateResetKeep OF((z_streamp));
    
    1951 1954
     #if defined(_WIN32) && !defined(Z_SOLO)
    
    1952 1955
     ZEXTERN gzFile         ZEXPORT gzopen_w OF((const wchar_t *path,
    

  • src/gzip/zutil.c
    ... ... @@ -10,6 +10,8 @@
    10 10
     #  include "gzguts.h"
    
    11 11
     #endif
    
    12 12
     
    
    13
    +#ifndef Z_FREETYPE
    
    14
    +
    
    13 15
     z_const char * const z_errmsg[10] = {
    
    14 16
         (z_const char *)"need dictionary",     /* Z_NEED_DICT       2  */
    
    15 17
         (z_const char *)"stream end",          /* Z_STREAM_END      1  */
    
    ... ... @@ -138,6 +140,8 @@ const char * ZEXPORT zError(
    138 140
         return ERR_MSG(err);
    
    139 141
     }
    
    140 142
     
    
    143
    +#endif  /* !Z_FREETYPE */
    
    144
    +
    
    141 145
     #if defined(_WIN32_WCE) && _WIN32_WCE < 0x800
    
    142 146
         /* The older Microsoft C Run-Time Library for Windows CE doesn't have
    
    143 147
          * errno.  We define it as a global variable to simplify porting.
    
    ... ... @@ -159,6 +163,8 @@ void ZLIB_INTERNAL zmemcpy(
    159 163
         } while (--len != 0);
    
    160 164
     }
    
    161 165
     
    
    166
    +#ifndef Z_FREETYPE
    
    167
    +
    
    162 168
     int ZLIB_INTERNAL zmemcmp(
    
    163 169
         const Bytef* s1,
    
    164 170
         const Bytef* s2,
    
    ... ... @@ -181,6 +187,7 @@ void ZLIB_INTERNAL zmemzero(
    181 187
             *dest++ = 0;  /* ??? to be unrolled */
    
    182 188
         } while (--len != 0);
    
    183 189
     }
    
    190
    +#endif  /* !Z_FREETYPE */
    
    184 191
     #endif
    
    185 192
     
    
    186 193
     #ifndef Z_SOLO
    

  • src/gzip/zutil.h
    ... ... @@ -53,8 +53,10 @@ typedef unsigned long ulg;
    53 53
     #  endif
    
    54 54
     #endif
    
    55 55
     
    
    56
    +#ifndef Z_FREETYPE
    
    56 57
     extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
    
    57 58
     /* (size given to avoid silly warnings with Visual C++) */
    
    59
    +#endif  /* !Z_FREETYPE */
    
    58 60
     
    
    59 61
     #define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
    
    60 62
     
    


  • reply via email to

    [Prev in Thread] Current Thread [Next in Thread]