1
1
2
- /* pngconf.h - machine configurable file for libpng
2
+ /* pngconf.h - machine- configurable file for libpng
3
3
*
4
- * libpng version 1.6.18, July 23, 2015
4
+ * libpng version 1.6.41.git
5
5
*
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.
9
10
*
10
11
* This code is released under the libpng license.
11
12
* For conditions of distribution and use, see the disclaimer
57
58
58
59
#endif /* PNG_BUILDING_SYMBOL_TABLE */
59
60
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.
63
63
*/
64
64
#define PNG_CONST const /* backward compatibility only */
65
65
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
68
68
* just changes whether a macro is used when the function is called.
69
69
* The library builder sets the default; if read functions are not
70
70
* built into the library the macro implementation is forced on.
127
127
*
128
128
* These cases only differ if the operating system does not use the C
129
129
* 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
131
131
* Cygwin running on those systems.
132
132
*
133
133
* Note that the value must be defined in pnglibconf.h so that what
180
180
* compiler-specific macros to the values required to change the calling
181
181
* conventions of the various functions.
182
182
*/
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__ )
185
185
/* Windows system (DOS doesn't support DLLs). Includes builds under Cygwin or
186
186
* MinGW on any architecture currently supported by Windows. Also includes
187
187
* Watcom builds but these need special treatment because they are not
188
188
* compatible with GCC or Visual C because of different calling conventions.
189
189
*/
190
190
# 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
+ */
196
196
# define PNGCAPI __watcall
197
197
# endif
198
198
199
199
# if defined(__GNUC__ ) || (defined(_MSC_VER ) && (_MSC_VER >= 800 ))
200
200
# define PNGCAPI __cdecl
201
201
# 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
+ */
205
205
# define PNGAPI __stdcall
206
206
# endif
207
207
# 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
+ */
212
212
# ifndef PNGCAPI
213
213
# define PNGCAPI _cdecl
214
214
# endif
225
225
226
226
# if (defined(_MSC_VER ) && _MSC_VER < 800 ) || \
227
227
(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
+ */
232
232
# ifndef PNG_EXPORT_TYPE
233
233
# define PNG_EXPORT_TYPE (type ) type PNG_IMPEXP
234
234
# endif
244
244
# if (defined(__IBMC__ ) || defined(__IBMCPP__ )) && defined(__OS2__ )
245
245
# define PNGAPI _System
246
246
# 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
+ */
250
250
# endif /* other system, !OS/2 */
251
251
#endif /* !Windows/x86 */
252
252
267
267
*/
268
268
#ifndef PNG_IMPEXP
269
269
# 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 */
271
271
# define PNG_IMPEXP PNG_DLL_IMPORT
272
272
# endif
273
273
340
340
* less efficient code.
341
341
*/
342
342
# 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. */
344
344
# if !defined(PNG_USE_RESULT ) && __has_attribute (__warn_unused_result__ )
345
345
# define PNG_USE_RESULT __attribute__((__warn_unused_result__))
346
346
# endif
480
480
#if CHAR_BIT == 8 && UCHAR_MAX == 255
481
481
typedef unsigned char png_byte ;
482
482
#else
483
- # error "libpng requires 8 bit bytes"
483
+ # error "libpng requires 8- bit bytes"
484
484
#endif
485
485
486
486
#if INT_MIN == -32768 && INT_MAX == 32767
487
487
typedef int png_int_16 ;
488
488
#elif SHRT_MIN == -32768 && SHRT_MAX == 32767
489
489
typedef short png_int_16 ;
490
490
#else
491
- # error "libpng requires a signed 16 bit type"
491
+ # error "libpng requires a signed 16- bit type"
492
492
#endif
493
493
494
494
#if UINT_MAX == 65535
495
495
typedef unsigned int png_uint_16 ;
496
496
#elif USHRT_MAX == 65535
497
497
typedef unsigned short png_uint_16 ;
498
498
#else
499
- # error "libpng requires an unsigned 16 bit type"
499
+ # error "libpng requires an unsigned 16- bit type"
500
500
#endif
501
501
502
502
#if INT_MIN < -2147483646 && INT_MAX > 2147483646
503
503
typedef int png_int_32 ;
504
504
#elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646
505
505
typedef long int png_int_32 ;
506
506
#else
507
- # error "libpng requires a signed 32 bit (or more) type"
507
+ # error "libpng requires a signed 32- bit (or more) type"
508
508
#endif
509
509
510
- #if UINT_MAX > 4294967294
510
+ #if UINT_MAX > 4294967294U
511
511
typedef unsigned int png_uint_32 ;
512
- #elif ULONG_MAX > 4294967294
512
+ #elif ULONG_MAX > 4294967294U
513
513
typedef unsigned long int png_uint_32 ;
514
514
#else
515
- # error "libpng requires an unsigned 32 bit (or more) type"
515
+ # error "libpng requires an unsigned 32- bit (or more) type"
516
516
#endif
517
517
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.
520
522
*/
521
523
typedef size_t png_size_t ;
522
524
typedef ptrdiff_t png_ptrdiff_t ;
@@ -537,13 +539,12 @@ typedef ptrdiff_t png_ptrdiff_t;
537
539
# endif
538
540
#endif
539
541
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.
545
546
*
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
547
548
* png_uint_32) should be explicitly applied; however, we do not expect to
548
549
* encounter practical situations that require such conversions.
549
550
*
@@ -553,7 +554,7 @@ typedef ptrdiff_t png_ptrdiff_t;
553
554
#ifdef PNG_SMALL_SIZE_T
554
555
typedef png_uint_32 png_alloc_size_t ;
555
556
#else
556
- typedef png_size_t png_alloc_size_t ;
557
+ typedef size_t png_alloc_size_t ;
557
558
#endif
558
559
559
560
/* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler
@@ -589,8 +590,8 @@ typedef char * png_charp;
589
590
typedef const char * png_const_charp ;
590
591
typedef png_fixed_point * png_fixed_point_p ;
591
592
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 ;
594
595
595
596
#ifdef PNG_STDIO_SUPPORTED
596
597
typedef FILE * png_FILE_p ;
0 commit comments