Skip to content

Commit 1f42361

Browse files
Starbuck5ankith26
authored andcommitted
Update libpng
Statically links in zlib now, so explicit zlib DLL can be removed.
1 parent e0c5f7a commit 1f42361

File tree

8 files changed

+573
-588
lines changed

8 files changed

+573
-588
lines changed

VisualC/external/include/png.h

Lines changed: 508 additions & 526 deletions
Large diffs are not rendered by default.

VisualC/external/include/pngconf.h

Lines changed: 53 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11

2-
/* pngconf.h - machine configurable file for libpng
2+
/* pngconf.h - machine-configurable file for libpng
33
*
4-
* libpng version 1.6.18, July 23, 2015
4+
* libpng version 1.6.41.git
55
*
6-
* Copyright (c) 1998-2015 Glenn Randers-Pehrson
7-
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
8-
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
6+
* Copyright (c) 2018-2023 Cosmin Truta
7+
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
8+
* Copyright (c) 1996-1997 Andreas Dilger
9+
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
910
*
1011
* This code is released under the libpng license.
1112
* For conditions of distribution and use, see the disclaimer
@@ -57,14 +58,13 @@
5758

5859
#endif /* PNG_BUILDING_SYMBOL_TABLE */
5960

60-
/* Prior to 1.6.0 it was possible to turn off 'const' in declarations using
61-
* PNG_NO_CONST; this is no longer supported except for data declarations which
62-
* apparently still cause problems in 2011 on some compilers.
61+
/* Prior to 1.6.0, it was possible to turn off 'const' in declarations,
62+
* using PNG_NO_CONST. This is no longer supported.
6363
*/
6464
#define PNG_CONST const /* backward compatibility only */
6565

66-
/* This controls optimization of the reading of 16 and 32 bit values
67-
* from PNG files. It can be set on a per-app-file basis - it
66+
/* This controls optimization of the reading of 16-bit and 32-bit
67+
* values from PNG files. It can be set on a per-app-file basis: it
6868
* just changes whether a macro is used when the function is called.
6969
* The library builder sets the default; if read functions are not
7070
* built into the library the macro implementation is forced on.
@@ -127,7 +127,7 @@
127127
*
128128
* These cases only differ if the operating system does not use the C
129129
* calling convention, at present this just means the above cases
130-
* (x86 DOS/Windows sytems) and, even then, this does not apply to
130+
* (x86 DOS/Windows systems) and, even then, this does not apply to
131131
* Cygwin running on those systems.
132132
*
133133
* Note that the value must be defined in pnglibconf.h so that what
@@ -180,35 +180,35 @@
180180
* compiler-specific macros to the values required to change the calling
181181
* conventions of the various functions.
182182
*/
183-
#if defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\
184-
defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
183+
#if defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || \
184+
defined(__CYGWIN__)
185185
/* Windows system (DOS doesn't support DLLs). Includes builds under Cygwin or
186186
* MinGW on any architecture currently supported by Windows. Also includes
187187
* Watcom builds but these need special treatment because they are not
188188
* compatible with GCC or Visual C because of different calling conventions.
189189
*/
190190
# if PNG_API_RULE == 2
191-
/* If this line results in an error, either because __watcall is not
192-
* understood or because of a redefine just below you cannot use *this*
193-
* build of the library with the compiler you are using. *This* build was
194-
* build using Watcom and applications must also be built using Watcom!
195-
*/
191+
/* If this line results in an error, either because __watcall is not
192+
* understood or because of a redefine just below you cannot use *this*
193+
* build of the library with the compiler you are using. *This* build was
194+
* build using Watcom and applications must also be built using Watcom!
195+
*/
196196
# define PNGCAPI __watcall
197197
# endif
198198

