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
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.
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
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
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
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
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
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
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 */
521523typedef size_t png_size_t ;
522524typedef 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;
589590typedef const char * png_const_charp ;
590591typedef png_fixed_point * png_fixed_point_p ;
591592typedef 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
596597typedef FILE * png_FILE_p ;
0 commit comments