]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/libpng/lib/dist/pngconf.h
update
[l4.git] / l4 / pkg / libpng / lib / dist / pngconf.h
1
2 /* pngconf.h - machine configurable file for libpng
3  *
4  * libpng version 1.5.2 - March 31, 2011
5  *
6  * Copyright (c) 1998-2011 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.)
9  *
10  * This code is released under the libpng license.
11  * For conditions of distribution and use, see the disclaimer
12  * and license in png.h
13  *
14  */
15
16 /* Any machine specific code is near the front of this file, so if you
17  * are configuring libpng for a machine, you may want to read the section
18  * starting here down to where it starts to typedef png_color, png_text,
19  * and png_info.
20  */
21
22 #ifndef PNGCONF_H
23 #define PNGCONF_H
24
25 #ifndef PNG_BUILDING_SYMBOL_TABLE
26 /* PNG_NO_LIMITS_H may be used to turn off the use of the standard C
27  * definition file for  machine specific limits, this may impact the
28  * correctness of the definitons below (see uses of INT_MAX).
29  */
30 #  ifndef PNG_NO_LIMITS_H
31 #    include <limits.h>
32 #  endif
33
34 /* For the memory copy APIs (i.e. the standard definitions of these),
35  * because this file defines png_memcpy and so on the base APIs must
36  * be defined here.
37  */
38 #  ifdef BSD
39 #    include <strings.h>
40 #  else
41 #    include <string.h>
42 #  endif
43
44 /* For png_FILE_p - this provides the standard definition of a
45  * FILE
46  */
47 #  ifdef PNG_STDIO_SUPPORTED
48 #    include <stdio.h>
49 #  endif
50 #endif
51
52 /* This controls optimization of the reading of 16 and 32 bit values
53  * from PNG files.  It can be set on a per-app-file basis - it
54  * just changes whether a macro is used to the function is called.
55  * The library builder sets the default, if read functions are not
56  * built into the library the macro implementation is forced on.
57  */
58 #ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED
59 #  define PNG_USE_READ_MACROS
60 #endif
61 #if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS)
62 #  if PNG_DEFAULT_READ_MACROS
63 #    define PNG_USE_READ_MACROS
64 #  endif
65 #endif
66
67 /* COMPILER SPECIFIC OPTIONS.
68  *
69  * These options are provided so that a variety of difficult compilers
70  * can be used.  Some are fixed at build time (e.g. PNG_API_RULE
71  * below) but still have compiler specific implementations, others
72  * may be changed on a per-file basis when compiling against libpng.
73  */
74
75 /* The PNGARG macro protects us against machines that don't have function
76  * prototypes (ie K&R style headers).  If your compiler does not handle
77  * function prototypes, define this macro and use the included ansi2knr.
78  * I've always been able to use _NO_PROTO as the indicator, but you may
79  * need to drag the empty declaration out in front of here, or change the
80  * ifdef to suit your own needs.
81  */
82 #ifndef PNGARG
83
84 #  ifdef OF /* zlib prototype munger */
85 #    define PNGARG(arglist) OF(arglist)
86 #  else
87
88 #    ifdef _NO_PROTO
89 #      define PNGARG(arglist) ()
90 #    else
91 #      define PNGARG(arglist) arglist
92 #    endif /* _NO_PROTO */
93
94 #  endif /* OF */
95
96 #endif /* PNGARG */
97
98 /* Function calling conventions.
99  * =============================
100  * Normally it is not necessary to specify to the compiler how to call
101  * a function - it just does it - however on x86 systems derived from
102  * Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems
103  * and some others) there are multiple ways to call a function and the
104  * default can be changed on the compiler command line.  For this reason
105  * libpng specifies the calling convention of every exported function and
106  * every function called via a user supplied function pointer.  This is
107  * done in this file by defining the following macros:
108  *
109  * PNGAPI    Calling convention for exported functions.
110  * PNGCBAPI  Calling convention for user provided (callback) functions.
111  * PNGCAPI   Calling convention used by the ANSI-C library (required
112  *           for longjmp callbacks and sometimes used internally to
113  *           specify the calling convention for zlib).
114  *
115  * These macros should never be overridden.  If it is necessary to
116  * change calling convention in a private build this can be done
117  * by setting PNG_API_RULE (which defaults to 0) to one of the values
118  * below to select the correct 'API' variants.
119  *
120  * PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout.
121  *                This is correct in every known environment.
122  * PNG_API_RULE=1 Use the operating system convention for PNGAPI and
123  *                the 'C' calling convention (from PNGCAPI) for
124  *                callbacks (PNGCBAPI).  This is no longer required
125  *                in any known environment - if it has to be used
126  *                please post an explanation of the problem to the
127  *                libpng mailing list.
128  *
129  * These cases only differ if the operating system does not use the C
130  * calling convention, at present this just means the above cases
131  * (x86 DOS/Windows sytems) and, even then, this does not apply to
132  * Cygwin running on those systems.
133  *
134  * Note that the value must be defined in pnglibconf.h so that what
135  * the application uses to call the library matches the conventions
136  * set when building the library.
137  */
138
139 /* Symbol export
140  * =============
141  * When building a shared library it is almost always necessary to tell
142  * the compiler which symbols to export.  The png.h macro 'PNG_EXPORT'
143  * is used to mark the symbols.  On some systems these symbols can be
144  * extracted at link time and need no special processing by the compiler,
145  * on other systems the symbols are flagged by the compiler and just
146  * the declaration requires a special tag applied (unfortunately) in a
147  * compiler dependent way.  Some systems can do either.
148  *
149  * A small number of older systems also require a symbol from a DLL to
150  * be flagged to the program that calls it.  This is a problem because
151  * we do not know in the header file included by application code that
152  * the symbol will come from a shared library, as opposed to a statically
153  * linked one.  For this reason the application must tell us by setting
154  * the magic flag PNG_USE_DLL to turn on the special processing before
155  * it includes png.h.
156  *
157  * Four additional macros are used to make this happen:
158  *
159  * PNG_IMPEXP The magic (if any) to cause a symbol to be exported from
160  *            the build or imported if PNG_USE_DLL is set - compiler
161  *            and system specific.
162  *
163  * PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to
164  *                       'type', compiler specific.
165  *
166  * PNG_DLL_EXPORT Set to the magic to use during a libpng build to
167  *                make a symbol exported from the DLL.
168  *
169  * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come
170  *                from a DLL - used to define PNG_IMPEXP when
171  *                PNG_USE_DLL is set.
172  */
173
174 /* System specific discovery.
175  * ==========================
176  * This code is used at build time to find PNG_IMPEXP, the API settings
177  * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL
178  * import processing is possible.  On Windows/x86 systems it also sets
179  * compiler-specific macros to the values required to change the calling
180  * conventions of the various functions.
181  */
182 #if ( defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\
183       defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) ) &&\
184     ( defined(_X86_) || defined(_X64_) || defined(_M_IX86) ||\
185       defined(_M_X64) || defined(_M_IA64) )
186   /* Windows system (DOS doesn't support DLLs) running on x86/x64.  Includes
187    * builds under Cygwin or MinGW.  Also includes Watcom builds but these need
188    * special treatment because they are not compatible with GCC or Visual C
189    * because of different calling conventions.
190    */
191 #  if PNG_API_RULE == 2
192     /* If this line results in an error, either because __watcall is not
193      * understood or because of a redefine just below you cannot use *this*
194      * build of the library with the compiler you are using.  *This* build was
195      * build using Watcom and applications must also be built using Watcom!
196      */
197 #    define PNGCAPI __watcall
198 #  endif
199
200 #  if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
201 #    define PNGCAPI __cdecl
202 #    if PNG_API_RULE == 1
203 #      define PNGAPI __stdcall
204 #    endif
205 #  else
206     /* An older compiler, or one not detected (erroneously) above,
207      * if necessary override on the command line to get the correct
208      * variants for the compiler.
209      */
210 #    ifndef PNGCAPI
211 #      define PNGCAPI _cdecl
212 #    endif
213 #    if PNG_API_RULE == 1 && !defined(PNGAPI)
214 #      define PNGAPI _stdcall
215 #    endif
216 #  endif /* compiler/api */
217   /* NOTE: PNGCBAPI always defaults to PNGCAPI. */
218
219 #  if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)
220    ERROR: PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed
221 #  endif
222
223 #  if (defined(_MSC_VER) && _MSC_VER < 800) ||\
224       (defined(__BORLANDC__) && __BORLANDC__ < 0x500)
225     /* older Borland and MSC
226      * compilers used '__export' and required this to be after
227      * the type.
228      */
229 #    ifndef PNG_EXPORT_TYPE
230 #      define PNG_EXPORT_TYPE(type) type PNG_IMPEXP
231 #    endif
232 #    define PNG_DLL_EXPORT __export
233 #  else /* newer compiler */
234 #    define PNG_DLL_EXPORT __declspec(dllexport)
235 #    ifndef PNG_DLL_IMPORT
236 #      define PNG_DLL_IMPORT __declspec(dllimport)
237 #    endif
238 #  endif /* compiler */
239
240 #else /* !Windows/x86 */
241 #  if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
242 #    define PNGAPI _System
243 #  else /* !Windows/x86 && !OS/2 */
244     /* Use the defaults, or define PNG*API on the command line (but
245      * this will have to be done for every compile!)
246      */
247 #  endif /* other system, !OS/2 */
248 #endif /* !Windows/x86 */
249
250 /* Now do all the defaulting . */
251 #ifndef PNGCAPI
252 #  define PNGCAPI
253 #endif
254 #ifndef PNGCBAPI
255 #  define PNGCBAPI PNGCAPI
256 #endif
257 #ifndef PNGAPI
258 #  define PNGAPI PNGCAPI
259 #endif
260
261 /* The default for PNG_IMPEXP depends on whether the library is
262  * being built or used.
263  */
264 #ifndef PNG_IMPEXP
265 #  ifdef PNGLIB_BUILD
266     /* Building the library */
267 #    if (defined(DLL_EXPORT)/*from libtool*/ ||\
268         defined(_WINDLL) || defined(_DLL) || defined(__DLL__) ||\
269         defined(_USRDLL) ||\
270         defined(PNG_BUILD_DLL)) && defined(PNG_DLL_EXPORT)
271       /* Building a DLL. */
272 #      define PNG_IMPEXP PNG_DLL_EXPORT
273 #    endif /* DLL */
274 #  else
275     /* Using the library */
276 #    if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT)
277       /* This forces use of a DLL, disallowing static linking */
278 #      define PNG_IMPEXP PNG_DLL_IMPORT
279 #    endif
280 #  endif
281
282 #  ifndef PNG_IMPEXP
283 #    define PNG_IMPEXP
284 #  endif
285 #endif
286
287 /* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat
288  * 'attributes' as a storage class - the attributes go at the start of the
289  * function definition, and attributes are always appended regardless of the
290  * compiler.  This considerably simplifies these macros but may cause problems
291  * if any compilers both need function attributes and fail to handle them as
292  * a storage class (this is unlikely.)
293  */
294 #ifndef PNG_FUNCTION
295 #  define PNG_FUNCTION(type, name, args, attributes) attributes type name args
296 #endif
297
298 #ifndef PNG_EXPORT_TYPE
299 #  define PNG_EXPORT_TYPE(type) PNG_IMPEXP type
300 #endif
301
302    /* The ordinal value is only relevant when preprocessing png.h for symbol
303     * table entries, so we discard it here.  See the .dfn files in the
304     * scripts directory.
305     */
306 #ifndef PNG_EXPORTA
307
308 #  define PNG_EXPORTA(ordinal, type, name, args, attributes)\
309       PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args), \
310         extern attributes)
311 #endif
312
313 /* ANSI-C (C90) does not permit a macro to be invoked with an empty argument,
314  * so make something non-empty to satisfy the requirement:
315  */
316 #define PNG_EMPTY /*empty list*/
317
318 #define PNG_EXPORT(ordinal, type, name, args)\
319    PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY)
320
321 /* Use PNG_REMOVED to comment out a removed interface. */
322 #ifndef PNG_REMOVED
323 #  define PNG_REMOVED(ordinal, type, name, args, attributes)
324 #endif
325
326 #ifndef PNG_CALLBACK
327 #  define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args)
328 #endif
329
330 /* Support for compiler specific function attributes.  These are used
331  * so that where compiler support is available incorrect use of API
332  * functions in png.h will generate compiler warnings.
333  *
334  * Added at libpng-1.2.41.
335  */
336
337 #ifndef PNG_NO_PEDANTIC_WARNINGS
338 #  ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED
339 #    define PNG_PEDANTIC_WARNINGS_SUPPORTED
340 #  endif
341 #endif
342
343 #ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED
344   /* Support for compiler specific function attributes.  These are used
345    * so that where compiler support is available incorrect use of API
346    * functions in png.h will generate compiler warnings.  Added at libpng
347    * version 1.2.41.
348    */
349 #  if defined(__GNUC__)
350 #    ifndef PNG_USE_RESULT
351 #      define PNG_USE_RESULT __attribute__((__warn_unused_result__))
352 #    endif
353 #    ifndef PNG_NORETURN
354 #      define PNG_NORETURN   __attribute__((__noreturn__))
355 #    endif
356 #    ifndef PNG_PTR_NORETURN
357        /* It's not enough to have the compiler be the correct compiler at
358         * this point - it's necessary for the library (which defines
359         * the type of the library longjmp) to also be the GNU library.
360         * This is because many systems use the GNU compiler with a
361         * non-GNU libc implementation.  Min/GW headers are also compatible
362         * with GCC as well as uclibc, so it seems best to exclude known
363         * problem libcs here rather than just including known libcs.
364         *
365         * NOTE: this relies on the only use of PNG_PTR_NORETURN being with
366         * the system longjmp.  If the same type is used elsewhere then this
367         * will need to be changed.
368         */
369 #      if !defined(__CYGWIN__)
370 #         define PNG_PTR_NORETURN   __attribute__((__noreturn__))
371 #      endif
372 #    endif
373 #    ifndef PNG_ALLOCATED
374 #      define PNG_ALLOCATED  __attribute__((__malloc__))
375 #    endif
376
377     /* This specifically protects structure members that should only be
378      * accessed from within the library, therefore should be empty during
379      * a library build.
380      */
381 #    ifndef PNGLIB_BUILD
382 #      ifndef PNG_DEPRECATED
383 #        define PNG_DEPRECATED __attribute__((__deprecated__))
384 #      endif
385 #      ifndef PNG_DEPSTRUCT
386 #        define PNG_DEPSTRUCT  __attribute__((__deprecated__))
387 #      endif
388 #      ifndef PNG_PRIVATE
389 #        if 0 /* Doesn't work so we use deprecated instead*/
390 #          define PNG_PRIVATE \
391             __attribute__((warning("This function is not exported by libpng.")))
392 #        else
393 #          define PNG_PRIVATE \
394             __attribute__((__deprecated__))
395 #        endif
396 #      endif
397 #    endif /* PNGLIB_BUILD */
398 #  endif /* __GNUC__ */
399
400 #  if defined(_MSC_VER)  && (_MSC_VER >= 1300)
401 #    ifndef PNG_USE_RESULT
402 #      define PNG_USE_RESULT /* not supported */
403 #    endif
404 #    ifndef PNG_NORETURN
405 #      define PNG_NORETURN   __declspec(noreturn)
406 #    endif
407 #    ifndef PNG_PTR_NORETURN
408 #      define PNG_PTR_NORETURN /* not supported */
409 #    endif
410 #    ifndef PNG_ALLOCATED
411 #      define PNG_ALLOCATED __declspec(restrict)
412 #    endif
413
414     /* This specifically protects structure members that should only be
415      * accessed from within the library, therefore should be empty during
416      * a library build.
417      */
418 #    ifndef PNGLIB_BUILD
419 #      ifndef PNG_DEPRECATED
420 #        define PNG_DEPRECATED __declspec(deprecated)
421 #      endif
422 #      ifndef PNG_DEPSTRUCT
423 #        define PNG_DEPSTRUCT  __declspec(deprecated)
424 #      endif
425 #      ifndef PNG_PRIVATE
426 #        define PNG_PRIVATE __declspec(deprecated)
427 #      endif
428 #    endif /* PNGLIB_BUILD */
429 #  endif /* _MSC_VER */
430 #endif /* PNG_PEDANTIC_WARNINGS */
431
432 #ifndef PNG_DEPRECATED
433 #  define PNG_DEPRECATED  /* Use of this function is deprecated */
434 #endif
435 #ifndef PNG_USE_RESULT
436 #  define PNG_USE_RESULT  /* The result of this function must be checked */
437 #endif
438 #ifndef PNG_NORETURN
439 #  define PNG_NORETURN    /* This function does not return */
440 #endif
441 #ifndef PNG_PTR_NORETURN
442 #  define PNG_PTR_NORETURN /* This function does not return */
443 #endif
444 #ifndef PNG_ALLOCATED
445 #  define PNG_ALLOCATED   /* The result of the function is new memory */
446 #endif
447 #ifndef PNG_DEPSTRUCT
448 #  define PNG_DEPSTRUCT   /* Access to this struct member is deprecated */
449 #endif
450 #ifndef PNG_PRIVATE
451 #  define PNG_PRIVATE     /* This is a private libpng function */
452 #endif
453 #ifndef PNG_FP_EXPORT     /* A floating point API. */
454 #  ifdef PNG_FLOATING_POINT_SUPPORTED
455 #     define PNG_FP_EXPORT(ordinal, type, name, args)\
456          PNG_EXPORT(ordinal, type, name, args)
457 #  else                   /* No floating point APIs */
458 #     define PNG_FP_EXPORT(ordinal, type, name, args)
459 #  endif
460 #endif
461 #ifndef PNG_FIXED_EXPORT  /* A fixed point API. */
462 #  ifdef PNG_FIXED_POINT_SUPPORTED
463 #     define PNG_FIXED_EXPORT(ordinal, type, name, args)\
464          PNG_EXPORT(ordinal, type, name, args)
465 #  else                   /* No fixed point APIs */
466 #     define PNG_FIXED_EXPORT(ordinal, type, name, args)
467 #  endif
468 #endif
469
470 /* The following uses const char * instead of char * for error
471  * and warning message functions, so some compilers won't complain.
472  * If you do not want to use const, define PNG_NO_CONST here.
473  *
474  * This should not change how the APIs are called, so it can be done
475  * on a per-file basis in the application.
476  */
477 #ifndef PNG_CONST
478 #  ifndef PNG_NO_CONST
479 #    define PNG_CONST const
480 #  else
481 #    define PNG_CONST
482 #  endif
483 #endif
484
485 /* Some typedefs to get us started.  These should be safe on most of the
486  * common platforms.  The typedefs should be at least as large as the
487  * numbers suggest (a png_uint_32 must be at least 32 bits long), but they
488  * don't have to be exactly that size.  Some compilers dislike passing
489  * unsigned shorts as function parameters, so you may be better off using
490  * unsigned int for png_uint_16.
491  */
492
493 #if defined(INT_MAX) && (INT_MAX > 0x7ffffffeL)
494 typedef unsigned int png_uint_32;
495 typedef int png_int_32;
496 #else
497 typedef unsigned long png_uint_32;
498 typedef long png_int_32;
499 #endif
500 typedef unsigned short png_uint_16;
501 typedef short png_int_16;
502 typedef unsigned char png_byte;
503
504 #ifdef PNG_NO_SIZE_T
505 typedef unsigned int png_size_t;
506 #else
507 typedef size_t png_size_t;
508 #endif
509 #define png_sizeof(x) (sizeof (x))
510
511 /* The following is needed for medium model support.  It cannot be in the
512  * pngpriv.h header.  Needs modification for other compilers besides
513  * MSC.  Model independent support declares all arrays and pointers to be
514  * large using the far keyword.  The zlib version used must also support
515  * model independent data.  As of version zlib 1.0.4, the necessary changes
516  * have been made in zlib.  The USE_FAR_KEYWORD define triggers other
517  * changes that are needed. (Tim Wegner)
518  */
519
520 /* Separate compiler dependencies (problem here is that zlib.h always
521  * defines FAR. (SJT)
522  */
523 #ifdef __BORLANDC__
524 #  if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
525 #    define LDATA 1
526 #  else
527 #    define LDATA 0
528 #  endif
529   /* GRR:  why is Cygwin in here?  Cygwin is not Borland C... */
530 #  if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__)
531 #    define PNG_MAX_MALLOC_64K /* only used in build */
532 #    if (LDATA != 1)
533 #      ifndef FAR
534 #        define FAR __far
535 #      endif
536 #      define USE_FAR_KEYWORD
537 #    endif   /* LDATA != 1 */
538          /* Possibly useful for moving data out of default segment.
539           * Uncomment it if you want. Could also define FARDATA as
540           * const if your compiler supports it. (SJT)
541 #        define FARDATA FAR
542           */
543 #  endif  /* __WIN32__, __FLAT__, __CYGWIN__ */
544 #endif   /* __BORLANDC__ */
545
546
547 /* Suggest testing for specific compiler first before testing for
548  * FAR.  The Watcom compiler defines both __MEDIUM__ and M_I86MM,
549  * making reliance oncertain keywords suspect. (SJT)
550  */
551
552 /* MSC Medium model */
553 #ifdef FAR
554 #  ifdef M_I86MM
555 #    define USE_FAR_KEYWORD
556 #    define FARDATA FAR
557 #    include <dos.h>
558 #  endif
559 #endif
560
561 /* SJT: default case */
562 #ifndef FAR
563 #  define FAR
564 #endif
565
566 /* At this point FAR is always defined */
567 #ifndef FARDATA
568 #  define FARDATA
569 #endif
570
571 /* Typedef for floating-point numbers that are converted
572  * to fixed-point with a multiple of 100,000, e.g., gamma
573  */
574 typedef png_int_32 png_fixed_point;
575
576 /* Add typedefs for pointers */
577 typedef void                      FAR * png_voidp;
578 typedef PNG_CONST void            FAR * png_const_voidp;
579 typedef png_byte                  FAR * png_bytep;
580 typedef PNG_CONST png_byte        FAR * png_const_bytep;
581 typedef png_uint_32               FAR * png_uint_32p;
582 typedef PNG_CONST png_uint_32     FAR * png_const_uint_32p;
583 typedef png_int_32                FAR * png_int_32p;
584 typedef PNG_CONST png_int_32      FAR * png_const_int_32p;
585 typedef png_uint_16               FAR * png_uint_16p;
586 typedef PNG_CONST png_uint_16     FAR * png_const_uint_16p;
587 typedef png_int_16                FAR * png_int_16p;
588 typedef PNG_CONST png_int_16      FAR * png_const_int_16p;
589 typedef char                      FAR * png_charp;
590 typedef PNG_CONST char            FAR * png_const_charp;
591 typedef png_fixed_point           FAR * png_fixed_point_p;
592 typedef PNG_CONST png_fixed_point FAR * png_const_fixed_point_p;
593 typedef png_size_t                FAR * png_size_tp;
594 typedef PNG_CONST png_size_t      FAR * png_const_size_tp;
595
596 #ifdef PNG_STDIO_SUPPORTED
597 typedef FILE            * png_FILE_p;
598 #endif
599
600 #ifdef PNG_FLOATING_POINT_SUPPORTED
601 typedef double           FAR * png_doublep;
602 typedef PNG_CONST double FAR * png_const_doublep;
603 #endif
604
605 /* Pointers to pointers; i.e. arrays */
606 typedef png_byte        FAR * FAR * png_bytepp;
607 typedef png_uint_32     FAR * FAR * png_uint_32pp;
608 typedef png_int_32      FAR * FAR * png_int_32pp;
609 typedef png_uint_16     FAR * FAR * png_uint_16pp;
610 typedef png_int_16      FAR * FAR * png_int_16pp;
611 typedef PNG_CONST char  FAR * FAR * png_const_charpp;
612 typedef char            FAR * FAR * png_charpp;
613 typedef png_fixed_point FAR * FAR * png_fixed_point_pp;
614 #ifdef PNG_FLOATING_POINT_SUPPORTED
615 typedef double          FAR * FAR * png_doublepp;
616 #endif
617
618 /* Pointers to pointers to pointers; i.e., pointer to array */
619 typedef char            FAR * FAR * FAR * png_charppp;
620
621 /* png_alloc_size_t is guaranteed to be no smaller than png_size_t,
622  * and no smaller than png_uint_32.  Casts from png_size_t or png_uint_32
623  * to png_alloc_size_t are not necessary; in fact, it is recommended
624  * not to use them at all so that the compiler can complain when something
625  * turns out to be problematic.
626  * Casts in the other direction (from png_alloc_size_t to png_size_t or
627  * png_uint_32) should be explicitly applied; however, we do not expect
628  * to encounter practical situations that require such conversions.
629  */
630 #if defined(__TURBOC__) && !defined(__FLAT__)
631    typedef unsigned long png_alloc_size_t;
632 #else
633 #  if defined(_MSC_VER) && defined(MAXSEG_64K)
634      typedef unsigned long    png_alloc_size_t;
635 #  else
636      /* This is an attempt to detect an old Windows system where (int) is
637       * actually 16 bits, in that case png_malloc must have an argument with a
638       * bigger size to accomodate the requirements of the library.
639       */
640 #    if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_)) && \
641         (!defined(INT_MAX) || INT_MAX <= 0x7ffffffeL)
642        typedef DWORD         png_alloc_size_t;
643 #    else
644        typedef png_size_t    png_alloc_size_t;
645 #    endif
646 #  endif
647 #endif
648
649 #endif /* PNGCONF_H */