199199
# if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800))
200200
# define PNGCAPI __cdecl
201201
# if PNG_API_RULE == 1
202-
/* If this line results in an error __stdcall is not understood and
203-
* PNG_API_RULE should not have been set to '1'.
204-
*/
202+
/* If this line results in an error __stdcall is not understood and
203+
* PNG_API_RULE should not have been set to '1'.
204+
*/
205205
# define PNGAPI __stdcall
206206
# endif
207207
# else
208-
/* An older compiler, or one not detected (erroneously) above,
209-
* if necessary override on the command line to get the correct
210-
* variants for the compiler.
211-
*/
208+
/* An older compiler, or one not detected (erroneously) above,
209+
* if necessary override on the command line to get the correct
210+
* variants for the compiler.
211+
*/
212212
# ifndef PNGCAPI
213213
# define PNGCAPI _cdecl
214214
# endif
@@ -225,10 +225,10 @@
225225

226226
# if (defined(_MSC_VER) && _MSC_VER < 800) ||\
227227
(defined(__BORLANDC__) && __BORLANDC__ < 0x500)
228-
/* older Borland and MSC
229-
* compilers used '__export' and required this to be after
230-
* the type.
231-
*/
228+
/* older Borland and MSC
229+
* compilers used '__export' and required this to be after
230+
* the type.
231+
*/
232232
# ifndef PNG_EXPORT_TYPE
233233
# define PNG_EXPORT_TYPE(type) type PNG_IMPEXP
234234
# endif
@@ -244,9 +244,9 @@
244244
# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
245245
# define PNGAPI _System
246246
# else /* !Windows/x86 && !OS/2 */
247-
/* Use the defaults, or define PNG*API on the command line (but
248-
* this will have to be done for every compile!)
249-
*/
247+
/* Use the defaults, or define PNG*API on the command line (but
248+
* this will have to be done for every compile!)
249+
*/
250250
# endif /* other system, !OS/2 */
251251
#endif /* !Windows/x86 */
252252

@@ -267,7 +267,7 @@
267267
*/
268268
#ifndef PNG_IMPEXP
269269
# if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT)
270-
/* This forces use of a DLL, disallowing static linking */
270+
/* This forces use of a DLL, disallowing static linking */
271271
# define PNG_IMPEXP PNG_DLL_IMPORT
272272
# endif
273273

@@ -340,7 +340,7 @@
340340
* less efficient code.
341341
*/
342342
# if defined(__clang__) && defined(__has_attribute)
343-
/* Clang defines both __clang__ and __GNUC__. Check __clang__ first. */
343+
/* Clang defines both __clang__ and __GNUC__. Check __clang__ first. */
344344
# if !defined(PNG_USE_RESULT) && __has_attribute(__warn_unused_result__)
345345
# define PNG_USE_RESULT __attribute__((__warn_unused_result__))
346346
# endif
@@ -480,43 +480,45 @@
480480
#if CHAR_BIT == 8 && UCHAR_MAX == 255
481481
typedef unsigned char png_byte;
482482
#else
483-
# error "libpng requires 8 bit bytes"
483+
# error "libpng requires 8-bit bytes"
484484
#endif
485485

486486
#if INT_MIN == -32768 && INT_MAX == 32767
487487
typedef int png_int_16;
488488
#elif SHRT_MIN == -32768 && SHRT_MAX == 32767
489489
typedef short png_int_16;
490490
#else
491-
# error "libpng requires a signed 16 bit type"
491+
# error "libpng requires a signed 16-bit type"
492492
#endif
493493

494494
#if UINT_MAX == 65535
495495
typedef unsigned int png_uint_16;
496496
#elif USHRT_MAX == 65535
497497
typedef unsigned short png_uint_16;
498498
#else
499-
# error "libpng requires an unsigned 16 bit type"
499+
# error "libpng requires an unsigned 16-bit type"
500500
#endif
501501

502502
#if INT_MIN < -2147483646 && INT_MAX > 2147483646
503503
typedef int png_int_32;
504504
#elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646
505505
typedef long int png_int_32;
506506
#else
507-
# error "libpng requires a signed 32 bit (or more) type"
507+
# error "libpng requires a signed 32-bit (or more) type"
508508
#endif
509509

