OSDN Git Service

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