]> git.lizzy.rs Git - irrlicht.git/blob - source/Irrlicht/libpng/pngconf.h
Merging r6145 through r6171 from trunk to ogl-es branch
[irrlicht.git] / source / Irrlicht / libpng / pngconf.h
1 \r
2 /* pngconf.h - machine-configurable file for libpng\r
3  *\r
4  * libpng version 1.6.37\r
5  *\r
6  * Copyright (c) 2018-2019 Cosmin Truta\r
7  * Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson\r
8  * Copyright (c) 1996-1997 Andreas Dilger\r
9  * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\r
10  *\r
11  * This code is released under the libpng license.\r
12  * For conditions of distribution and use, see the disclaimer\r
13  * and license in png.h\r
14  *\r
15  * Any machine specific code is near the front of this file, so if you\r
16  * are configuring libpng for a machine, you may want to read the section\r
17  * starting here down to where it starts to typedef png_color, png_text,\r
18  * and png_info.\r
19  */\r
20 \r
21 #ifndef PNGCONF_H\r
22 #define PNGCONF_H\r
23 \r
24 #ifndef PNG_BUILDING_SYMBOL_TABLE /* else includes may cause problems */\r
25 \r
26 /* From libpng 1.6.0 libpng requires an ANSI X3.159-1989 ("ISOC90") compliant C\r
27  * compiler for correct compilation.  The following header files are required by\r
28  * the standard.  If your compiler doesn't provide these header files, or they\r
29  * do not match the standard, you will need to provide/improve them.\r
30  */\r
31 #include <limits.h>\r
32 #include <stddef.h>\r
33 \r
34 /* Library header files.  These header files are all defined by ISOC90; libpng\r
35  * expects conformant implementations, however, an ISOC90 conformant system need\r
36  * not provide these header files if the functionality cannot be implemented.\r
37  * In this case it will be necessary to disable the relevant parts of libpng in\r
38  * the build of pnglibconf.h.\r
39  *\r
40  * Prior to 1.6.0 string.h was included here; the API changes in 1.6.0 to not\r
41  * include this unnecessary header file.\r
42  */\r
43 \r
44 #ifdef PNG_STDIO_SUPPORTED\r
45    /* Required for the definition of FILE: */\r
46 #  include <stdio.h>\r
47 #endif\r
48 \r
49 #ifdef PNG_SETJMP_SUPPORTED\r
50    /* Required for the definition of jmp_buf and the declaration of longjmp: */\r
51 #  include <setjmp.h>\r
52 #endif\r
53 \r
54 #ifdef PNG_CONVERT_tIME_SUPPORTED\r
55    /* Required for struct tm: */\r
56 #  include <time.h>\r
57 #endif\r
58 \r
59 #endif /* PNG_BUILDING_SYMBOL_TABLE */\r
60 \r
61 /* Prior to 1.6.0, it was possible to turn off 'const' in declarations,\r
62  * using PNG_NO_CONST.  This is no longer supported.\r
63  */\r
64 #define PNG_CONST const /* backward compatibility only */\r
65 \r
66 /* This controls optimization of the reading of 16-bit and 32-bit\r
67  * values from PNG files.  It can be set on a per-app-file basis: it\r
68  * just changes whether a macro is used when the function is called.\r
69  * The library builder sets the default; if read functions are not\r
70  * built into the library the macro implementation is forced on.\r
71  */\r
72 #ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED\r
73 #  define PNG_USE_READ_MACROS\r
74 #endif\r
75 #if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS)\r
76 #  if PNG_DEFAULT_READ_MACROS\r
77 #    define PNG_USE_READ_MACROS\r
78 #  endif\r
79 #endif\r
80 \r
81 /* COMPILER SPECIFIC OPTIONS.\r
82  *\r
83  * These options are provided so that a variety of difficult compilers\r
84  * can be used.  Some are fixed at build time (e.g. PNG_API_RULE\r
85  * below) but still have compiler specific implementations, others\r
86  * may be changed on a per-file basis when compiling against libpng.\r
87  */\r
88 \r
89 /* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect\r
90  * against legacy (pre ISOC90) compilers that did not understand function\r
91  * prototypes.  It is not required for modern C compilers.\r
92  */\r
93 #ifndef PNGARG\r
94 #  define PNGARG(arglist) arglist\r
95 #endif\r
96 \r
97 /* Function calling conventions.\r
98  * =============================\r
99  * Normally it is not necessary to specify to the compiler how to call\r
100  * a function - it just does it - however on x86 systems derived from\r
101  * Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems\r
102  * and some others) there are multiple ways to call a function and the\r
103  * default can be changed on the compiler command line.  For this reason\r
104  * libpng specifies the calling convention of every exported function and\r
105  * every function called via a user supplied function pointer.  This is\r
106  * done in this file by defining the following macros:\r
107  *\r
108  * PNGAPI    Calling convention for exported functions.\r
109  * PNGCBAPI  Calling convention for user provided (callback) functions.\r
110  * PNGCAPI   Calling convention used by the ANSI-C library (required\r
111  *           for longjmp callbacks and sometimes used internally to\r
112  *           specify the calling convention for zlib).\r
113  *\r
114  * These macros should never be overridden.  If it is necessary to\r
115  * change calling convention in a private build this can be done\r
116  * by setting PNG_API_RULE (which defaults to 0) to one of the values\r
117  * below to select the correct 'API' variants.\r
118  *\r
119  * PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout.\r
120  *                This is correct in every known environment.\r
121  * PNG_API_RULE=1 Use the operating system convention for PNGAPI and\r
122  *                the 'C' calling convention (from PNGCAPI) for\r
123  *                callbacks (PNGCBAPI).  This is no longer required\r
124  *                in any known environment - if it has to be used\r
125  *                please post an explanation of the problem to the\r
126  *                libpng mailing list.\r
127  *\r
128  * These cases only differ if the operating system does not use the C\r
129  * calling convention, at present this just means the above cases\r
130  * (x86 DOS/Windows systems) and, even then, this does not apply to\r
131  * Cygwin running on those systems.\r
132  *\r
133  * Note that the value must be defined in pnglibconf.h so that what\r
134  * the application uses to call the library matches the conventions\r
135  * set when building the library.\r
136  */\r
137 \r
138 /* Symbol export\r
139  * =============\r
140  * When building a shared library it is almost always necessary to tell\r
141  * the compiler which symbols to export.  The png.h macro 'PNG_EXPORT'\r
142  * is used to mark the symbols.  On some systems these symbols can be\r
143  * extracted at link time and need no special processing by the compiler,\r
144  * on other systems the symbols are flagged by the compiler and just\r
145  * the declaration requires a special tag applied (unfortunately) in a\r
146  * compiler dependent way.  Some systems can do either.\r
147  *\r
148  * A small number of older systems also require a symbol from a DLL to\r
149  * be flagged to the program that calls it.  This is a problem because\r
150  * we do not know in the header file included by application code that\r
151  * the symbol will come from a shared library, as opposed to a statically\r
152  * linked one.  For this reason the application must tell us by setting\r
153  * the magic flag PNG_USE_DLL to turn on the special processing before\r
154  * it includes png.h.\r
155  *\r
156  * Four additional macros are used to make this happen:\r
157  *\r
158  * PNG_IMPEXP The magic (if any) to cause a symbol to be exported from\r
159  *            the build or imported if PNG_USE_DLL is set - compiler\r
160  *            and system specific.\r
161  *\r
162  * PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to\r
163  *                       'type', compiler specific.\r
164  *\r
165  * PNG_DLL_EXPORT Set to the magic to use during a libpng build to\r
166  *                make a symbol exported from the DLL.  Not used in the\r
167  *                public header files; see pngpriv.h for how it is used\r
168  *                in the libpng build.\r
169  *\r
170  * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come\r
171  *                from a DLL - used to define PNG_IMPEXP when\r
172  *                PNG_USE_DLL is set.\r
173  */\r
174 \r
175 /* System specific discovery.\r
176  * ==========================\r
177  * This code is used at build time to find PNG_IMPEXP, the API settings\r
178  * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL\r
179  * import processing is possible.  On Windows systems it also sets\r
180  * compiler-specific macros to the values required to change the calling\r
181  * conventions of the various functions.\r
182  */\r
183 #if defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\\r
184     defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)\r
185   /* Windows system (DOS doesn't support DLLs).  Includes builds under Cygwin or\r
186    * MinGW on any architecture currently supported by Windows.  Also includes\r
187    * Watcom builds but these need special treatment because they are not\r
188    * compatible with GCC or Visual C because of different calling conventions.\r
189    */\r
190 #  if PNG_API_RULE == 2\r
191    /* If this line results in an error, either because __watcall is not\r
192     * understood or because of a redefine just below you cannot use *this*\r
193     * build of the library with the compiler you are using.  *This* build was\r
194     * build using Watcom and applications must also be built using Watcom!\r
195     */\r
196 #    define PNGCAPI __watcall\r
197 #  endif\r
198 \r
199 #  if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800))\r
200 #    define PNGCAPI __cdecl\r
201 #    if PNG_API_RULE == 1\r
202    /* If this line results in an error __stdcall is not understood and\r
203     * PNG_API_RULE should not have been set to '1'.\r
204     */\r
205 #      define PNGAPI __stdcall\r
206 #    endif\r
207 #  else\r
208    /* An older compiler, or one not detected (erroneously) above,\r
209     * if necessary override on the command line to get the correct\r
210     * variants for the compiler.\r
211     */\r
212 #    ifndef PNGCAPI\r
213 #      define PNGCAPI _cdecl\r
214 #    endif\r
215 #    if PNG_API_RULE == 1 && !defined(PNGAPI)\r
216 #      define PNGAPI _stdcall\r
217 #    endif\r
218 #  endif /* compiler/api */\r
219 \r
220   /* NOTE: PNGCBAPI always defaults to PNGCAPI. */\r
221 \r
222 #  if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)\r
223 #     error "PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed"\r
224 #  endif\r
225 \r
226 #  if (defined(_MSC_VER) && _MSC_VER < 800) ||\\r
227       (defined(__BORLANDC__) && __BORLANDC__ < 0x500)\r
228    /* older Borland and MSC\r
229     * compilers used '__export' and required this to be after\r
230     * the type.\r
231     */\r
232 #    ifndef PNG_EXPORT_TYPE\r
233 #      define PNG_EXPORT_TYPE(type) type PNG_IMPEXP\r
234 #    endif\r
235 #    define PNG_DLL_EXPORT __export\r
236 #  else /* newer compiler */\r
237 #    define PNG_DLL_EXPORT __declspec(dllexport)\r
238 #    ifndef PNG_DLL_IMPORT\r
239 #      define PNG_DLL_IMPORT __declspec(dllimport)\r
240 #    endif\r
241 #  endif /* compiler */\r
242 \r
243 #else /* !Windows */\r
244 #  if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)\r
245 #    define PNGAPI _System\r
246 #  else /* !Windows/x86 && !OS/2 */\r
247    /* Use the defaults, or define PNG*API on the command line (but\r
248     * this will have to be done for every compile!)\r
249     */\r
250 #  endif /* other system, !OS/2 */\r
251 #endif /* !Windows/x86 */\r
252 \r
253 /* Now do all the defaulting . */\r
254 #ifndef PNGCAPI\r
255 #  define PNGCAPI\r
256 #endif\r
257 #ifndef PNGCBAPI\r
258 #  define PNGCBAPI PNGCAPI\r
259 #endif\r
260 #ifndef PNGAPI\r
261 #  define PNGAPI PNGCAPI\r
262 #endif\r
263 \r
264 /* PNG_IMPEXP may be set on the compilation system command line or (if not set)\r
265  * then in an internal header file when building the library, otherwise (when\r
266  * using the library) it is set here.\r
267  */\r
268 #ifndef PNG_IMPEXP\r
269 #  if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT)\r
270    /* This forces use of a DLL, disallowing static linking */\r
271 #    define PNG_IMPEXP PNG_DLL_IMPORT\r
272 #  endif\r
273 \r
274 #  ifndef PNG_IMPEXP\r
275 #    define PNG_IMPEXP\r
276 #  endif\r
277 #endif\r
278 \r
279 /* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat\r
280  * 'attributes' as a storage class - the attributes go at the start of the\r
281  * function definition, and attributes are always appended regardless of the\r
282  * compiler.  This considerably simplifies these macros but may cause problems\r
283  * if any compilers both need function attributes and fail to handle them as\r
284  * a storage class (this is unlikely.)\r
285  */\r
286 #ifndef PNG_FUNCTION\r
287 #  define PNG_FUNCTION(type, name, args, attributes) attributes type name args\r
288 #endif\r
289 \r
290 #ifndef PNG_EXPORT_TYPE\r
291 #  define PNG_EXPORT_TYPE(type) PNG_IMPEXP type\r
292 #endif\r
293 \r
294    /* The ordinal value is only relevant when preprocessing png.h for symbol\r
295     * table entries, so we discard it here.  See the .dfn files in the\r
296     * scripts directory.\r
297     */\r
298 \r
299 #ifndef PNG_EXPORTA\r
300 #  define PNG_EXPORTA(ordinal, type, name, args, attributes) \\r
301       PNG_FUNCTION(PNG_EXPORT_TYPE(type), (PNGAPI name), PNGARG(args), \\r
302       PNG_LINKAGE_API attributes)\r
303 #endif\r
304 \r
305 /* ANSI-C (C90) does not permit a macro to be invoked with an empty argument,\r
306  * so make something non-empty to satisfy the requirement:\r
307  */\r
308 #define PNG_EMPTY /*empty list*/\r
309 \r
310 #define PNG_EXPORT(ordinal, type, name, args) \\r
311    PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY)\r
312 \r
313 /* Use PNG_REMOVED to comment out a removed interface. */\r
314 #ifndef PNG_REMOVED\r
315 #  define PNG_REMOVED(ordinal, type, name, args, attributes)\r
316 #endif\r
317 \r
318 #ifndef PNG_CALLBACK\r
319 #  define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args)\r
320 #endif\r
321 \r
322 /* Support for compiler specific function attributes.  These are used\r
323  * so that where compiler support is available incorrect use of API\r
324  * functions in png.h will generate compiler warnings.\r
325  *\r
326  * Added at libpng-1.2.41.\r
327  */\r
328 \r
329 #ifndef PNG_NO_PEDANTIC_WARNINGS\r
330 #  ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED\r
331 #    define PNG_PEDANTIC_WARNINGS_SUPPORTED\r
332 #  endif\r
333 #endif\r
334 \r
335 #ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED\r
336   /* Support for compiler specific function attributes.  These are used\r
337    * so that where compiler support is available, incorrect use of API\r
338    * functions in png.h will generate compiler warnings.  Added at libpng\r
339    * version 1.2.41.  Disabling these removes the warnings but may also produce\r
340    * less efficient code.\r
341    */\r
342 #  if defined(__clang__) && defined(__has_attribute)\r
343    /* Clang defines both __clang__ and __GNUC__. Check __clang__ first. */\r
344 #    if !defined(PNG_USE_RESULT) && __has_attribute(__warn_unused_result__)\r
345 #      define PNG_USE_RESULT __attribute__((__warn_unused_result__))\r
346 #    endif\r
347 #    if !defined(PNG_NORETURN) && __has_attribute(__noreturn__)\r
348 #      define PNG_NORETURN __attribute__((__noreturn__))\r
349 #    endif\r
350 #    if !defined(PNG_ALLOCATED) && __has_attribute(__malloc__)\r
351 #      define PNG_ALLOCATED __attribute__((__malloc__))\r
352 #    endif\r
353 #    if !defined(PNG_DEPRECATED) && __has_attribute(__deprecated__)\r
354 #      define PNG_DEPRECATED __attribute__((__deprecated__))\r
355 #    endif\r
356 #    if !defined(PNG_PRIVATE)\r
357 #      ifdef __has_extension\r
358 #        if __has_extension(attribute_unavailable_with_message)\r
359 #          define PNG_PRIVATE __attribute__((__unavailable__(\\r
360              "This function is not exported by libpng.")))\r
361 #        endif\r
362 #      endif\r
363 #    endif\r
364 #    ifndef PNG_RESTRICT\r
365 #      define PNG_RESTRICT __restrict\r
366 #    endif\r
367 \r
368 #  elif defined(__GNUC__)\r
369 #    ifndef PNG_USE_RESULT\r
370 #      define PNG_USE_RESULT __attribute__((__warn_unused_result__))\r
371 #    endif\r
372 #    ifndef PNG_NORETURN\r
373 #      define PNG_NORETURN   __attribute__((__noreturn__))\r
374 #    endif\r
375 #    if __GNUC__ >= 3\r
376 #      ifndef PNG_ALLOCATED\r
377 #        define PNG_ALLOCATED  __attribute__((__malloc__))\r
378 #      endif\r
379 #      ifndef PNG_DEPRECATED\r
380 #        define PNG_DEPRECATED __attribute__((__deprecated__))\r
381 #      endif\r
382 #      ifndef PNG_PRIVATE\r
383 #        if 0 /* Doesn't work so we use deprecated instead*/\r
384 #          define PNG_PRIVATE \\r
385             __attribute__((warning("This function is not exported by libpng.")))\r
386 #        else\r
387 #          define PNG_PRIVATE \\r
388             __attribute__((__deprecated__))\r
389 #        endif\r
390 #      endif\r
391 #      if ((__GNUC__ > 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1))\r
392 #        ifndef PNG_RESTRICT\r
393 #          define PNG_RESTRICT __restrict\r
394 #        endif\r
395 #      endif /* __GNUC__.__GNUC_MINOR__ > 3.0 */\r
396 #    endif /* __GNUC__ >= 3 */\r
397 \r
398 #  elif defined(_MSC_VER)  && (_MSC_VER >= 1300)\r
399 #    ifndef PNG_USE_RESULT\r
400 #      define PNG_USE_RESULT /* not supported */\r
401 #    endif\r
402 #    ifndef PNG_NORETURN\r
403 #      define PNG_NORETURN   __declspec(noreturn)\r
404 #    endif\r
405 #    ifndef PNG_ALLOCATED\r
406 #      if (_MSC_VER >= 1400)\r
407 #        define PNG_ALLOCATED __declspec(restrict)\r
408 #      endif\r
409 #    endif\r
410 #    ifndef PNG_DEPRECATED\r
411 #      define PNG_DEPRECATED __declspec(deprecated)\r
412 #    endif\r
413 #    ifndef PNG_PRIVATE\r
414 #      define PNG_PRIVATE __declspec(deprecated)\r
415 #    endif\r
416 #    ifndef PNG_RESTRICT\r
417 #      if (_MSC_VER >= 1400)\r
418 #        define PNG_RESTRICT __restrict\r
419 #      endif\r
420 #    endif\r
421 \r
422 #  elif defined(__WATCOMC__)\r
423 #    ifndef PNG_RESTRICT\r
424 #      define PNG_RESTRICT __restrict\r
425 #    endif\r
426 #  endif\r
427 #endif /* PNG_PEDANTIC_WARNINGS */\r
428 \r
429 #ifndef PNG_DEPRECATED\r
430 #  define PNG_DEPRECATED  /* Use of this function is deprecated */\r
431 #endif\r
432 #ifndef PNG_USE_RESULT\r
433 #  define PNG_USE_RESULT  /* The result of this function must be checked */\r
434 #endif\r
435 #ifndef PNG_NORETURN\r
436 #  define PNG_NORETURN    /* This function does not return */\r
437 #endif\r
438 #ifndef PNG_ALLOCATED\r
439 #  define PNG_ALLOCATED   /* The result of the function is new memory */\r
440 #endif\r
441 #ifndef PNG_PRIVATE\r
442 #  define PNG_PRIVATE     /* This is a private libpng function */\r
443 #endif\r
444 #ifndef PNG_RESTRICT\r
445 #  define PNG_RESTRICT    /* The C99 "restrict" feature */\r
446 #endif\r
447 \r
448 #ifndef PNG_FP_EXPORT     /* A floating point API. */\r
449 #  ifdef PNG_FLOATING_POINT_SUPPORTED\r
450 #     define PNG_FP_EXPORT(ordinal, type, name, args)\\r
451          PNG_EXPORT(ordinal, type, name, args);\r
452 #  else                   /* No floating point APIs */\r
453 #     define PNG_FP_EXPORT(ordinal, type, name, args)\r
454 #  endif\r
455 #endif\r
456 #ifndef PNG_FIXED_EXPORT  /* A fixed point API. */\r
457 #  ifdef PNG_FIXED_POINT_SUPPORTED\r
458 #     define PNG_FIXED_EXPORT(ordinal, type, name, args)\\r
459          PNG_EXPORT(ordinal, type, name, args);\r
460 #  else                   /* No fixed point APIs */\r
461 #     define PNG_FIXED_EXPORT(ordinal, type, name, args)\r
462 #  endif\r
463 #endif\r
464 \r
465 #ifndef PNG_BUILDING_SYMBOL_TABLE\r
466 /* Some typedefs to get us started.  These should be safe on most of the common\r
467  * platforms.\r
468  *\r
469  * png_uint_32 and png_int_32 may, currently, be larger than required to hold a\r
470  * 32-bit value however this is not normally advisable.\r
471  *\r
472  * png_uint_16 and png_int_16 should always be two bytes in size - this is\r
473  * verified at library build time.\r
474  *\r
475  * png_byte must always be one byte in size.\r
476  *\r
477  * The checks below use constants from limits.h, as defined by the ISOC90\r
478  * standard.\r
479  */\r
480 #if CHAR_BIT == 8 && UCHAR_MAX == 255\r
481    typedef unsigned char png_byte;\r
482 #else\r
483 #  error "libpng requires 8-bit bytes"\r
484 #endif\r
485 \r
486 #if INT_MIN == -32768 && INT_MAX == 32767\r
487    typedef int png_int_16;\r
488 #elif SHRT_MIN == -32768 && SHRT_MAX == 32767\r
489    typedef short png_int_16;\r
490 #else\r
491 #  error "libpng requires a signed 16-bit type"\r
492 #endif\r
493 \r
494 #if UINT_MAX == 65535\r
495    typedef unsigned int png_uint_16;\r
496 #elif USHRT_MAX == 65535\r
497    typedef unsigned short png_uint_16;\r
498 #else\r
499 #  error "libpng requires an unsigned 16-bit type"\r
500 #endif\r
501 \r
502 #if INT_MIN < -2147483646 && INT_MAX > 2147483646\r
503    typedef int png_int_32;\r
504 #elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646\r
505    typedef long int png_int_32;\r
506 #else\r
507 #  error "libpng requires a signed 32-bit (or more) type"\r
508 #endif\r
509 \r
510 #if UINT_MAX > 4294967294U\r
511    typedef unsigned int png_uint_32;\r
512 #elif ULONG_MAX > 4294967294U\r
513    typedef unsigned long int png_uint_32;\r
514 #else\r
515 #  error "libpng requires an unsigned 32-bit (or more) type"\r
516 #endif\r
517 \r
518 /* Prior to 1.6.0, it was possible to disable the use of size_t and ptrdiff_t.\r
519  * From 1.6.0 onwards, an ISO C90 compiler, as well as a standard-compliant\r
520  * behavior of sizeof and ptrdiff_t are required.\r
521  * The legacy typedefs are provided here for backwards compatibility.\r
522  */\r
523 typedef size_t png_size_t;\r
524 typedef ptrdiff_t png_ptrdiff_t;\r
525 \r
526 /* libpng needs to know the maximum value of 'size_t' and this controls the\r
527  * definition of png_alloc_size_t, below.  This maximum value of size_t limits\r
528  * but does not control the maximum allocations the library makes - there is\r
529  * direct application control of this through png_set_user_limits().\r
530  */\r
531 #ifndef PNG_SMALL_SIZE_T\r
532    /* Compiler specific tests for systems where size_t is known to be less than\r
533     * 32 bits (some of these systems may no longer work because of the lack of\r
534     * 'far' support; see above.)\r
535     */\r
536 #  if (defined(__TURBOC__) && !defined(__FLAT__)) ||\\r
537    (defined(_MSC_VER) && defined(MAXSEG_64K))\r
538 #     define PNG_SMALL_SIZE_T\r
539 #  endif\r
540 #endif\r
541 \r
542 /* png_alloc_size_t is guaranteed to be no smaller than size_t, and no smaller\r
543  * than png_uint_32.  Casts from size_t or png_uint_32 to png_alloc_size_t are\r
544  * not necessary; in fact, it is recommended not to use them at all, so that\r
545  * the compiler can complain when something turns out to be problematic.\r
546  *\r
547  * Casts in the other direction (from png_alloc_size_t to size_t or\r
548  * png_uint_32) should be explicitly applied; however, we do not expect to\r
549  * encounter practical situations that require such conversions.\r
550  *\r
551  * PNG_SMALL_SIZE_T must be defined if the maximum value of size_t is less than\r
552  * 4294967295 - i.e. less than the maximum value of png_uint_32.\r
553  */\r
554 #ifdef PNG_SMALL_SIZE_T\r
555    typedef png_uint_32 png_alloc_size_t;\r
556 #else\r
557    typedef size_t png_alloc_size_t;\r
558 #endif\r
559 \r
560 /* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler\r
561  * implementations of Intel CPU specific support of user-mode segmented address\r
562  * spaces, where 16-bit pointers address more than 65536 bytes of memory using\r
563  * separate 'segment' registers.  The implementation requires two different\r
564  * types of pointer (only one of which includes the segment value.)\r
565  *\r
566  * If required this support is available in version 1.2 of libpng and may be\r
567  * available in versions through 1.5, although the correctness of the code has\r
568  * not been verified recently.\r
569  */\r
570 \r
571 /* Typedef for floating-point numbers that are converted to fixed-point with a\r
572  * multiple of 100,000, e.g., gamma\r
573  */\r
574 typedef png_int_32 png_fixed_point;\r
575 \r
576 /* Add typedefs for pointers */\r
577 typedef void                  * png_voidp;\r
578 typedef const void            * png_const_voidp;\r
579 typedef png_byte              * png_bytep;\r
580 typedef const png_byte        * png_const_bytep;\r
581 typedef png_uint_32           * png_uint_32p;\r
582 typedef const png_uint_32     * png_const_uint_32p;\r
583 typedef png_int_32            * png_int_32p;\r
584 typedef const png_int_32      * png_const_int_32p;\r
585 typedef png_uint_16           * png_uint_16p;\r
586 typedef const png_uint_16     * png_const_uint_16p;\r
587 typedef png_int_16            * png_int_16p;\r
588 typedef const png_int_16      * png_const_int_16p;\r
589 typedef char                  * png_charp;\r
590 typedef const char            * png_const_charp;\r
591 typedef png_fixed_point       * png_fixed_point_p;\r
592 typedef const png_fixed_point * png_const_fixed_point_p;\r
593 typedef size_t                * png_size_tp;\r
594 typedef const size_t          * png_const_size_tp;\r
595 \r
596 #ifdef PNG_STDIO_SUPPORTED\r
597 typedef FILE            * png_FILE_p;\r
598 #endif\r
599 \r
600 #ifdef PNG_FLOATING_POINT_SUPPORTED\r
601 typedef double       * png_doublep;\r
602 typedef const double * png_const_doublep;\r
603 #endif\r
604 \r
605 /* Pointers to pointers; i.e. arrays */\r
606 typedef png_byte        * * png_bytepp;\r
607 typedef png_uint_32     * * png_uint_32pp;\r
608 typedef png_int_32      * * png_int_32pp;\r
609 typedef png_uint_16     * * png_uint_16pp;\r
610 typedef png_int_16      * * png_int_16pp;\r
611 typedef const char      * * png_const_charpp;\r
612 typedef char            * * png_charpp;\r
613 typedef png_fixed_point * * png_fixed_point_pp;\r
614 #ifdef PNG_FLOATING_POINT_SUPPORTED\r
615 typedef double          * * png_doublepp;\r
616 #endif\r
617 \r
618 /* Pointers to pointers to pointers; i.e., pointer to array */\r
619 typedef char            * * * png_charppp;\r
620 \r
621 #endif /* PNG_BUILDING_SYMBOL_TABLE */\r
622 \r
623 #endif /* PNGCONF_H */\r