510-
#if UINT_MAX > 4294967294
510+
#if UINT_MAX > 4294967294U
511511
typedef unsigned int png_uint_32;
512-
#elif ULONG_MAX > 4294967294
512+
#elif ULONG_MAX > 4294967294U
513513
typedef unsigned long int png_uint_32;
514514
#else
515-
# error "libpng requires an unsigned 32 bit (or more) type"
515+
# error "libpng requires an unsigned 32-bit (or more) type"
516516
#endif
517517

518-
/* Prior to 1.6.0 it was possible to disable the use of size_t, 1.6.0, however,
519-
* requires an ISOC90 compiler and relies on consistent behavior of sizeof.
518+
/* Prior to 1.6.0, it was possible to disable the use of size_t and ptrdiff_t.
519+
* From 1.6.0 onwards, an ISO C90 compiler, as well as a standard-compliant
520+
* behavior of sizeof and ptrdiff_t are required.
521+
* The legacy typedefs are provided here for backwards compatibility.
520522
*/
521523
typedef size_t png_size_t;
522524
typedef ptrdiff_t png_ptrdiff_t;
@@ -537,13 +539,12 @@ typedef ptrdiff_t png_ptrdiff_t;
537539
# endif
538540
#endif
539541

540-
/* png_alloc_size_t is guaranteed to be no smaller than png_size_t, and no
541-
* smaller than png_uint_32. Casts from png_size_t or png_uint_32 to
542-
* png_alloc_size_t are not necessary; in fact, it is recommended not to use
543-
* them at all so that the compiler can complain when something turns out to be
544-
* problematic.
542+
/* png_alloc_size_t is guaranteed to be no smaller than size_t, and no smaller
543+
* than png_uint_32. Casts from size_t or png_uint_32 to png_alloc_size_t are
544+
* not necessary; in fact, it is recommended not to use them at all, so that
545+
* the compiler can complain when something turns out to be problematic.
545546
*
546-
* Casts in the other direction (from png_alloc_size_t to png_size_t or
547+
* Casts in the other direction (from png_alloc_size_t to size_t or
547548
* png_uint_32) should be explicitly applied; however, we do not expect to
548549
* encounter practical situations that require such conversions.
549550
*
@@ -553,7 +554,7 @@ typedef ptrdiff_t png_ptrdiff_t;
553554
#ifdef PNG_SMALL_SIZE_T
554555
typedef png_uint_32 png_alloc_size_t;
555556
#else
556-
typedef png_size_t png_alloc_size_t;
557+
typedef size_t png_alloc_size_t;
557558
#endif
558559

559560
/* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler
@@ -589,8 +590,8 @@ typedef char * png_charp;
589590
typedef const char * png_const_charp;
590591
typedef png_fixed_point * png_fixed_point_p;
591592
typedef const png_fixed_point * png_const_fixed_point_p;
592-
typedef png_size_t * png_size_tp;
593-
typedef const png_size_t * png_const_size_tp;
593+
typedef size_t * png_size_tp;
594+
typedef const size_t * png_const_size_tp;
594595

595596
#ifdef PNG_STDIO_SUPPORTED
596597
typedef FILE * png_FILE_p;

VisualC/external/include/pnglibconf.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/* pnglibconf.h - library build configuration */
22

3-
/* libpng version 1.6.18, July 23, 2015 */
3+
/* libpng version 1.6.41.git */
44

5-
/* Copyright (c) 1998-2014 Glenn Randers-Pehrson */
5+
/* Copyright (c) 2018-2023 Cosmin Truta */
6+
/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */
67

