comparison src/share/native/sun/awt/libpng/pngconf.h @ 11372:817a472b15bd

8143941: Update splashscreen displays Reviewed-by: ahgross, prr, serb
author azvegint
date Tue, 08 Dec 2015 22:22:28 +0300
parents 52022313ee3e
children 23a6e0931277
comparison
equal deleted inserted replaced
4:f3f3561c4148 5:4219bc69ae53
27 * This file is available under and governed by the GNU General Public 27 * This file is available under and governed by the GNU General Public
28 * License version 2 only, as published by the Free Software Foundation. 28 * License version 2 only, as published by the Free Software Foundation.
29 * However, the following notice accompanied the original version of this 29 * However, the following notice accompanied the original version of this
30 * file and, per its terms, should not be removed: 30 * file and, per its terms, should not be removed:
31 * 31 *
32 * libpng version 1.6.16,December 22, 2014 32 * libpng version 1.5.4 - July 7, 2011
33 * 33 *
34 * Copyright (c) 1998-2014 Glenn Randers-Pehrson 34 * Copyright (c) 1998-2011 Glenn Randers-Pehrson
35 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) 35 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
36 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) 36 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
37 * 37 *
38 * This code is released under the libpng license. 38 * This code is released under the libpng license.
39 * For conditions of distribution and use, see the disclaimer 39 * For conditions of distribution and use, see the disclaimer
48 */ 48 */
49 49
50 #ifndef PNGCONF_H 50 #ifndef PNGCONF_H
51 #define PNGCONF_H 51 #define PNGCONF_H
52 52
53 /* To do: Do all of this in scripts/pnglibconf.dfa */ 53 #ifndef PNG_BUILDING_SYMBOL_TABLE
54 #ifdef PNG_SAFE_LIMITS_SUPPORTED 54 /* PNG_NO_LIMITS_H may be used to turn off the use of the standard C
55 # ifdef PNG_USER_WIDTH_MAX 55 * definition file for machine specific limits, this may impact the
56 # undef PNG_USER_WIDTH_MAX 56 * correctness of the definitons below (see uses of INT_MAX).
57 # define PNG_USER_WIDTH_MAX 1000000L 57 */
58 # endif 58 # ifndef PNG_NO_LIMITS_H
59 # ifdef PNG_USER_HEIGHT_MAX 59 # include <limits.h>
60 # undef PNG_USER_HEIGHT_MAX 60 # endif
61 # define PNG_USER_HEIGHT_MAX 1000000L 61
62 # endif 62 /* For the memory copy APIs (i.e. the standard definitions of these),
63 # ifdef PNG_USER_CHUNK_MALLOC_MAX 63 * because this file defines png_memcpy and so on the base APIs must
64 # undef PNG_USER_CHUNK_MALLOC_MAX 64 * be defined here.
65 # define PNG_USER_CHUNK_MALLOC_MAX 4000000L 65 */
66 # endif 66 # ifdef BSD
67 # ifdef PNG_USER_CHUNK_CACHE_MAX 67 # include <strings.h>
68 # undef PNG_USER_CHUNK_CACHE_MAX 68 # else
69 # define PNG_USER_CHUNK_CACHE_MAX 128 69 # include <string.h>
70 # endif 70 # endif
71 #endif 71
72 72 /* For png_FILE_p - this provides the standard definition of a
73 #ifndef PNG_BUILDING_SYMBOL_TABLE /* else includes may cause problems */ 73 * FILE
74 74 */
75 /* From libpng 1.6.0 libpng requires an ANSI X3.159-1989 ("ISOC90") compliant C 75 # ifdef PNG_STDIO_SUPPORTED
76 * compiler for correct compilation. The following header files are required by 76 # include <stdio.h>
77 * the standard. If your compiler doesn't provide these header files, or they 77 # endif
78 * do not match the standard, you will need to provide/improve them. 78 #endif
79 */
80 #include <limits.h>
81 #include <stddef.h>
82
83 /* Library header files. These header files are all defined by ISOC90; libpng
84 * expects conformant implementations, however, an ISOC90 conformant system need
85 * not provide these header files if the functionality cannot be implemented.
86 * In this case it will be necessary to disable the relevant parts of libpng in
87 * the build of pnglibconf.h.
88 *
89 * Prior to 1.6.0 string.h was included here; the API changes in 1.6.0 to not
90 * include this unnecessary header file.
91 */
92
93 #ifdef PNG_STDIO_SUPPORTED
94 /* Required for the definition of FILE: */
95 # include <stdio.h>
96 #endif
97
98 #ifdef PNG_SETJMP_SUPPORTED
99 /* Required for the definition of jmp_buf and the declaration of longjmp: */
100 # include <setjmp.h>
101 #endif
102
103 #ifdef PNG_CONVERT_tIME_SUPPORTED
104 /* Required for struct tm: */
105 # include <time.h>
106 #endif
107
108 #endif /* PNG_BUILDING_SYMBOL_TABLE */
109
110 /* Prior to 1.6.0 it was possible to turn off 'const' in declarations using
111 * PNG_NO_CONST; this is no longer supported except for data declarations which
112 * apparently still cause problems in 2011 on some compilers.
113 */
114 #define PNG_CONST const /* backward compatibility only */
115 79
116 /* This controls optimization of the reading of 16 and 32 bit values 80 /* This controls optimization of the reading of 16 and 32 bit values
117 * from PNG files. It can be set on a per-app-file basis - it 81 * from PNG files. It can be set on a per-app-file basis - it
118 * just changes whether a macro is used when the function is called. 82 * just changes whether a macro is used to the function is called.
119 * The library builder sets the default; if read functions are not 83 * The library builder sets the default, if read functions are not
120 * built into the library the macro implementation is forced on. 84 * built into the library the macro implementation is forced on.
121 */ 85 */
122 #ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED 86 #ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED
123 # define PNG_USE_READ_MACROS 87 # define PNG_USE_READ_MACROS
124 #endif 88 #endif
134 * can be used. Some are fixed at build time (e.g. PNG_API_RULE 98 * can be used. Some are fixed at build time (e.g. PNG_API_RULE
135 * below) but still have compiler specific implementations, others 99 * below) but still have compiler specific implementations, others
136 * may be changed on a per-file basis when compiling against libpng. 100 * may be changed on a per-file basis when compiling against libpng.
137 */ 101 */
138 102
139 /* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect 103 /* The PNGARG macro protects us against machines that don't have function
140 * against legacy (pre ISOC90) compilers that did not understand function 104 * prototypes (ie K&R style headers). If your compiler does not handle
141 * prototypes. It is not required for modern C compilers. 105 * function prototypes, define this macro and use the included ansi2knr.
106 * I've always been able to use _NO_PROTO as the indicator, but you may
107 * need to drag the empty declaration out in front of here, or change the
108 * ifdef to suit your own needs.
142 */ 109 */
143 #ifndef PNGARG 110 #ifndef PNGARG
144 # define PNGARG(arglist) arglist 111
145 #endif 112 # ifdef OF /* zlib prototype munger */
113 # define PNGARG(arglist) OF(arglist)
114 # else
115
116 # ifdef _NO_PROTO
117 # define PNGARG(arglist) ()
118 # else
119 # define PNGARG(arglist) arglist
120 # endif /* _NO_PROTO */
121
122 # endif /* OF */
123
124 #endif /* PNGARG */
146 125
147 /* Function calling conventions. 126 /* Function calling conventions.
148 * ============================= 127 * =============================
149 * Normally it is not necessary to specify to the compiler how to call 128 * Normally it is not necessary to specify to the compiler how to call
150 * a function - it just does it - however on x86 systems derived from 129 * a function - it just does it - however on x86 systems derived from
211 * 190 *
212 * PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to 191 * PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to
213 * 'type', compiler specific. 192 * 'type', compiler specific.
214 * 193 *
215 * PNG_DLL_EXPORT Set to the magic to use during a libpng build to 194 * PNG_DLL_EXPORT Set to the magic to use during a libpng build to
216 * make a symbol exported from the DLL. Not used in the 195 * make a symbol exported from the DLL.
217 * public header files; see pngpriv.h for how it is used
218 * in the libpng build.
219 * 196 *
220 * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come 197 * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come
221 * from a DLL - used to define PNG_IMPEXP when 198 * from a DLL - used to define PNG_IMPEXP when
222 * PNG_USE_DLL is set. 199 * PNG_USE_DLL is set.
223 */ 200 */
224 201
225 /* System specific discovery. 202 /* System specific discovery.
226 * ========================== 203 * ==========================
227 * This code is used at build time to find PNG_IMPEXP, the API settings 204 * This code is used at build time to find PNG_IMPEXP, the API settings
228 * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL 205 * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL
229 * import processing is possible. On Windows systems it also sets 206 * import processing is possible. On Windows/x86 systems it also sets
230 * compiler-specific macros to the values required to change the calling 207 * compiler-specific macros to the values required to change the calling
231 * conventions of the various functions. 208 * conventions of the various functions.
232 */ 209 */
233 #if defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\ 210 #if ( defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\
234 defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) 211 defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) ) &&\
235 /* Windows system (DOS doesn't support DLLs). Includes builds under Cygwin or 212 ( defined(_X86_) || defined(_X64_) || defined(_M_IX86) ||\
236 * MinGW on any architecture currently supported by Windows. Also includes 213 defined(_M_X64) || defined(_M_IA64) )
237 * Watcom builds but these need special treatment because they are not 214 /* Windows system (DOS doesn't support DLLs) running on x86/x64. Includes
238 * compatible with GCC or Visual C because of different calling conventions. 215 * builds under Cygwin or MinGW. Also includes Watcom builds but these need
216 * special treatment because they are not compatible with GCC or Visual C
217 * because of different calling conventions.
239 */ 218 */
240 # if PNG_API_RULE == 2 219 # if PNG_API_RULE == 2
241 /* If this line results in an error, either because __watcall is not 220 /* If this line results in an error, either because __watcall is not
242 * understood or because of a redefine just below you cannot use *this* 221 * understood or because of a redefine just below you cannot use *this*
243 * build of the library with the compiler you are using. *This* build was 222 * build of the library with the compiler you are using. *This* build was
244 * build using Watcom and applications must also be built using Watcom! 223 * build using Watcom and applications must also be built using Watcom!
245 */ 224 */
246 # define PNGCAPI __watcall 225 # define PNGCAPI __watcall
247 # endif 226 # endif
248 227
249 # if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800)) 228 # if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
250 # define PNGCAPI __cdecl 229 # define PNGCAPI __cdecl
251 # if PNG_API_RULE == 1 230 # if PNG_API_RULE == 1
252 /* If this line results in an error __stdcall is not understood and
253 * PNG_API_RULE should not have been set to '1'.
254 */
255 # define PNGAPI __stdcall 231 # define PNGAPI __stdcall
256 # endif 232 # endif
257 # else 233 # else
258 /* An older compiler, or one not detected (erroneously) above, 234 /* An older compiler, or one not detected (erroneously) above,
259 * if necessary override on the command line to get the correct 235 * if necessary override on the command line to get the correct
264 # endif 240 # endif
265 # if PNG_API_RULE == 1 && !defined(PNGAPI) 241 # if PNG_API_RULE == 1 && !defined(PNGAPI)
266 # define PNGAPI _stdcall 242 # define PNGAPI _stdcall
267 # endif 243 # endif
268 # endif /* compiler/api */ 244 # endif /* compiler/api */
269
270 /* NOTE: PNGCBAPI always defaults to PNGCAPI. */ 245 /* NOTE: PNGCBAPI always defaults to PNGCAPI. */
271 246
272 # if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD) 247 # if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)
273 # error "PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed" 248 ERROR: PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed
274 # endif 249 # endif
275 250
276 # if (defined(_MSC_VER) && _MSC_VER < 800) ||\ 251 # if (defined(_MSC_VER) && _MSC_VER < 800) ||\
277 (defined(__BORLANDC__) && __BORLANDC__ < 0x500) 252 (defined(__BORLANDC__) && __BORLANDC__ < 0x500)
278 /* older Borland and MSC 253 /* older Borland and MSC
288 # ifndef PNG_DLL_IMPORT 263 # ifndef PNG_DLL_IMPORT
289 # define PNG_DLL_IMPORT __declspec(dllimport) 264 # define PNG_DLL_IMPORT __declspec(dllimport)
290 # endif 265 # endif
291 # endif /* compiler */ 266 # endif /* compiler */
292 267
293 #else /* !Windows */ 268 #else /* !Windows/x86 */
294 # if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) 269 # if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
295 # define PNGAPI _System 270 # define PNGAPI _System
296 # else /* !Windows/x86 && !OS/2 */ 271 # else /* !Windows/x86 && !OS/2 */
297 /* Use the defaults, or define PNG*API on the command line (but 272 /* Use the defaults, or define PNG*API on the command line (but
298 * this will have to be done for every compile!) 273 * this will have to be done for every compile!)
309 #endif 284 #endif
310 #ifndef PNGAPI 285 #ifndef PNGAPI
311 # define PNGAPI PNGCAPI 286 # define PNGAPI PNGCAPI
312 #endif 287 #endif
313 288
314 /* PNG_IMPEXP may be set on the compilation system command line or (if not set) 289 /* The default for PNG_IMPEXP depends on whether the library is
315 * then in an internal header file when building the library, otherwise (when 290 * being built or used.
316 * using the library) it is set here.
317 */ 291 */
318 #ifndef PNG_IMPEXP 292 #ifndef PNG_IMPEXP
319 # if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT) 293 # ifdef PNGLIB_BUILD
320 /* This forces use of a DLL, disallowing static linking */ 294 /* Building the library */
321 # define PNG_IMPEXP PNG_DLL_IMPORT 295 # if (defined(DLL_EXPORT)/*from libtool*/ ||\
296 defined(_WINDLL) || defined(_DLL) || defined(__DLL__) ||\
297 defined(_USRDLL) ||\
298 defined(PNG_BUILD_DLL)) && defined(PNG_DLL_EXPORT)
299 /* Building a DLL. */
300 # define PNG_IMPEXP PNG_DLL_EXPORT
301 # endif /* DLL */
302 # else
303 /* Using the library */
304 # if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT)
305 /* This forces use of a DLL, disallowing static linking */
306 # define PNG_IMPEXP PNG_DLL_IMPORT
307 # endif
322 # endif 308 # endif
323 309
324 # ifndef PNG_IMPEXP 310 # ifndef PNG_IMPEXP
325 # define PNG_IMPEXP 311 # define PNG_IMPEXP
326 # endif 312 # endif
382 # endif 368 # endif
383 #endif 369 #endif
384 370
385 #ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED 371 #ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED
386 /* Support for compiler specific function attributes. These are used 372 /* Support for compiler specific function attributes. These are used
387 * so that where compiler support is available, incorrect use of API 373 * so that where compiler support is available incorrect use of API
388 * functions in png.h will generate compiler warnings. Added at libpng 374 * functions in png.h will generate compiler warnings. Added at libpng
389 * version 1.2.41. Disabling these removes the warnings but may also produce 375 * version 1.2.41.
390 * less efficient code.
391 */ 376 */
392 # if defined(__clang__) && defined(__has_attribute) 377 # if defined(__GNUC__)
393 /* Clang defines both __clang__ and __GNUC__. Check __clang__ first. */
394 # if !defined(PNG_USE_RESULT) && __has_attribute(__warn_unused_result__)
395 # define PNG_USE_RESULT __attribute__((__warn_unused_result__))
396 # endif
397 # if !defined(PNG_NORETURN) && __has_attribute(__noreturn__)
398 # define PNG_NORETURN __attribute__((__noreturn__))
399 # endif
400 # if !defined(PNG_ALLOCATED) && __has_attribute(__malloc__)
401 # define PNG_ALLOCATED __attribute__((__malloc__))
402 # endif
403 # if !defined(PNG_DEPRECATED) && __has_attribute(__deprecated__)
404 # define PNG_DEPRECATED __attribute__((__deprecated__))
405 # endif
406 # if !defined(PNG_PRIVATE)
407 # ifdef __has_extension
408 # if __has_extension(attribute_unavailable_with_message)
409 # define PNG_PRIVATE __attribute__((__unavailable__(\
410 "This function is not exported by libpng.")))
411 # endif
412 # endif
413 # endif
414 # ifndef PNG_RESTRICT
415 # define PNG_RESTRICT __restrict
416 # endif
417
418 # elif defined(__GNUC__)
419 # ifndef PNG_USE_RESULT 378 # ifndef PNG_USE_RESULT
420 # define PNG_USE_RESULT __attribute__((__warn_unused_result__)) 379 # define PNG_USE_RESULT __attribute__((__warn_unused_result__))
421 # endif 380 # endif
422 # ifndef PNG_NORETURN 381 # ifndef PNG_NORETURN
423 # define PNG_NORETURN __attribute__((__noreturn__)) 382 # define PNG_NORETURN __attribute__((__noreturn__))
424 # endif 383 # endif
425 # if __GNUC__ >= 3 384 # ifndef PNG_ALLOCATED
426 # ifndef PNG_ALLOCATED 385 # define PNG_ALLOCATED __attribute__((__malloc__))
427 # define PNG_ALLOCATED __attribute__((__malloc__)) 386 # endif
428 # endif 387
388 /* This specifically protects structure members that should only be
389 * accessed from within the library, therefore should be empty during
390 * a library build.
391 */
392 # ifndef PNGLIB_BUILD
429 # ifndef PNG_DEPRECATED 393 # ifndef PNG_DEPRECATED
430 # define PNG_DEPRECATED __attribute__((__deprecated__)) 394 # define PNG_DEPRECATED __attribute__((__deprecated__))
431 # endif 395 # endif
432 # ifndef PNG_PRIVATE 396 # ifndef PNG_PRIVATE
433 # if 0 /* Doesn't work so we use deprecated instead*/ 397 # if 0 /* Doesn't work so we use deprecated instead*/
436 # else 400 # else
437 # define PNG_PRIVATE \ 401 # define PNG_PRIVATE \
438 __attribute__((__deprecated__)) 402 __attribute__((__deprecated__))
439 # endif 403 # endif
440 # endif 404 # endif
441 # if ((__GNUC__ > 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1)) 405 # endif /* PNGLIB_BUILD */
442 # ifndef PNG_RESTRICT 406 # endif /* __GNUC__ */
443 # define PNG_RESTRICT __restrict 407
444 # endif 408 # if defined(_MSC_VER) && (_MSC_VER >= 1300)
445 # endif /* __GNUC__.__GNUC_MINOR__ > 3.0 */
446 # endif /* __GNUC__ >= 3 */
447
448 # elif defined(_MSC_VER) && (_MSC_VER >= 1300)
449 # ifndef PNG_USE_RESULT 409 # ifndef PNG_USE_RESULT
450 # define PNG_USE_RESULT /* not supported */ 410 # define PNG_USE_RESULT /* not supported */
451 # endif 411 # endif
452 # ifndef PNG_NORETURN 412 # ifndef PNG_NORETURN
453 # define PNG_NORETURN __declspec(noreturn) 413 # define PNG_NORETURN __declspec(noreturn)
455 # ifndef PNG_ALLOCATED 415 # ifndef PNG_ALLOCATED
456 # if (_MSC_VER >= 1400) 416 # if (_MSC_VER >= 1400)
457 # define PNG_ALLOCATED __declspec(restrict) 417 # define PNG_ALLOCATED __declspec(restrict)
458 # endif 418 # endif
459 # endif 419 # endif
460 # ifndef PNG_DEPRECATED 420
461 # define PNG_DEPRECATED __declspec(deprecated) 421 /* This specifically protects structure members that should only be
462 # endif 422 * accessed from within the library, therefore should be empty during
463 # ifndef PNG_PRIVATE 423 * a library build.
464 # define PNG_PRIVATE __declspec(deprecated) 424 */
465 # endif 425 # ifndef PNGLIB_BUILD
466 # ifndef PNG_RESTRICT 426 # ifndef PNG_DEPRECATED
467 # if (_MSC_VER >= 1400) 427 # define PNG_DEPRECATED __declspec(deprecated)
468 # define PNG_RESTRICT __restrict
469 # endif 428 # endif
470 # endif 429 # ifndef PNG_PRIVATE
471 430 # define PNG_PRIVATE __declspec(deprecated)
472 # elif defined(__WATCOMC__) 431 # endif
473 # ifndef PNG_RESTRICT 432 # endif /* PNGLIB_BUILD */
474 # define PNG_RESTRICT __restrict 433 # endif /* _MSC_VER */
475 # endif
476 # endif
477 #endif /* PNG_PEDANTIC_WARNINGS */ 434 #endif /* PNG_PEDANTIC_WARNINGS */
478 435
479 #ifndef PNG_DEPRECATED 436 #ifndef PNG_DEPRECATED
480 # define PNG_DEPRECATED /* Use of this function is deprecated */ 437 # define PNG_DEPRECATED /* Use of this function is deprecated */
481 #endif 438 #endif
489 # define PNG_ALLOCATED /* The result of the function is new memory */ 446 # define PNG_ALLOCATED /* The result of the function is new memory */
490 #endif 447 #endif
491 #ifndef PNG_PRIVATE 448 #ifndef PNG_PRIVATE
492 # define PNG_PRIVATE /* This is a private libpng function */ 449 # define PNG_PRIVATE /* This is a private libpng function */
493 #endif 450 #endif
494 #ifndef PNG_RESTRICT
495 # define PNG_RESTRICT /* The C99 "restrict" feature */
496 #endif
497
498 #ifndef PNG_FP_EXPORT /* A floating point API. */ 451 #ifndef PNG_FP_EXPORT /* A floating point API. */
499 # ifdef PNG_FLOATING_POINT_SUPPORTED 452 # ifdef PNG_FLOATING_POINT_SUPPORTED
500 # define PNG_FP_EXPORT(ordinal, type, name, args)\ 453 # define PNG_FP_EXPORT(ordinal, type, name, args)\
501 PNG_EXPORT(ordinal, type, name, args); 454 PNG_EXPORT(ordinal, type, name, args)
502 # else /* No floating point APIs */ 455 # else /* No floating point APIs */
503 # define PNG_FP_EXPORT(ordinal, type, name, args) 456 # define PNG_FP_EXPORT(ordinal, type, name, args)
504 # endif 457 # endif
505 #endif 458 #endif
506 #ifndef PNG_FIXED_EXPORT /* A fixed point API. */ 459 #ifndef PNG_FIXED_EXPORT /* A fixed point API. */
507 # ifdef PNG_FIXED_POINT_SUPPORTED 460 # ifdef PNG_FIXED_POINT_SUPPORTED
508 # define PNG_FIXED_EXPORT(ordinal, type, name, args)\ 461 # define PNG_FIXED_EXPORT(ordinal, type, name, args)\
509 PNG_EXPORT(ordinal, type, name, args); 462 PNG_EXPORT(ordinal, type, name, args)
510 # else /* No fixed point APIs */ 463 # else /* No fixed point APIs */
511 # define PNG_FIXED_EXPORT(ordinal, type, name, args) 464 # define PNG_FIXED_EXPORT(ordinal, type, name, args)
512 # endif 465 # endif
513 #endif 466 #endif
514 467
515 #ifndef PNG_BUILDING_SYMBOL_TABLE 468 /* The following uses const char * instead of char * for error
516 /* Some typedefs to get us started. These should be safe on most of the common 469 * and warning message functions, so some compilers won't complain.
517 * platforms. 470 * If you do not want to use const, define PNG_NO_CONST here.
518 * 471 *
519 * png_uint_32 and png_int_32 may, currently, be larger than required to hold a 472 * This should not change how the APIs are called, so it can be done
520 * 32-bit value however this is not normally advisable. 473 * on a per-file basis in the application.
521 * 474 */
522 * png_uint_16 and png_int_16 should always be two bytes in size - this is 475 #ifndef PNG_CONST
523 * verified at library build time. 476 # ifndef PNG_NO_CONST
524 * 477 # define PNG_CONST const
525 * png_byte must always be one byte in size. 478 # else
526 * 479 # define PNG_CONST
527 * The checks below use constants from limits.h, as defined by the ISOC90 480 # endif
528 * standard. 481 #endif
529 */ 482
530 #if CHAR_BIT == 8 && UCHAR_MAX == 255 483 /* Some typedefs to get us started. These should be safe on most of the
531 typedef unsigned char png_byte; 484 * common platforms. The typedefs should be at least as large as the
485 * numbers suggest (a png_uint_32 must be at least 32 bits long), but they
486 * don't have to be exactly that size. Some compilers dislike passing
487 * unsigned shorts as function parameters, so you may be better off using
488 * unsigned int for png_uint_16.
489 */
490
491 #if defined(INT_MAX) && (INT_MAX > 0x7ffffffeL)
492 typedef unsigned int png_uint_32;
493 typedef int png_int_32;
532 #else 494 #else
533 # error "libpng requires 8 bit bytes" 495 typedef unsigned long png_uint_32;
534 #endif 496 typedef long png_int_32;
535 497 #endif
536 #if INT_MIN == -32768 && INT_MAX == 32767 498 typedef unsigned short png_uint_16;
537 typedef int png_int_16; 499 typedef short png_int_16;
538 #elif SHRT_MIN == -32768 && SHRT_MAX == 32767 500 typedef unsigned char png_byte;
539 typedef short png_int_16; 501
502 #ifdef PNG_NO_SIZE_T
503 typedef unsigned int png_size_t;
540 #else 504 #else
541 # error "libpng requires a signed 16 bit type"
542 #endif
543
544 #if UINT_MAX == 65535
545 typedef unsigned int png_uint_16;
546 #elif USHRT_MAX == 65535
547 typedef unsigned short png_uint_16;
548 #else
549 # error "libpng requires an unsigned 16 bit type"
550 #endif
551
552 #if INT_MIN < -2147483646 && INT_MAX > 2147483646
553 typedef int png_int_32;
554 #elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646
555 typedef long int png_int_32;
556 #else
557 # error "libpng requires a signed 32 bit (or more) type"
558 #endif
559
560 #if UINT_MAX > 4294967294
561 typedef unsigned int png_uint_32;
562 #elif ULONG_MAX > 4294967294
563 typedef unsigned long int png_uint_32;
564 #else
565 # error "libpng requires an unsigned 32 bit (or more) type"
566 #endif
567
568 /* Prior to 1.6.0 it was possible to disable the use of size_t, 1.6.0, however,
569 * requires an ISOC90 compiler and relies on consistent behavior of sizeof.
570 */
571 typedef size_t png_size_t; 505 typedef size_t png_size_t;
572 typedef ptrdiff_t png_ptrdiff_t; 506 #endif
573 507 #define png_sizeof(x) (sizeof (x))
574 /* libpng needs to know the maximum value of 'size_t' and this controls the 508
575 * definition of png_alloc_size_t, below. This maximum value of size_t limits 509 /* The following is needed for medium model support. It cannot be in the
576 * but does not control the maximum allocations the library makes - there is 510 * pngpriv.h header. Needs modification for other compilers besides
577 * direct application control of this through png_set_user_limits(). 511 * MSC. Model independent support declares all arrays and pointers to be
578 */ 512 * large using the far keyword. The zlib version used must also support
579 #ifndef PNG_SMALL_SIZE_T 513 * model independent data. As of version zlib 1.0.4, the necessary changes
580 /* Compiler specific tests for systems where size_t is known to be less than 514 * have been made in zlib. The USE_FAR_KEYWORD define triggers other
581 * 32 bits (some of these systems may no longer work because of the lack of 515 * changes that are needed. (Tim Wegner)
582 * 'far' support; see above.) 516 */
583 */ 517
584 # if (defined(__TURBOC__) && !defined(__FLAT__)) ||\ 518 /* Separate compiler dependencies (problem here is that zlib.h always
585 (defined(_MSC_VER) && defined(MAXSEG_64K)) 519 * defines FAR. (SJT)
586 # define PNG_SMALL_SIZE_T 520 */
587 # endif 521 #ifdef __BORLANDC__
588 #endif 522 # if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
589 523 # define LDATA 1
590 /* png_alloc_size_t is guaranteed to be no smaller than png_size_t, and no 524 # else
591 * smaller than png_uint_32. Casts from png_size_t or png_uint_32 to 525 # define LDATA 0
592 * png_alloc_size_t are not necessary; in fact, it is recommended not to use 526 # endif
593 * them at all so that the compiler can complain when something turns out to be 527 /* GRR: why is Cygwin in here? Cygwin is not Borland C... */
594 * problematic. 528 # if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__)
595 * 529 # define PNG_MAX_MALLOC_64K /* only used in build */
596 * Casts in the other direction (from png_alloc_size_t to png_size_t or 530 # if (LDATA != 1)
597 * png_uint_32) should be explicitly applied; however, we do not expect to 531 # ifndef FAR
598 * encounter practical situations that require such conversions. 532 # define FAR __far
599 * 533 # endif
600 * PNG_SMALL_SIZE_T must be defined if the maximum value of size_t is less than 534 # define USE_FAR_KEYWORD
601 * 4294967295 - i.e. less than the maximum value of png_uint_32. 535 # endif /* LDATA != 1 */
602 */ 536 /* Possibly useful for moving data out of default segment.
603 #ifdef PNG_SMALL_SIZE_T 537 * Uncomment it if you want. Could also define FARDATA as
604 typedef png_uint_32 png_alloc_size_t; 538 * const if your compiler supports it. (SJT)
605 #else 539 # define FARDATA FAR
606 typedef png_size_t png_alloc_size_t; 540 */
607 #endif 541 # endif /* __WIN32__, __FLAT__, __CYGWIN__ */
608 542 #endif /* __BORLANDC__ */
609 /* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler 543
610 * implementations of Intel CPU specific support of user-mode segmented address 544
611 * spaces, where 16-bit pointers address more than 65536 bytes of memory using 545 /* Suggest testing for specific compiler first before testing for
612 * separate 'segment' registers. The implementation requires two different 546 * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM,
613 * types of pointer (only one of which includes the segment value.) 547 * making reliance oncertain keywords suspect. (SJT)
614 * 548 */
615 * If required this support is available in version 1.2 of libpng and may be 549
616 * available in versions through 1.5, although the correctness of the code has 550 /* MSC Medium model */
617 * not been verified recently. 551 #ifdef FAR
618 */ 552 # ifdef M_I86MM
619 553 # define USE_FAR_KEYWORD
620 /* Typedef for floating-point numbers that are converted to fixed-point with a 554 # define FARDATA FAR
621 * multiple of 100,000, e.g., gamma 555 # include <dos.h>
556 # endif
557 #endif
558
559 /* SJT: default case */
560 #ifndef FAR
561 # define FAR
562 #endif
563
564 /* At this point FAR is always defined */
565 #ifndef FARDATA
566 # define FARDATA
567 #endif
568
569 /* Typedef for floating-point numbers that are converted
570 * to fixed-point with a multiple of 100,000, e.g., gamma
622 */ 571 */
623 typedef png_int_32 png_fixed_point; 572 typedef png_int_32 png_fixed_point;
624 573
625 /* Add typedefs for pointers */ 574 /* Add typedefs for pointers */
626 typedef void * png_voidp; 575 typedef void FAR * png_voidp;
627 typedef const void * png_const_voidp; 576 typedef PNG_CONST void FAR * png_const_voidp;
628 typedef png_byte * png_bytep; 577 typedef png_byte FAR * png_bytep;
629 typedef const png_byte * png_const_bytep; 578 typedef PNG_CONST png_byte FAR * png_const_bytep;
630 typedef png_uint_32 * png_uint_32p; 579 typedef png_uint_32 FAR * png_uint_32p;
631 typedef const png_uint_32 * png_const_uint_32p; 580 typedef PNG_CONST png_uint_32 FAR * png_const_uint_32p;
632 typedef png_int_32 * png_int_32p; 581 typedef png_int_32 FAR * png_int_32p;
633 typedef const png_int_32 * png_const_int_32p; 582 typedef PNG_CONST png_int_32 FAR * png_const_int_32p;
634 typedef png_uint_16 * png_uint_16p; 583 typedef png_uint_16 FAR * png_uint_16p;
635 typedef const png_uint_16 * png_const_uint_16p; 584 typedef PNG_CONST png_uint_16 FAR * png_const_uint_16p;
636 typedef png_int_16 * png_int_16p; 585 typedef png_int_16 FAR * png_int_16p;
637 typedef const png_int_16 * png_const_int_16p; 586 typedef PNG_CONST png_int_16 FAR * png_const_int_16p;
638 typedef char * png_charp; 587 typedef char FAR * png_charp;
639 typedef const char * png_const_charp; 588 typedef PNG_CONST char FAR * png_const_charp;
640 typedef png_fixed_point * png_fixed_point_p; 589 typedef png_fixed_point FAR * png_fixed_point_p;
641 typedef const png_fixed_point * png_const_fixed_point_p; 590 typedef PNG_CONST png_fixed_point FAR * png_const_fixed_point_p;
642 typedef png_size_t * png_size_tp; 591 typedef png_size_t FAR * png_size_tp;
643 typedef const png_size_t * png_const_size_tp; 592 typedef PNG_CONST png_size_t FAR * png_const_size_tp;
644 593
645 #ifdef PNG_STDIO_SUPPORTED 594 #ifdef PNG_STDIO_SUPPORTED
646 typedef FILE * png_FILE_p; 595 typedef FILE * png_FILE_p;
647 #endif 596 #endif
648 597
649 #ifdef PNG_FLOATING_POINT_SUPPORTED 598 #ifdef PNG_FLOATING_POINT_SUPPORTED
650 typedef double * png_doublep; 599 typedef double FAR * png_doublep;
651 typedef const double * png_const_doublep; 600 typedef PNG_CONST double FAR * png_const_doublep;
652 #endif 601 #endif
653 602
654 /* Pointers to pointers; i.e. arrays */ 603 /* Pointers to pointers; i.e. arrays */
655 typedef png_byte * * png_bytepp; 604 typedef png_byte FAR * FAR * png_bytepp;
656 typedef png_uint_32 * * png_uint_32pp; 605 typedef png_uint_32 FAR * FAR * png_uint_32pp;
657 typedef png_int_32 * * png_int_32pp; 606 typedef png_int_32 FAR * FAR * png_int_32pp;
658 typedef png_uint_16 * * png_uint_16pp; 607 typedef png_uint_16 FAR * FAR * png_uint_16pp;
659 typedef png_int_16 * * png_int_16pp; 608 typedef png_int_16 FAR * FAR * png_int_16pp;
660 typedef const char * * png_const_charpp; 609 typedef PNG_CONST char FAR * FAR * png_const_charpp;
661 typedef char * * png_charpp; 610 typedef char FAR * FAR * png_charpp;
662 typedef png_fixed_point * * png_fixed_point_pp; 611 typedef png_fixed_point FAR * FAR * png_fixed_point_pp;
663 #ifdef PNG_FLOATING_POINT_SUPPORTED 612 #ifdef PNG_FLOATING_POINT_SUPPORTED
664 typedef double * * png_doublepp; 613 typedef double FAR * FAR * png_doublepp;
665 #endif 614 #endif
666 615
667 /* Pointers to pointers to pointers; i.e., pointer to array */ 616 /* Pointers to pointers to pointers; i.e., pointer to array */
668 typedef char * * * png_charppp; 617 typedef char FAR * FAR * FAR * png_charppp;
669 618
670 #endif /* PNG_BUILDING_SYMBOL_TABLE */ 619 /* png_alloc_size_t is guaranteed to be no smaller than png_size_t,
620 * and no smaller than png_uint_32. Casts from png_size_t or png_uint_32
621 * to png_alloc_size_t are not necessary; in fact, it is recommended
622 * not to use them at all so that the compiler can complain when something
623 * turns out to be problematic.
624 * Casts in the other direction (from png_alloc_size_t to png_size_t or
625 * png_uint_32) should be explicitly applied; however, we do not expect
626 * to encounter practical situations that require such conversions.
627 */
628 #if defined(__TURBOC__) && !defined(__FLAT__)
629 typedef unsigned long png_alloc_size_t;
630 #else
631 # if defined(_MSC_VER) && defined(MAXSEG_64K)
632 typedef unsigned long png_alloc_size_t;
633 # else
634 /* This is an attempt to detect an old Windows system where (int) is
635 * actually 16 bits, in that case png_malloc must have an argument with a
636 * bigger size to accommodate the requirements of the library.
637 */
638 # if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_)) && \
639 (!defined(INT_MAX) || INT_MAX <= 0x7ffffffeL)
640 typedef DWORD png_alloc_size_t;
641 # else
642 typedef png_size_t png_alloc_size_t;
643 # endif
644 # endif
645 #endif
671 646
672 #endif /* PNGCONF_H */ 647 #endif /* PNGCONF_H */