Changeset 846 for trunk/src/3rdparty/libpng/pngconf.h
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/3rdparty/libpng/pngconf.h
r561 r846 2 2 /* pngconf.h - machine configurable file for libpng 3 3 * 4 * libpng version 1.2.40 - September 10, 2009 5 * Copyright (c) 1998-2009 Glenn Randers-Pehrson 4 * libpng version 1.4.0 - January 3, 2010 5 * For conditions of distribution and use, see copyright notice in png.h 6 * Copyright (c) 1998-2010 Glenn Randers-Pehrson 6 7 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) 7 8 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) … … 10 11 * For conditions of distribution and use, see the disclaimer 11 12 * and license in png.h 13 * 12 14 */ 13 15 … … 21 23 #define PNGCONF_H 22 24 23 #define PNG_1_2_X 25 #ifndef PNG_NO_LIMITS_H 26 # include <limits.h> 27 #endif 28 29 /* Added at libpng-1.2.9 */ 30 31 /* config.h is created by and PNG_CONFIGURE_LIBPNG is set by the "configure" script. */ 32 #ifdef PNG_CONFIGURE_LIBPNG 33 # ifdef HAVE_CONFIG_H 34 # include "config.h" 35 # endif 36 #endif 24 37 25 38 /* 39 * Added at libpng-1.2.8 40 * 26 41 * PNG_USER_CONFIG has to be defined on the compiler command line. This 27 42 * includes the resource compiler for Windows DLL configurations. … … 31 46 # define PNG_USER_PRIVATEBUILD 32 47 # endif 33 #include "pngusr.h" 34 #endif 35 36 /* PNG_CONFIGURE_LIBPNG is set by the "configure" script. */ 37 #ifdef PNG_CONFIGURE_LIBPNG 38 #ifdef HAVE_CONFIG_H 39 #include "config.h" 40 #endif 48 # include "pngusr.h" 41 49 #endif 42 50 43 51 /* 44 * Added at libpng-1.2.845 *46 52 * If you create a private DLL you need to define in "pngusr.h" the followings: 47 53 * #define PNG_USER_PRIVATEBUILD <Describes by whom and why this version of … … 63 69 64 70 #ifdef __STDC__ 65 # ifdef SPECIALBUILD66 # pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\67 are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.")68 # endif69 70 # ifdef PRIVATEBUILD71 # pragma message("PRIVATEBUILD is deprecated.\72 Use PNG_USER_PRIVATEBUILD instead.")73 # define PNG_USER_PRIVATEBUILD PRIVATEBUILD74 # endif71 # ifdef SPECIALBUILD 72 # pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\ 73 are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.") 74 # endif 75 76 # ifdef PRIVATEBUILD 77 # pragma message("PRIVATEBUILD is deprecated.\ 78 Use PNG_USER_PRIVATEBUILD instead.") 79 # define PNG_USER_PRIVATEBUILD PRIVATEBUILD 80 # endif 75 81 #endif /* __STDC__ */ 76 82 83 /* End of material added to libpng-1.2.8 */ 84 77 85 #ifndef PNG_VERSION_INFO_ONLY 78 79 /* End of material added to libpng-1.2.8 */80 81 /* Added at libpng-1.2.19, removed at libpng-1.2.20 because it caused trouble82 Restored at libpng-1.2.21 */83 #if !defined(PNG_NO_WARN_UNINITIALIZED_ROW) && \84 !defined(PNG_WARN_UNINITIALIZED_ROW)85 # define PNG_WARN_UNINITIALIZED_ROW 186 #endif87 /* End of material added at libpng-1.2.19/1.2.21 */88 86 89 87 /* This is the size of the compression buffer, and thus the size of … … 116 114 #endif 117 115 116 /* Enabled in 1.4.0. */ 117 #ifdef PNG_ALLOW_BENIGN_ERRORS 118 # define png_benign_error png_warning 119 # define png_chunk_benign_error png_chunk_warning 120 #else 121 # ifndef PNG_BENIGN_ERRORS_SUPPORTED 122 # define png_benign_error png_error 123 # define png_chunk_benign_error png_chunk_error 124 # endif 125 #endif 126 127 /* Added at libpng version 1.4.0 */ 128 #if !defined(PNG_NO_WARNINGS) && !defined(PNG_WARNINGS_SUPPORTED) 129 # define PNG_WARNINGS_SUPPORTED 130 #endif 131 132 /* Added at libpng version 1.4.0 */ 133 #if !defined(PNG_NO_ERROR_TEXT) && !defined(PNG_ERROR_TEXT_SUPPORTED) 134 # define PNG_ERROR_TEXT_SUPPORTED 135 #endif 136 137 /* Added at libpng version 1.4.0 */ 138 #if !defined(PNG_NO_CHECK_cHRM) && !defined(PNG_CHECK_cHRM_SUPPORTED) 139 # define PNG_CHECK_cHRM_SUPPORTED 140 #endif 141 142 /* Added at libpng version 1.4.0 */ 143 #if !defined(PNG_NO_ALIGNED_MEMORY) && !defined(PNG_ALIGNED_MEMORY_SUPPORTED) 144 # define PNG_ALIGNED_MEMORY_SUPPORTED 145 #endif 146 118 147 /* Enabled by default in 1.2.0. You can disable this if you don't need to 119 148 support PNGs that are embedded in MNG datastreams */ 120 #if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES)149 #ifndef PNG_NO_MNG_FEATURES 121 150 # ifndef PNG_MNG_FEATURES_SUPPORTED 122 151 # define PNG_MNG_FEATURES_SUPPORTED … … 124 153 #endif 125 154 155 /* Added at libpng version 1.4.0 */ 126 156 #ifndef PNG_NO_FLOATING_POINT_SUPPORTED 127 157 # ifndef PNG_FLOATING_POINT_SUPPORTED … … 129 159 # endif 130 160 #endif 161 162 /* Added at libpng-1.4.0beta49 for testing (this test is no longer used 163 in libpng and png_calloc() is always present) 164 */ 165 #define PNG_CALLOC_SUPPORTED 131 166 132 167 /* If you are running on a machine where you cannot allocate more … … 173 208 * to __declspec() stuff. However, we DO need to worry about 174 209 * PNG_BUILD_DLL and PNG_STATIC because those change some defaults 175 * such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed.176 */ 177 #if defined(__CYGWIN__)178 # if defined(ALL_STATIC)179 # if defined(PNG_BUILD_DLL)210 * such as CONSOLE_IO. 211 */ 212 #ifdef __CYGWIN__ 213 # ifdef ALL_STATIC 214 # ifdef PNG_BUILD_DLL 180 215 # undef PNG_BUILD_DLL 181 216 # endif 182 # if defined(PNG_USE_DLL)217 # ifdef PNG_USE_DLL 183 218 # undef PNG_USE_DLL 184 219 # endif 185 # if defined(PNG_DLL)220 # ifdef PNG_DLL 186 221 # undef PNG_DLL 187 222 # endif 188 # if !defined(PNG_STATIC)223 # ifndef PNG_STATIC 189 224 # define PNG_STATIC 190 225 # endif 191 226 # else 192 # if defined (PNG_BUILD_DLL)193 # if defined(PNG_STATIC)227 # ifdef PNG_BUILD_DLL 228 # ifdef PNG_STATIC 194 229 # undef PNG_STATIC 195 230 # endif 196 # if defined(PNG_USE_DLL)231 # ifdef PNG_USE_DLL 197 232 # undef PNG_USE_DLL 198 233 # endif 199 # if !defined(PNG_DLL)234 # ifndef PNG_DLL 200 235 # define PNG_DLL 201 236 # endif 202 237 # else 203 # if defined(PNG_STATIC)204 # if defined(PNG_USE_DLL)238 # ifdef PNG_STATIC 239 # ifdef PNG_USE_DLL 205 240 # undef PNG_USE_DLL 206 241 # endif 207 # if defined(PNG_DLL)242 # ifdef PNG_DLL 208 243 # undef PNG_DLL 209 244 # endif 210 245 # else 211 # if !defined(PNG_USE_DLL)246 # ifndef PNG_USE_DLL 212 247 # define PNG_USE_DLL 213 248 # endif 214 # if !defined(PNG_DLL)249 # ifndef PNG_DLL 215 250 # define PNG_DLL 216 251 # endif … … 233 268 */ 234 269 235 #if defined(_WIN32_WCE) 236 # include <windows.h> 237 /* Console I/O functions are not supported on WindowsCE */ 238 # define PNG_NO_CONSOLE_IO 239 /* abort() may not be supported on some/all Windows CE platforms */ 240 # define PNG_ABORT() exit(-1) 241 # ifdef PNG_DEBUG 242 # undef PNG_DEBUG 243 # endif 244 #endif 270 #if !defined(PNG_NO_STDIO) && !defined(PNG_STDIO_SUPPORTED) 271 # define PNG_STDIO_SUPPORTED 272 #endif 273 245 274 246 275 #ifdef PNG_BUILD_DLL 247 # ifndef PNG_CONSOLE_IO_SUPPORTED 248 # ifndef PNG_NO_CONSOLE_IO 249 # define PNG_NO_CONSOLE_IO 250 # endif 276 # if !defined(PNG_CONSOLE_IO_SUPPORTED) && !defined(PNG_NO_CONSOLE_IO) 277 # define PNG_NO_CONSOLE_IO 251 278 # endif 252 279 #endif … … 262 289 # endif 263 290 # else 264 # if !defined(_WIN32_WCE) 265 /* "stdio.h" functions are not supported on WindowsCE */ 266 # include <stdio.h> 267 # endif 268 # endif 291 # include <stdio.h> 292 # endif 293 294 #if !(defined PNG_NO_CONSOLE_IO) && !defined(PNG_CONSOLE_IO_SUPPORTED) 295 # define PNG_CONSOLE_IO_SUPPORTED 296 #endif 269 297 270 298 /* This macro protects us against machines that don't have function … … 283 311 #ifdef _NO_PROTO 284 312 # define PNGARG(arglist) () 285 # ifndef PNG_TYPECAST_NULL286 # define PNG_TYPECAST_NULL287 # endif288 313 #else 289 314 # define PNGARG(arglist) arglist 290 315 #endif /* _NO_PROTO */ 291 292 316 293 317 #endif /* OF */ … … 306 330 #endif 307 331 308 /* enough people need this for various reasons to include it here */332 /* Enough people need this for various reasons to include it here */ 309 333 #if !defined(MACOS) && !defined(RISCOS) && !defined(_WIN32_WCE) 310 334 # include <sys/types.h> 311 335 #endif 312 336 313 #if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED) 337 /* PNG_SETJMP_NOT_SUPPORTED and PNG_NO_SETJMP_SUPPORTED are deprecated. */ 338 #if !defined(PNG_NO_SETJMP) && \ 339 !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED) 314 340 # define PNG_SETJMP_SUPPORTED 315 341 #endif … … 342 368 # endif /* PNG_SKIP_SETJMP_CHECK */ 343 369 344 /* include setjmp.h for error handling */370 /* Include setjmp.h for error handling */ 345 371 # include <setjmp.h> 346 372 347 373 # ifdef __linux__ 348 374 # ifdef PNG_SAVE_BSD_SOURCE 349 # if ndef _BSD_SOURCE350 # define_BSD_SOURCE375 # ifdef _BSD_SOURCE 376 # undef _BSD_SOURCE 351 377 # endif 378 # define _BSD_SOURCE 352 379 # undef PNG_SAVE_BSD_SOURCE 353 380 # endif … … 362 389 363 390 /* Other defines for things like memory and the like can go here. */ 364 #ifdef PNG_INTERNAL365 366 #include <stdlib.h>367 368 /* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which369 * aren't usually used outside the library (as far as I know), so it is370 * debatable if they should be exported at all. In the future, when it is371 * possible to have run-time registry of chunk-handling functions, some of372 * these will be made available again.373 #define PNG_EXTERN extern374 */375 #define PNG_EXTERN376 377 /* Other defines specific to compilers can go here. Try to keep378 * them inside an appropriate ifdef/endif pair for portability.379 */380 381 #if defined(PNG_FLOATING_POINT_SUPPORTED)382 # if defined(MACOS)383 /* We need to check that <math.h> hasn't already been included earlier384 * as it seems it doesn't agree with <fp.h>, yet we should really use385 * <fp.h> if possible.386 */387 # if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)388 # include <fp.h>389 # endif390 # else391 # include <math.h>392 # endif393 # if defined(_AMIGA) && defined(__SASC) && defined(_M68881)394 /* Amiga SAS/C: We must include builtin FPU functions when compiling using395 * MATH=68881396 */397 # include <m68881.h>398 # endif399 #endif400 401 /* Codewarrior on NT has linking problems without this. */402 #if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__)403 # define PNG_ALWAYS_EXTERN404 #endif405 406 /* This provides the non-ANSI (far) memory allocation routines. */407 #if defined(__TURBOC__) && defined(__MSDOS__)408 # include <mem.h>409 # include <alloc.h>410 #endif411 412 /* I have no idea why is this necessary... */413 #if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \414 defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__))415 # include <malloc.h>416 #endif417 391 418 392 /* This controls how fine the dithering gets. As this allocates … … 448 422 #endif 449 423 450 #endif /* PNG_INTERNAL */451 452 424 /* The following uses const char * instead of char * for error 453 425 * and warning message functions, so some compilers won't complain. … … 455 427 */ 456 428 457 #ifndef PNG_NO_CONST 458 # define PNG_CONST const 459 #else 460 # define PNG_CONST 429 #ifndef PNG_CONST 430 # ifndef PNG_NO_CONST 431 # define PNG_CONST const 432 # else 433 # define PNG_CONST 434 # endif 461 435 #endif 462 436 … … 478 452 479 453 /* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user 480 * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS481 * on the compile line, then pick and choose which ones to define without482 * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED454 * to turn it off with PNG_NO_READ|WRITE_TRANSFORMS on the compile line, 455 * then pick and choose which ones to define without having to edit this 456 * file. It is safe to use the PNG_NO_READ|WRITE_TRANSFORMS 483 457 * if you only want to have a png-compliant reader/writer but don't need 484 458 * any of the extra transformations. This saves about 80 kbytes in a 485 459 * typical installation of the library. (PNG_NO_* form added in version 486 * 1.0.1c, for consistency) 487 */ 488 489 /* The size of the png_text structure changed in libpng-1.0.6 when 490 * iTXt support was added. iTXt support was turned off by default through 491 * libpng-1.2.x, to support old apps that malloc the png_text structure 492 * instead of calling png_set_text() and letting libpng malloc it. It 493 * will be turned on by default in libpng-1.4.0. 494 */ 495 496 #if defined(PNG_1_0_X) || defined (PNG_1_2_X) 497 # ifndef PNG_NO_iTXt_SUPPORTED 498 # define PNG_NO_iTXt_SUPPORTED 499 # endif 500 # ifndef PNG_NO_READ_iTXt 501 # define PNG_NO_READ_iTXt 502 # endif 503 # ifndef PNG_NO_WRITE_iTXt 504 # define PNG_NO_WRITE_iTXt 505 # endif 506 #endif 507 508 #if !defined(PNG_NO_iTXt_SUPPORTED) 509 # if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt) 510 # define PNG_READ_iTXt 511 # endif 512 # if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt) 513 # define PNG_WRITE_iTXt 514 # endif 515 #endif 516 517 /* The following support, added after version 1.0.0, can be turned off here en 518 * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility 519 * with old applications that require the length of png_struct and png_info 520 * to remain unchanged. 521 */ 522 523 #ifdef PNG_LEGACY_SUPPORTED 524 # define PNG_NO_FREE_ME 525 # define PNG_NO_READ_UNKNOWN_CHUNKS 526 # define PNG_NO_WRITE_UNKNOWN_CHUNKS 527 # define PNG_NO_HANDLE_AS_UNKNOWN 528 # define PNG_NO_READ_USER_CHUNKS 529 # define PNG_NO_READ_iCCP 530 # define PNG_NO_WRITE_iCCP 531 # define PNG_NO_READ_iTXt 532 # define PNG_NO_WRITE_iTXt 533 # define PNG_NO_READ_sCAL 534 # define PNG_NO_WRITE_sCAL 535 # define PNG_NO_READ_sPLT 536 # define PNG_NO_WRITE_sPLT 537 # define PNG_NO_INFO_IMAGE 538 # define PNG_NO_READ_RGB_TO_GRAY 539 # define PNG_NO_READ_USER_TRANSFORM 540 # define PNG_NO_WRITE_USER_TRANSFORM 541 # define PNG_NO_USER_MEM 542 # define PNG_NO_READ_EMPTY_PLTE 543 # define PNG_NO_MNG_FEATURES 544 # define PNG_NO_FIXED_POINT_SUPPORTED 545 #endif 460 * 1.0.1c, for consistency; PNG_*_TRANSFORMS_NOT_SUPPORTED deprecated in 461 * 1.4.0) 462 */ 546 463 547 464 /* Ignore attempt to turn off both floating and fixed point support */ … … 551 468 #endif 552 469 553 #ifndef PNG_NO_FREE_ME554 # define PNG_FREE_ME_SUPPORTED555 #endif556 557 470 #ifdef PNG_READ_SUPPORTED 558 471 472 /* PNG_READ_TRANSFORMS_NOT_SUPPORTED is deprecated. */ 559 473 #if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \ 560 474 !defined(PNG_NO_READ_TRANSFORMS) … … 584 498 # define PNG_READ_INVERT_SUPPORTED 585 499 # endif 500 #if 0 /* removed from libpng-1.4.0 */ 586 501 # ifndef PNG_NO_READ_DITHER 587 502 # define PNG_READ_DITHER_SUPPORTED 588 503 # endif 504 #endif /* 0 */ 589 505 # ifndef PNG_NO_READ_BACKGROUND 590 506 # define PNG_READ_BACKGROUND_SUPPORTED … … 619 535 #endif /* PNG_READ_TRANSFORMS_SUPPORTED */ 620 536 537 /* PNG_PROGRESSIVE_READ_NOT_SUPPORTED is deprecated. */ 621 538 #if !defined(PNG_NO_PROGRESSIVE_READ) && \ 622 !defined(PNG_PROGRESSIVE_READ_SUPPORTED) /* if you don't do progressive */ 623 # define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */ 624 #endif /* about interlacing capability! You'll */ 625 /* still have interlacing unless you change the following line: */ 626 627 #define PNG_READ_INTERLACING_SUPPORTED /* required in PNG-compliant decoders */ 539 !defined(PNG_PROGRESSIVE_READ_NOT_SUPPORTED) /* if you don't do progressive */ 540 # define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */ 541 #endif /* about interlacing capability! You'll */ 542 /* still have interlacing unless you change the following define: */ 543 544 #define PNG_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */ 545 546 /* PNG_NO_SEQUENTIAL_READ_SUPPORTED is deprecated. */ 547 #if !defined(PNG_NO_SEQUENTIAL_READ) && \ 548 !defined(PNG_SEQUENTIAL_READ_SUPPORTED) && \ 549 !defined(PNG_NO_SEQUENTIAL_READ_SUPPORTED) 550 # define PNG_SEQUENTIAL_READ_SUPPORTED 551 #endif 628 552 629 553 #ifndef PNG_NO_READ_COMPOSITE_NODIV 630 554 # ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */ 631 # define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */ 632 # endif 633 #endif 634 635 #if defined(PNG_1_0_X) || defined (PNG_1_2_X) 636 /* Deprecated, will be removed from version 2.0.0. 637 Use PNG_MNG_FEATURES_SUPPORTED instead. */ 638 #ifndef PNG_NO_READ_EMPTY_PLTE 639 # define PNG_READ_EMPTY_PLTE_SUPPORTED 640 #endif 555 # define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */ 556 # endif 557 #endif 558 559 #if !defined(PNG_NO_GET_INT_32) || defined(PNG_READ_oFFS_SUPPORTED) || \ 560 defined(PNG_READ_pCAL_SUPPORTED) 561 # ifndef PNG_GET_INT_32_SUPPORTED 562 # define PNG_GET_INT_32_SUPPORTED 563 # endif 641 564 #endif 642 565 … … 645 568 #ifdef PNG_WRITE_SUPPORTED 646 569 647 # if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \ 570 /* PNG_WRITE_TRANSFORMS_NOT_SUPPORTED is deprecated. */ 571 #if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \ 648 572 !defined(PNG_NO_WRITE_TRANSFORMS) 649 573 # define PNG_WRITE_TRANSFORMS_SUPPORTED … … 685 609 #if !defined(PNG_NO_WRITE_INTERLACING_SUPPORTED) && \ 686 610 !defined(PNG_WRITE_INTERLACING_SUPPORTED) 687 #define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant 688 encoders, but can cause trouble 689 if left undefined */ 611 /* This is not required for PNG-compliant encoders, but can cause 612 * trouble if left undefined 613 */ 614 # define PNG_WRITE_INTERLACING_SUPPORTED 690 615 #endif 691 616 … … 700 625 #endif 701 626 702 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)703 /* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */ 704 # ifndef PNG_NO_WRITE_EMPTY_PLTE705 # define PNG_WRITE_EMPTY_PLTE_SUPPORTED706 # endif627 #if !defined(PNG_NO_SAVE_INT_32) || defined(PNG_WRITE_oFFS_SUPPORTED) || \ 628 defined(PNG_WRITE_pCAL_SUPPORTED) 629 # ifndef PNG_SAVE_INT_32_SUPPORTED 630 # define PNG_SAVE_INT_32_SUPPORTED 631 # endif 707 632 #endif 708 633 709 634 #endif /* PNG_WRITE_SUPPORTED */ 710 635 711 #ifndef PNG_1_0_X 712 # ifndef PNG_NO_ERROR_NUMBERS 713 # define PNG_ERROR_NUMBERS_SUPPORTED 714 # endif 715 #endif /* PNG_1_0_X */ 636 #define PNG_NO_ERROR_NUMBERS 716 637 717 638 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ … … 722 643 #endif 723 644 724 #if ndef PNG_NO_STDIO645 #if defined(PNG_STDIO_SUPPORTED) && !defined(PNG_TIME_RFC1123_SUPPORTED) 725 646 # define PNG_TIME_RFC1123_SUPPORTED 726 647 #endif … … 746 667 #endif 747 668 748 /* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0 749 * and removed from version 1.2.20. The following will be removed 750 * from libpng-1.4.0 751 */ 752 753 #if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_OPTIMIZED_CODE) 754 # ifndef PNG_OPTIMIZED_CODE_SUPPORTED 755 # define PNG_OPTIMIZED_CODE_SUPPORTED 756 # endif 757 #endif 758 759 #if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE) 760 # ifndef PNG_ASSEMBLER_CODE_SUPPORTED 761 # define PNG_ASSEMBLER_CODE_SUPPORTED 762 # endif 763 764 # if defined(__GNUC__) && defined(__x86_64__) && (__GNUC__ < 4) 765 /* work around 64-bit gcc compiler bugs in gcc-3.x */ 766 # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) 767 # define PNG_NO_MMX_CODE 768 # endif 769 # endif 770 771 # if defined(__APPLE__) 772 # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) 773 # define PNG_NO_MMX_CODE 774 # endif 775 # endif 776 777 # if (defined(__MWERKS__) && ((__MWERKS__ < 0x0900) || macintosh)) 778 # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) 779 # define PNG_NO_MMX_CODE 780 # endif 781 # endif 782 783 # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) 784 # define PNG_MMX_CODE_SUPPORTED 785 # endif 786 787 #endif 788 /* end of obsolete code to be removed from libpng-1.4.0 */ 789 790 #if !defined(PNG_1_0_X) 669 /* Added at libpng-1.2.0 */ 791 670 #if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED) 792 671 # define PNG_USER_MEM_SUPPORTED 793 672 #endif 794 #endif /* PNG_1_0_X */795 673 796 674 /* Added at libpng-1.2.6 */ 797 #if !defined(PNG_1_0_X)798 675 #ifndef PNG_SET_USER_LIMITS_SUPPORTED 799 #if !defined(PNG_NO_SET_USER_LIMITS) && !defined(PNG_SET_USER_LIMITS_SUPPORTED) 800 # define PNG_SET_USER_LIMITS_SUPPORTED 801 #endif 802 #endif 803 #endif /* PNG_1_0_X */ 804 805 /* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGS no matter 676 # ifndef PNG_NO_SET_USER_LIMITS 677 # define PNG_SET_USER_LIMITS_SUPPORTED 678 # endif 679 #endif 680 681 /* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGs no matter 806 682 * how large, set these limits to 0x7fffffffL 807 683 */ … … 813 689 #endif 814 690 815 /* Added at libpng-1.2.34 and 1.4.0 */ 691 /* Added at libpng-1.4.0 */ 692 #ifndef PNG_USER_CHUNK_CACHE_MAX 693 # define PNG_USER_CHUNK_CACHE_MAX 0x7fffffffL 694 #endif 695 696 /* Added at libpng-1.4.0 */ 697 #if !defined(PNG_NO_IO_STATE) && !defined(PNG_IO_STATE_SUPPORTED) 698 # define PNG_IO_STATE_SUPPORTED 699 #endif 700 701 #ifndef PNG_LITERAL_SHARP 702 # define PNG_LITERAL_SHARP 0x23 703 #endif 704 #ifndef PNG_LITERAL_LEFT_SQUARE_BRACKET 705 # define PNG_LITERAL_LEFT_SQUARE_BRACKET 0x5b 706 #endif 707 #ifndef PNG_LITERAL_RIGHT_SQUARE_BRACKET 708 # define PNG_LITERAL_RIGHT_SQUARE_BRACKET 0x5d 709 #endif 816 710 #ifndef PNG_STRING_NEWLINE 817 711 #define PNG_STRING_NEWLINE "\n" … … 820 714 /* These are currently experimental features, define them if you want */ 821 715 822 /* very little testing */716 /* Very little testing */ 823 717 /* 824 718 #ifdef PNG_READ_SUPPORTED … … 837 731 */ 838 732 839 /* Buggy compilers (e.g., gcc 2.7.2.2) need this */ 840 /* 841 #define PNG_NO_POINTER_INDEXING 842 */ 843 844 /* These functions are turned off by default, as they will be phased out. */ 845 /* 846 #define PNG_USELESS_TESTS_SUPPORTED 847 #define PNG_CORRECT_PALETTE_SUPPORTED 848 */ 733 #if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS) 734 # define PNG_USE_READ_MACROS 735 #endif 736 737 /* Buggy compilers (e.g., gcc 2.7.2.2) need PNG_NO_POINTER_INDEXING */ 738 739 #if !defined(PNG_NO_POINTER_INDEXING) && \ 740 !defined(PNG_POINTER_INDEXING_SUPPORTED) 741 # define PNG_POINTER_INDEXING_SUPPORTED 742 #endif 743 849 744 850 745 /* Any chunks you are not interested in, you can undef here. The … … 854 749 */ 855 750 751 /* The size of the png_text structure changed in libpng-1.0.6 when 752 * iTXt support was added. iTXt support was turned off by default through 753 * libpng-1.2.x, to support old apps that malloc the png_text structure 754 * instead of calling png_set_text() and letting libpng malloc it. It 755 * was turned on by default in libpng-1.4.0. 756 */ 757 758 /* PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED is deprecated. */ 856 759 #if defined(PNG_READ_SUPPORTED) && \ 857 760 !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ … … 860 763 #endif 861 764 765 /* PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED is deprecated. */ 862 766 #if defined(PNG_WRITE_SUPPORTED) && \ 863 767 !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ … … 873 777 # define PNG_NO_READ_zTXt 874 778 #endif 779 875 780 #ifndef PNG_NO_READ_bKGD 876 781 # define PNG_READ_bKGD_SUPPORTED … … 973 878 # endif 974 879 #endif 975 976 880 #ifndef PNG_NO_HANDLE_AS_UNKNOWN 977 881 # ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED … … 1100 1004 #endif 1101 1005 1006 #ifdef PNG_WRITE_tIME_SUPPORTED 1007 # ifndef PNG_NO_CONVERT_tIME 1008 # ifndef _WIN32_WCE 1009 /* The "tm" structure is not supported on WindowsCE */ 1010 # ifndef PNG_CONVERT_tIME_SUPPORTED 1011 # define PNG_CONVERT_tIME_SUPPORTED 1012 # endif 1013 # endif 1014 # endif 1015 #endif 1016 1102 1017 #endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */ 1018 1019 #if !defined(PNG_NO_WRITE_FILTER) && !defined(PNG_WRITE_FILTER_SUPPORTED) 1020 # define PNG_WRITE_FILTER_SUPPORTED 1021 #endif 1103 1022 1104 1023 #ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS … … 1108 1027 # endif 1109 1028 #endif 1110 1111 1029 #ifndef PNG_NO_HANDLE_AS_UNKNOWN 1112 1030 # ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED … … 1124 1042 #endif 1125 1043 1126 /* need the time information for reading tIME chunks */ 1127 #if defined(PNG_tIME_SUPPORTED) 1128 # if !defined(_WIN32_WCE) 1044 /* Need the time information for converting tIME chunks */ 1045 #ifdef PNG_CONVERT_tIME_SUPPORTED 1129 1046 /* "time.h" functions are not supported on WindowsCE */ 1130 1047 # include <time.h> 1131 # endif1132 1048 #endif 1133 1049 … … 1137 1053 * don't have to be exactly that size. Some compilers dislike passing 1138 1054 * unsigned shorts as function parameters, so you may be better off using 1139 * unsigned int for png_uint_16. Likewise, for 64-bit systems, you may 1140 * want to have unsigned int for png_uint_32 instead of unsigned long. 1141 */ 1142 1055 * unsigned int for png_uint_16. 1056 */ 1057 1058 #if defined(INT_MAX) && (INT_MAX > 0x7ffffffeL) 1059 typedef unsigned int png_uint_32; 1060 typedef int png_int_32; 1061 #else 1143 1062 typedef unsigned long png_uint_32; 1144 1063 typedef long png_int_32; 1064 #endif 1145 1065 typedef unsigned short png_uint_16; 1146 1066 typedef short png_int_16; 1147 1067 typedef unsigned char png_byte; 1148 1068 1149 /* This is usually size_t. It is typedef'ed just in case you need it to 1150 change (I'm not sure if you will or not, so I thought I'd be safe) */ 1151 #ifdef PNG_SIZE_T 1152 typedef PNG_SIZE_T png_size_t; 1153 # define png_sizeof(x) png_convert_size(sizeof(x)) 1069 #ifdef PNG_NO_SIZE_T 1070 typedef unsigned int png_size_t; 1154 1071 #else 1155 1072 typedef size_t png_size_t; 1156 # define png_sizeof(x) sizeof(x)1157 # endif1073 #endif 1074 #define png_sizeof(x) sizeof(x) 1158 1075 1159 1076 /* The following is needed for medium model support. It cannot be in the 1160 * PNG_INTERNAL section. Needs modification for other compilers besides1077 * pngpriv.h header. Needs modification for other compilers besides 1161 1078 * MSC. Model independent support declares all arrays and pointers to be 1162 1079 * large using the far keyword. The zlib version used must also support … … 1167 1084 1168 1085 /* Separate compiler dependencies (problem here is that zlib.h always 1169 defines FAR. (SJT) */ 1086 * defines FAR. (SJT) 1087 */ 1170 1088 #ifdef __BORLANDC__ 1171 1089 # if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__) … … 1198 1116 1199 1117 /* MSC Medium model */ 1200 #if defined(FAR)1201 # if defined(M_I86MM)1118 #ifdef FAR 1119 # ifdef M_I86MM 1202 1120 # define USE_FAR_KEYWORD 1203 1121 # define FARDATA FAR … … 1232 1150 1233 1151 #ifndef PNG_NO_STDIO 1234 #if defined(_WIN32_WCE)1235 typedef HANDLE png_FILE_p;1236 #else1237 1152 typedef FILE * png_FILE_p; 1238 #endif1239 1153 #endif 1240 1154 … … 1259 1173 typedef char FAR * FAR * FAR * png_charppp; 1260 1174 1261 #if defined(PNG_1_0_X) || defined(PNG_1_2_X) 1262 /* SPC - Is this stuff deprecated? */ 1263 /* It'll be removed as of libpng-1.4.0 - GR-P */ 1264 /* libpng typedefs for types in zlib. If zlib changes 1265 * or another compression library is used, then change these. 1266 * Eliminates need to change all the source files. 1267 */ 1268 typedef charf * png_zcharp; 1269 typedef charf * FAR * png_zcharpp; 1270 typedef z_stream FAR * png_zstreamp; 1271 #endif /* (PNG_1_0_X) || defined(PNG_1_2_X) */ 1272 1273 /* 1274 * Define PNG_BUILD_DLL if the module being built is a Windows 1175 /* Define PNG_BUILD_DLL if the module being built is a Windows 1275 1176 * LIBPNG DLL. 1276 1177 * … … 1292 1193 # define PNG_DLL 1293 1194 #endif 1294 /* If CYGWIN, then disallow GLOBAL ARRAYS unless building a static lib. 1295 * When building a static lib, default to no GLOBAL ARRAYS, but allow 1296 * command-line override 1297 */ 1298 #if defined(__CYGWIN__) 1299 # if !defined(PNG_STATIC) 1300 # if defined(PNG_USE_GLOBAL_ARRAYS) 1301 # undef PNG_USE_GLOBAL_ARRAYS 1302 # endif 1303 # if !defined(PNG_USE_LOCAL_ARRAYS) 1304 # define PNG_USE_LOCAL_ARRAYS 1305 # endif 1306 # else 1307 # if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS) 1308 # if defined(PNG_USE_GLOBAL_ARRAYS) 1309 # undef PNG_USE_GLOBAL_ARRAYS 1310 # endif 1311 # endif 1312 # endif 1313 # if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) 1314 # define PNG_USE_LOCAL_ARRAYS 1315 # endif 1316 #endif 1317 1318 /* Do not use global arrays (helps with building DLL's) 1319 * They are no longer used in libpng itself, since version 1.0.5c, 1320 * but might be required for some pre-1.0.5c applications. 1321 */ 1322 #if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) 1323 # if defined(PNG_NO_GLOBAL_ARRAYS) || \ 1324 (defined(__GNUC__) && defined(PNG_DLL)) || defined(_MSC_VER) 1325 # define PNG_USE_LOCAL_ARRAYS 1326 # else 1327 # define PNG_USE_GLOBAL_ARRAYS 1328 # endif 1329 #endif 1330 1331 #if defined(__CYGWIN__) 1195 1196 #ifdef __CYGWIN__ 1332 1197 # undef PNGAPI 1333 1198 # define PNGAPI __cdecl … … 1335 1200 # define PNG_IMPEXP 1336 1201 #endif 1202 1203 #define PNG_USE_LOCAL_ARRAYS /* Not used in libpng, defined for legacy apps */ 1337 1204 1338 1205 /* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall", … … 1372 1239 # endif 1373 1240 1374 # if !defined(PNG_IMPEXP) 1375 1376 # define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol 1377 # define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol 1378 1379 /* Borland/Microsoft */ 1380 # if defined(_MSC_VER) || defined(__BORLANDC__) 1381 # if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500) 1382 # define PNG_EXPORT PNG_EXPORT_TYPE1 1383 # else 1384 # define PNG_EXPORT PNG_EXPORT_TYPE2 1385 # if defined(PNG_BUILD_DLL) 1386 # define PNG_IMPEXP __export 1387 # else 1388 # define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in 1389 VC++ */ 1390 # endif /* Exists in Borland C++ for 1391 C++ classes (== huge) */ 1392 # endif 1393 # endif 1394 1395 # if !defined(PNG_IMPEXP) 1396 # if defined(PNG_BUILD_DLL) 1397 # define PNG_IMPEXP __declspec(dllexport) 1398 # else 1399 # define PNG_IMPEXP __declspec(dllimport) 1400 # endif 1401 # endif 1241 # ifndef PNG_IMPEXP 1242 1243 # define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol 1244 # define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol 1245 1246 /* Borland/Microsoft */ 1247 # if defined(_MSC_VER) || defined(__BORLANDC__) 1248 # if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500) 1249 # define PNG_EXPORT PNG_EXPORT_TYPE1 1250 # else 1251 # define PNG_EXPORT PNG_EXPORT_TYPE2 1252 # ifdef PNG_BUILD_DLL 1253 # define PNG_IMPEXP __export 1254 # else 1255 # define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in VC++ */ 1256 # endif /* Exists in Borland C++ for 1257 C++ classes (== huge) */ 1258 # endif 1259 # endif 1260 1261 # ifndef PNG_IMPEXP 1262 # ifdef PNG_BUILD_DLL 1263 # define PNG_IMPEXP __declspec(dllexport) 1264 # else 1265 # define PNG_IMPEXP __declspec(dllimport) 1266 # endif 1267 # endif 1402 1268 # endif /* PNG_IMPEXP */ 1403 1269 #else /* !(DLL || non-cygwin WINDOWS) */ 1404 1270 # if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) 1405 # 1406 # 1407 # 1271 # ifndef PNGAPI 1272 # define PNGAPI _System 1273 # endif 1408 1274 # else 1409 # 1410 # 1275 # if 0 /* ... other platforms, with other meanings */ 1276 # endif 1411 1277 # endif 1412 1278 … … 1431 1297 # define PNG_EXPORT(type,symbol) PNG_FUNCTION_EXPORT symbol END 1432 1298 # endif 1433 # ifdef PNG_USE_GLOBAL_ARRAYS1434 # ifndef PNG_EXPORT_VAR1435 # define PNG_EXPORT_VAR(type) PNG_DATA_EXPORT1436 # endif1437 # endif1438 1299 #endif 1439 1300 … … 1442 1303 #endif 1443 1304 1444 #ifdef PNG_USE_GLOBAL_ARRAYS 1445 # ifndef PNG_EXPORT_VAR 1446 # define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type 1447 # endif 1448 #endif 1449 1450 /* User may want to use these so they are not in PNG_INTERNAL. Any library 1451 * functions that are passed far data must be model independent. 1452 */ 1453 1305 /* Support for compiler specific function attributes. These are used 1306 * so that where compiler support is available incorrect use of API 1307 * functions in png.h will generate compiler warnings. 1308 * 1309 * Added at libpng-1.2.41. 1310 */ 1311 1312 #ifndef PNG_NO_PEDANTIC_WARNINGS 1313 # ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED 1314 # define PNG_PEDANTIC_WARNINGS_SUPPORTED 1315 # endif 1316 #endif 1317 1318 #ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED 1319 /* Support for compiler specific function attributes. These are used 1320 * so that where compiler support is available incorrect use of API 1321 * functions in png.h will generate compiler warnings. Added at libpng 1322 * version 1.2.41. 1323 */ 1324 # ifdef __GNUC__ 1325 # ifndef PNG_USE_RESULT 1326 # define PNG_USE_RESULT __attribute__((__warn_unused_result__)) 1327 # endif 1328 # ifndef PNG_NORETURN 1329 # define PNG_NORETURN __attribute__((__noreturn__)) 1330 # endif 1331 # ifndef PNG_ALLOCATED 1332 # define PNG_ALLOCATED __attribute__((__malloc__)) 1333 # endif 1334 1335 /* This specifically protects structure members that should only be 1336 * accessed from within the library, therefore should be empty during 1337 * a library build. 1338 */ 1339 # ifndef PNG_DEPRECATED 1340 # define PNG_DEPRECATED __attribute__((__deprecated__)) 1341 # endif 1342 # ifndef PNG_DEPSTRUCT 1343 # define PNG_DEPSTRUCT __attribute__((__deprecated__)) 1344 # endif 1345 # ifndef PNG_PRIVATE 1346 # if 0 /* Doesn't work so we use deprecated instead*/ 1347 # define PNG_PRIVATE \ 1348 __attribute__((warning("This function is not exported by libpng."))) 1349 # else 1350 # define PNG_PRIVATE \ 1351 __attribute__((__deprecated__)) 1352 # endif 1353 # endif /* PNG_PRIVATE */ 1354 # endif /* __GNUC__ */ 1355 #endif /* PNG_PEDANTIC_WARNINGS */ 1356 1357 #ifndef PNG_DEPRECATED 1358 # define PNG_DEPRECATED /* Use of this function is deprecated */ 1359 #endif 1360 #ifndef PNG_USE_RESULT 1361 # define PNG_USE_RESULT /* The result of this function must be checked */ 1362 #endif 1363 #ifndef PNG_NORETURN 1364 # define PNG_NORETURN /* This function does not return */ 1365 #endif 1366 #ifndef PNG_ALLOCATED 1367 # define PNG_ALLOCATED /* The result of the function is new memory */ 1368 #endif 1369 #ifndef PNG_DEPSTRUCT 1370 # define PNG_DEPSTRUCT /* Access to this struct member is deprecated */ 1371 #endif 1372 #ifndef PNG_PRIVATE 1373 # define PNG_PRIVATE /* This is a private libpng function */ 1374 #endif 1375 1376 /* Users may want to use these so they are not private. Any library 1377 * functions that are passed far data must be model-independent. 1378 */ 1379 1380 /* memory model/platform independent fns */ 1454 1381 #ifndef PNG_ABORT 1455 # define PNG_ABORT() abort() 1456 #endif 1457 1458 #ifdef PNG_SETJMP_SUPPORTED 1459 # define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) 1460 #else 1461 # define png_jmpbuf(png_ptr) \ 1462 (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED) 1463 #endif 1464 1465 #if defined(USE_FAR_KEYWORD) /* memory model independent fns */ 1466 /* use this to make far-to-near assignments */ 1382 # if defined(_WINDOWS_) || defined(_WIN32_WCE) 1383 # define PNG_ABORT() ExitProcess(0) 1384 # else 1385 # define PNG_ABORT() abort() 1386 # endif 1387 #endif 1388 1389 #ifdef USE_FAR_KEYWORD 1390 /* Use this to make far-to-near assignments */ 1467 1391 # define CHECK 1 1468 1392 # define NOCHECK 0 1469 1393 # define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK)) 1470 1394 # define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK)) 1471 # define png_snprintf _fsnprintf /* Added to v 1.2.19 */ 1395 # define png_strcpy _fstrcpy 1396 # define png_strncpy _fstrncpy /* Added to v 1.2.6 */ 1472 1397 # define png_strlen _fstrlen 1473 1398 # define png_memcmp _fmemcmp /* SJT: added */ 1474 1399 # define png_memcpy _fmemcpy 1475 1400 # define png_memset _fmemset 1476 #else /* use the usual functions */ 1477 # define CVT_PTR(ptr) (ptr) 1478 # define CVT_PTR_NOCHECK(ptr) (ptr) 1479 # ifndef PNG_NO_SNPRINTF 1480 # ifdef _MSC_VER 1481 # define png_snprintf _snprintf /* Added to v 1.2.19 */ 1482 # define png_snprintf2 _snprintf 1483 # define png_snprintf6 _snprintf 1401 # define png_sprintf sprintf 1402 #else 1403 # ifdef _WINDOWS_ /* Favor Windows over C runtime fns */ 1404 # define CVT_PTR(ptr) (ptr) 1405 # define CVT_PTR_NOCHECK(ptr) (ptr) 1406 # define png_strcpy lstrcpyA 1407 # define png_strncpy lstrcpynA 1408 # define png_strlen lstrlenA 1409 # define png_memcmp memcmp 1410 # define png_memcpy CopyMemory 1411 # define png_memset memset 1412 # define png_sprintf wsprintfA 1413 # else 1414 # define CVT_PTR(ptr) (ptr) 1415 # define CVT_PTR_NOCHECK(ptr) (ptr) 1416 # define png_strcpy strcpy 1417 # define png_strncpy strncpy /* Added to v 1.2.6 */ 1418 # define png_strlen strlen 1419 # define png_memcmp memcmp /* SJT: added */ 1420 # define png_memcpy memcpy 1421 # define png_memset memset 1422 # define png_sprintf sprintf 1423 # ifndef PNG_NO_SNPRINTF 1424 # ifdef _MSC_VER 1425 # define png_snprintf _snprintf /* Added to v 1.2.19 */ 1426 # define png_snprintf2 _snprintf 1427 # define png_snprintf6 _snprintf 1428 # else 1429 # define png_snprintf snprintf /* Added to v 1.2.19 */ 1430 # define png_snprintf2 snprintf 1431 # define png_snprintf6 snprintf 1432 # endif 1484 1433 # else 1485 # define png_snprintf snprintf /* Added to v 1.2.19 */ 1486 # define png_snprintf2 snprintf 1487 # define png_snprintf6 snprintf 1488 # endif 1434 /* You don't have or don't want to use snprintf(). Caution: Using 1435 * sprintf instead of snprintf exposes your application to accidental 1436 * or malevolent buffer overflows. If you don't have snprintf() 1437 * as a general rule you should provide one (you can get one from 1438 * Portable OpenSSH). 1439 */ 1440 # define png_snprintf(s1,n,fmt,x1) sprintf(s1,fmt,x1) 1441 # define png_snprintf2(s1,n,fmt,x1,x2) sprintf(s1,fmt,x1,x2) 1442 # define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \ 1443 sprintf(s1,fmt,x1,x2,x3,x4,x5,x6) 1444 # endif 1445 # endif 1446 #endif 1447 1448 /* png_alloc_size_t is guaranteed to be no smaller than png_size_t, 1449 * and no smaller than png_uint_32. Casts from png_size_t or png_uint_32 1450 * to png_alloc_size_t are not necessary; in fact, it is recommended 1451 * not to use them at all so that the compiler can complain when something 1452 * turns out to be problematic. 1453 * Casts in the other direction (from png_alloc_size_t to png_size_t or 1454 * png_uint_32) should be explicitly applied; however, we do not expect 1455 * to encounter practical situations that require such conversions. 1456 */ 1457 #if defined(__TURBOC__) && !defined(__FLAT__) 1458 # define png_mem_alloc farmalloc 1459 # define png_mem_free farfree 1460 typedef unsigned long png_alloc_size_t; 1461 #else 1462 # if defined(_MSC_VER) && defined(MAXSEG_64K) 1463 # define png_mem_alloc(s) halloc(s, 1) 1464 # define png_mem_free hfree 1465 typedef unsigned long png_alloc_size_t; 1489 1466 # else 1490 /* You don't have or don't want to use snprintf(). Caution: Using 1491 * sprintf instead of snprintf exposes your application to accidental 1492 * or malevolent buffer overflows. If you don't have snprintf() 1493 * as a general rule you should provide one (you can get one from 1494 * Portable OpenSSH). */ 1495 # define png_snprintf(s1,n,fmt,x1) sprintf(s1,fmt,x1) 1496 # define png_snprintf2(s1,n,fmt,x1,x2) sprintf(s1,fmt,x1,x2) 1497 # define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \ 1498 sprintf(s1,fmt,x1,x2,x3,x4,x5,x6) 1499 # endif 1500 # define png_strlen strlen 1501 # define png_memcmp memcmp /* SJT: added */ 1502 # define png_memcpy memcpy 1503 # define png_memset memset 1504 #endif 1505 /* End of memory model independent support */ 1467 # if defined(_WINDOWS_) && (!defined(INT_MAX) || INT_MAX <= 0x7ffffffeL) 1468 # define png_mem_alloc(s) HeapAlloc(GetProcessHeap(), 0, s) 1469 # define png_mem_free(p) HeapFree(GetProcessHeap(), 0, p) 1470 typedef DWORD png_alloc_size_t; 1471 # else 1472 # define png_mem_alloc malloc 1473 # define png_mem_free free 1474 typedef png_size_t png_alloc_size_t; 1475 # endif 1476 # endif 1477 #endif 1478 /* End of memory model/platform independent support */ 1506 1479 1507 1480 /* Just a little check that someone hasn't tried to define something … … 1513 1486 #endif 1514 1487 1488 1515 1489 /* Added at libpng-1.2.8 */ 1516 1490 #endif /* PNG_VERSION_INFO_ONLY */
Note:
See TracChangeset
for help on using the changeset viewer.