78
/* This code is released under the libpng license. */
89
/* For conditions of distribution and use, see the disclaimer */
@@ -42,6 +43,8 @@
4243
#define PNG_IO_STATE_SUPPORTED
4344
#define PNG_MNG_FEATURES_SUPPORTED
4445
#define PNG_POINTER_INDEXING_SUPPORTED
46+
/*#undef PNG_POWERPC_VSX_API_SUPPORTED*/
47+
/*#undef PNG_POWERPC_VSX_CHECK_SUPPORTED*/
4548
#define PNG_PROGRESSIVE_READ_SUPPORTED
4649
#define PNG_READ_16BIT_SUPPORTED
4750
#define PNG_READ_ALPHA_MODE_SUPPORTED
@@ -80,6 +83,7 @@
8083
#define PNG_READ_USER_TRANSFORM_SUPPORTED
8184
#define PNG_READ_bKGD_SUPPORTED
8285
#define PNG_READ_cHRM_SUPPORTED
86+
#define PNG_READ_eXIf_SUPPORTED
8387
#define PNG_READ_gAMA_SUPPORTED
8488
#define PNG_READ_hIST_SUPPORTED
8589
#define PNG_READ_iCCP_SUPPORTED
@@ -107,6 +111,7 @@
107111
#define PNG_SIMPLIFIED_READ_SUPPORTED
108112
#define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED
109113
#define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED
114+
#define PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED
110115
#define PNG_SIMPLIFIED_WRITE_SUPPORTED
111116
#define PNG_STDIO_SUPPORTED
112117
#define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
@@ -148,6 +153,7 @@
148153
#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
149154
#define PNG_WRITE_bKGD_SUPPORTED
150155
#define PNG_WRITE_cHRM_SUPPORTED
156+
#define PNG_WRITE_eXIf_SUPPORTED
151157
#define PNG_WRITE_gAMA_SUPPORTED
152158
#define PNG_WRITE_hIST_SUPPORTED
153159
#define PNG_WRITE_iCCP_SUPPORTED
@@ -165,6 +171,7 @@
165171
#define PNG_WRITE_zTXt_SUPPORTED
166172
#define PNG_bKGD_SUPPORTED
167173
#define PNG_cHRM_SUPPORTED
174+
#define PNG_eXIf_SUPPORTED
168175
#define PNG_gAMA_SUPPORTED
169176
#define PNG_hIST_SUPPORTED
170177
#define PNG_iCCP_SUPPORTED
@@ -183,7 +190,6 @@
183190
/* end of options */
184191
/* settings */
185192
#define PNG_API_RULE 0
186-
#define PNG_COST_SHIFT 3
187193
#define PNG_DEFAULT_READ_MACROS 1
188194
#define PNG_GAMMA_THRESHOLD_FIXED 5000
189195
#define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE
@@ -202,9 +208,8 @@
202208
#define PNG_USER_CHUNK_MALLOC_MAX 8000000
203209
#define PNG_USER_HEIGHT_MAX 1000000
204210
#define PNG_USER_WIDTH_MAX 1000000
205-
#define PNG_WEIGHT_SHIFT 8
206211
#define PNG_ZBUF_SIZE 8192
207-
#define PNG_ZLIB_VERNUM 0x1280
212+
#define PNG_ZLIB_VERNUM 0 /* unknown */
208213
#define PNG_Z_DEFAULT_COMPRESSION (-1)
209214
#define PNG_Z_DEFAULT_NOFILTER_STRATEGY 0
210215
#define PNG_Z_DEFAULT_STRATEGY 1
66.5 KB
Binary file not shown.
-106 KB
Binary file not shown.

VisualC/external/optional/x86/LICENSE.png.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
The source code to this library used with SDL_image can be found here:
2-
https://hg.libsdl.org/SDL_image/file/default/external
3-
---
41
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
52
=========================================
63

74
PNG Reference Library License version 2
85
---------------------------------------
96

10-
* Copyright (c) 1995-2019 The PNG Reference Library Authors.
11-
* Copyright (c) 2018-2019 Cosmin Truta.
7+
* Copyright (c) 1995-2023 The PNG Reference Library Authors.
8+
* Copyright (c) 2018-2023 Cosmin Truta.
129
* Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
1310
* Copyright (c) 1996-1997 Andreas Dilger.
1411
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
37.5 KB
Binary file not shown.
-101 KB
Binary file not shown.

0 commit comments

Comments
 (0)