nuclear@26: nuclear@26: /* pngconf.h - machine configurable file for libpng nuclear@26: * nuclear@26: * libpng version 1.2.33 - October 31, 2008 nuclear@26: * For conditions of distribution and use, see copyright notice in png.h nuclear@26: * Copyright (c) 1998-2008 Glenn Randers-Pehrson nuclear@26: * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) nuclear@26: * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) nuclear@26: */ nuclear@26: nuclear@26: /* Any machine specific code is near the front of this file, so if you nuclear@26: * are configuring libpng for a machine, you may want to read the section nuclear@26: * starting here down to where it starts to typedef png_color, png_text, nuclear@26: * and png_info. nuclear@26: */ nuclear@26: nuclear@26: #ifndef PNGCONF_H nuclear@26: #define PNGCONF_H nuclear@26: nuclear@26: #define PNG_1_2_X nuclear@26: nuclear@26: /* nuclear@26: * PNG_USER_CONFIG has to be defined on the compiler command line. This nuclear@26: * includes the resource compiler for Windows DLL configurations. nuclear@26: */ nuclear@26: #ifdef PNG_USER_CONFIG nuclear@26: # ifndef PNG_USER_PRIVATEBUILD nuclear@26: # define PNG_USER_PRIVATEBUILD nuclear@26: # endif nuclear@26: #include "pngusr.h" nuclear@26: #endif nuclear@26: nuclear@26: /* PNG_CONFIGURE_LIBPNG is set by the "configure" script. */ nuclear@26: #ifdef PNG_CONFIGURE_LIBPNG nuclear@26: #ifdef HAVE_CONFIG_H nuclear@26: #include "config.h" nuclear@26: #endif nuclear@26: #endif nuclear@26: nuclear@26: /* nuclear@26: * Added at libpng-1.2.8 nuclear@26: * nuclear@26: * If you create a private DLL you need to define in "pngusr.h" the followings: nuclear@26: * #define PNG_USER_PRIVATEBUILD nuclear@26: * e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons." nuclear@26: * #define PNG_USER_DLLFNAME_POSTFIX nuclear@26: * e.g. // private DLL "libpng13gx.dll" nuclear@26: * #define PNG_USER_DLLFNAME_POSTFIX "gx" nuclear@26: * nuclear@26: * The following macros are also at your disposal if you want to complete the nuclear@26: * DLL VERSIONINFO structure. nuclear@26: * - PNG_USER_VERSIONINFO_COMMENTS nuclear@26: * - PNG_USER_VERSIONINFO_COMPANYNAME nuclear@26: * - PNG_USER_VERSIONINFO_LEGALTRADEMARKS nuclear@26: */ nuclear@26: nuclear@26: #ifdef __STDC__ nuclear@26: #ifdef SPECIALBUILD nuclear@26: # pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\ nuclear@26: are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.") nuclear@26: #endif nuclear@26: nuclear@26: #ifdef PRIVATEBUILD nuclear@26: # pragma message("PRIVATEBUILD is deprecated.\ nuclear@26: Use PNG_USER_PRIVATEBUILD instead.") nuclear@26: # define PNG_USER_PRIVATEBUILD PRIVATEBUILD nuclear@26: #endif nuclear@26: #endif /* __STDC__ */ nuclear@26: nuclear@26: #ifndef PNG_VERSION_INFO_ONLY nuclear@26: nuclear@26: /* End of material added to libpng-1.2.8 */ nuclear@26: nuclear@26: /* Added at libpng-1.2.19, removed at libpng-1.2.20 because it caused trouble nuclear@26: Restored at libpng-1.2.21 */ nuclear@26: #if !defined(PNG_NO_WARN_UNINITIALIZED_ROW) && \ nuclear@26: !defined(PNG_WARN_UNINITIALIZED_ROW) nuclear@26: # define PNG_WARN_UNINITIALIZED_ROW 1 nuclear@26: #endif nuclear@26: /* End of material added at libpng-1.2.19/1.2.21 */ nuclear@26: nuclear@26: /* This is the size of the compression buffer, and thus the size of nuclear@26: * an IDAT chunk. Make this whatever size you feel is best for your nuclear@26: * machine. One of these will be allocated per png_struct. When this nuclear@26: * is full, it writes the data to the disk, and does some other nuclear@26: * calculations. Making this an extremely small size will slow nuclear@26: * the library down, but you may want to experiment to determine nuclear@26: * where it becomes significant, if you are concerned with memory nuclear@26: * usage. Note that zlib allocates at least 32Kb also. For readers, nuclear@26: * this describes the size of the buffer available to read the data in. nuclear@26: * Unless this gets smaller than the size of a row (compressed), nuclear@26: * it should not make much difference how big this is. nuclear@26: */ nuclear@26: nuclear@26: #ifndef PNG_ZBUF_SIZE nuclear@26: # define PNG_ZBUF_SIZE 8192 nuclear@26: #endif nuclear@26: nuclear@26: /* Enable if you want a write-only libpng */ nuclear@26: nuclear@26: #ifndef PNG_NO_READ_SUPPORTED nuclear@26: # define PNG_READ_SUPPORTED nuclear@26: #endif nuclear@26: nuclear@26: /* Enable if you want a read-only libpng */ nuclear@26: nuclear@26: #ifndef PNG_NO_WRITE_SUPPORTED nuclear@26: # define PNG_WRITE_SUPPORTED nuclear@26: #endif nuclear@26: nuclear@26: /* Enabled by default in 1.2.0. You can disable this if you don't need to nuclear@26: support PNGs that are embedded in MNG datastreams */ nuclear@26: #if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES) nuclear@26: # ifndef PNG_MNG_FEATURES_SUPPORTED nuclear@26: # define PNG_MNG_FEATURES_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: nuclear@26: #ifndef PNG_NO_FLOATING_POINT_SUPPORTED nuclear@26: # ifndef PNG_FLOATING_POINT_SUPPORTED nuclear@26: # define PNG_FLOATING_POINT_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: nuclear@26: /* If you are running on a machine where you cannot allocate more nuclear@26: * than 64K of memory at once, uncomment this. While libpng will not nuclear@26: * normally need that much memory in a chunk (unless you load up a very nuclear@26: * large file), zlib needs to know how big of a chunk it can use, and nuclear@26: * libpng thus makes sure to check any memory allocation to verify it nuclear@26: * will fit into memory. nuclear@26: #define PNG_MAX_MALLOC_64K nuclear@26: */ nuclear@26: #if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) nuclear@26: # define PNG_MAX_MALLOC_64K nuclear@26: #endif nuclear@26: nuclear@26: /* Special munging to support doing things the 'cygwin' way: nuclear@26: * 'Normal' png-on-win32 defines/defaults: nuclear@26: * PNG_BUILD_DLL -- building dll nuclear@26: * PNG_USE_DLL -- building an application, linking to dll nuclear@26: * (no define) -- building static library, or building an nuclear@26: * application and linking to the static lib nuclear@26: * 'Cygwin' defines/defaults: nuclear@26: * PNG_BUILD_DLL -- (ignored) building the dll nuclear@26: * (no define) -- (ignored) building an application, linking to the dll nuclear@26: * PNG_STATIC -- (ignored) building the static lib, or building an nuclear@26: * application that links to the static lib. nuclear@26: * ALL_STATIC -- (ignored) building various static libs, or building an nuclear@26: * application that links to the static libs. nuclear@26: * Thus, nuclear@26: * a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and nuclear@26: * this bit of #ifdefs will define the 'correct' config variables based on nuclear@26: * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but nuclear@26: * unnecessary. nuclear@26: * nuclear@26: * Also, the precedence order is: nuclear@26: * ALL_STATIC (since we can't #undef something outside our namespace) nuclear@26: * PNG_BUILD_DLL nuclear@26: * PNG_STATIC nuclear@26: * (nothing) == PNG_USE_DLL nuclear@26: * nuclear@26: * CYGWIN (2002-01-20): The preceding is now obsolete. With the advent nuclear@26: * of auto-import in binutils, we no longer need to worry about nuclear@26: * __declspec(dllexport) / __declspec(dllimport) and friends. Therefore, nuclear@26: * we don't need to worry about PNG_STATIC or ALL_STATIC when it comes nuclear@26: * to __declspec() stuff. However, we DO need to worry about nuclear@26: * PNG_BUILD_DLL and PNG_STATIC because those change some defaults nuclear@26: * such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed. nuclear@26: */ nuclear@26: #if defined(__CYGWIN__) nuclear@26: # if defined(ALL_STATIC) nuclear@26: # if defined(PNG_BUILD_DLL) nuclear@26: # undef PNG_BUILD_DLL nuclear@26: # endif nuclear@26: # if defined(PNG_USE_DLL) nuclear@26: # undef PNG_USE_DLL nuclear@26: # endif nuclear@26: # if defined(PNG_DLL) nuclear@26: # undef PNG_DLL nuclear@26: # endif nuclear@26: # if !defined(PNG_STATIC) nuclear@26: # define PNG_STATIC nuclear@26: # endif nuclear@26: # else nuclear@26: # if defined (PNG_BUILD_DLL) nuclear@26: # if defined(PNG_STATIC) nuclear@26: # undef PNG_STATIC nuclear@26: # endif nuclear@26: # if defined(PNG_USE_DLL) nuclear@26: # undef PNG_USE_DLL nuclear@26: # endif nuclear@26: # if !defined(PNG_DLL) nuclear@26: # define PNG_DLL nuclear@26: # endif nuclear@26: # else nuclear@26: # if defined(PNG_STATIC) nuclear@26: # if defined(PNG_USE_DLL) nuclear@26: # undef PNG_USE_DLL nuclear@26: # endif nuclear@26: # if defined(PNG_DLL) nuclear@26: # undef PNG_DLL nuclear@26: # endif nuclear@26: # else nuclear@26: # if !defined(PNG_USE_DLL) nuclear@26: # define PNG_USE_DLL nuclear@26: # endif nuclear@26: # if !defined(PNG_DLL) nuclear@26: # define PNG_DLL nuclear@26: # endif nuclear@26: # endif nuclear@26: # endif nuclear@26: # endif nuclear@26: #endif nuclear@26: nuclear@26: /* This protects us against compilers that run on a windowing system nuclear@26: * and thus don't have or would rather us not use the stdio types: nuclear@26: * stdin, stdout, and stderr. The only one currently used is stderr nuclear@26: * in png_error() and png_warning(). #defining PNG_NO_CONSOLE_IO will nuclear@26: * prevent these from being compiled and used. #defining PNG_NO_STDIO nuclear@26: * will also prevent these, plus will prevent the entire set of stdio nuclear@26: * macros and functions (FILE *, printf, etc.) from being compiled and used, nuclear@26: * unless (PNG_DEBUG > 0) has been #defined. nuclear@26: * nuclear@26: * #define PNG_NO_CONSOLE_IO nuclear@26: * #define PNG_NO_STDIO nuclear@26: */ nuclear@26: nuclear@26: #if defined(_WIN32_WCE) nuclear@26: # include nuclear@26: /* Console I/O functions are not supported on WindowsCE */ nuclear@26: # define PNG_NO_CONSOLE_IO nuclear@26: # ifdef PNG_DEBUG nuclear@26: # undef PNG_DEBUG nuclear@26: # endif nuclear@26: #endif nuclear@26: nuclear@26: #ifdef PNG_BUILD_DLL nuclear@26: # ifndef PNG_CONSOLE_IO_SUPPORTED nuclear@26: # ifndef PNG_NO_CONSOLE_IO nuclear@26: # define PNG_NO_CONSOLE_IO nuclear@26: # endif nuclear@26: # endif nuclear@26: #endif nuclear@26: nuclear@26: # ifdef PNG_NO_STDIO nuclear@26: # ifndef PNG_NO_CONSOLE_IO nuclear@26: # define PNG_NO_CONSOLE_IO nuclear@26: # endif nuclear@26: # ifdef PNG_DEBUG nuclear@26: # if (PNG_DEBUG > 0) nuclear@26: # include nuclear@26: # endif nuclear@26: # endif nuclear@26: # else nuclear@26: # if !defined(_WIN32_WCE) nuclear@26: /* "stdio.h" functions are not supported on WindowsCE */ nuclear@26: # include nuclear@26: # endif nuclear@26: # endif nuclear@26: nuclear@26: /* This macro protects us against machines that don't have function nuclear@26: * prototypes (ie K&R style headers). If your compiler does not handle nuclear@26: * function prototypes, define this macro and use the included ansi2knr. nuclear@26: * I've always been able to use _NO_PROTO as the indicator, but you may nuclear@26: * need to drag the empty declaration out in front of here, or change the nuclear@26: * ifdef to suit your own needs. nuclear@26: */ nuclear@26: #ifndef PNGARG nuclear@26: nuclear@26: #ifdef OF /* zlib prototype munger */ nuclear@26: # define PNGARG(arglist) OF(arglist) nuclear@26: #else nuclear@26: nuclear@26: #ifdef _NO_PROTO nuclear@26: # define PNGARG(arglist) () nuclear@26: # ifndef PNG_TYPECAST_NULL nuclear@26: # define PNG_TYPECAST_NULL nuclear@26: # endif nuclear@26: #else nuclear@26: # define PNGARG(arglist) arglist nuclear@26: #endif /* _NO_PROTO */ nuclear@26: nuclear@26: nuclear@26: #endif /* OF */ nuclear@26: nuclear@26: #endif /* PNGARG */ nuclear@26: nuclear@26: /* Try to determine if we are compiling on a Mac. Note that testing for nuclear@26: * just __MWERKS__ is not good enough, because the Codewarrior is now used nuclear@26: * on non-Mac platforms. nuclear@26: */ nuclear@26: #ifndef MACOS nuclear@26: # if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ nuclear@26: defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) nuclear@26: # define MACOS nuclear@26: # endif nuclear@26: #endif nuclear@26: nuclear@26: /* enough people need this for various reasons to include it here */ nuclear@26: #if !defined(MACOS) && !defined(RISCOS) && !defined(_WIN32_WCE) nuclear@26: # include nuclear@26: #endif nuclear@26: nuclear@26: #if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED) nuclear@26: # define PNG_SETJMP_SUPPORTED nuclear@26: #endif nuclear@26: nuclear@26: #ifdef PNG_SETJMP_SUPPORTED nuclear@26: /* This is an attempt to force a single setjmp behaviour on Linux. If nuclear@26: * the X config stuff didn't define _BSD_SOURCE we wouldn't need this. nuclear@26: */ nuclear@26: nuclear@26: # ifdef __linux__ nuclear@26: # ifdef _BSD_SOURCE nuclear@26: # define PNG_SAVE_BSD_SOURCE nuclear@26: # undef _BSD_SOURCE nuclear@26: # endif nuclear@26: # ifdef _SETJMP_H nuclear@26: /* If you encounter a compiler error here, see the explanation nuclear@26: * near the end of INSTALL. nuclear@26: */ nuclear@26: __pngconf.h__ already includes setjmp.h; nuclear@26: __dont__ include it again.; nuclear@26: # endif nuclear@26: # endif /* __linux__ */ nuclear@26: nuclear@26: /* include setjmp.h for error handling */ nuclear@26: # include nuclear@26: nuclear@26: # ifdef __linux__ nuclear@26: # ifdef PNG_SAVE_BSD_SOURCE nuclear@26: # ifndef _BSD_SOURCE nuclear@26: # define _BSD_SOURCE nuclear@26: # endif nuclear@26: # undef PNG_SAVE_BSD_SOURCE nuclear@26: # endif nuclear@26: # endif /* __linux__ */ nuclear@26: #endif /* PNG_SETJMP_SUPPORTED */ nuclear@26: nuclear@26: #ifdef BSD nuclear@26: # include nuclear@26: #else nuclear@26: # include nuclear@26: #endif nuclear@26: nuclear@26: /* Other defines for things like memory and the like can go here. */ nuclear@26: #ifdef PNG_INTERNAL nuclear@26: nuclear@26: #include nuclear@26: nuclear@26: /* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which nuclear@26: * aren't usually used outside the library (as far as I know), so it is nuclear@26: * debatable if they should be exported at all. In the future, when it is nuclear@26: * possible to have run-time registry of chunk-handling functions, some of nuclear@26: * these will be made available again. nuclear@26: #define PNG_EXTERN extern nuclear@26: */ nuclear@26: #define PNG_EXTERN nuclear@26: nuclear@26: /* Other defines specific to compilers can go here. Try to keep nuclear@26: * them inside an appropriate ifdef/endif pair for portability. nuclear@26: */ nuclear@26: nuclear@26: #if defined(PNG_FLOATING_POINT_SUPPORTED) nuclear@26: # if defined(MACOS) nuclear@26: /* We need to check that hasn't already been included earlier nuclear@26: * as it seems it doesn't agree with , yet we should really use nuclear@26: * if possible. nuclear@26: */ nuclear@26: # if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__) nuclear@26: # include nuclear@26: # endif nuclear@26: # else nuclear@26: # include nuclear@26: # endif nuclear@26: # if defined(_AMIGA) && defined(__SASC) && defined(_M68881) nuclear@26: /* Amiga SAS/C: We must include builtin FPU functions when compiling using nuclear@26: * MATH=68881 nuclear@26: */ nuclear@26: # include nuclear@26: # endif nuclear@26: #endif nuclear@26: nuclear@26: /* Codewarrior on NT has linking problems without this. */ nuclear@26: #if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__) nuclear@26: # define PNG_ALWAYS_EXTERN nuclear@26: #endif nuclear@26: nuclear@26: /* This provides the non-ANSI (far) memory allocation routines. */ nuclear@26: #if defined(__TURBOC__) && defined(__MSDOS__) nuclear@26: # include nuclear@26: # include nuclear@26: #endif nuclear@26: nuclear@26: /* I have no idea why is this necessary... */ nuclear@26: #if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \ nuclear@26: defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__)) nuclear@26: # include nuclear@26: #endif nuclear@26: nuclear@26: /* This controls how fine the dithering gets. As this allocates nuclear@26: * a largish chunk of memory (32K), those who are not as concerned nuclear@26: * with dithering quality can decrease some or all of these. nuclear@26: */ nuclear@26: #ifndef PNG_DITHER_RED_BITS nuclear@26: # define PNG_DITHER_RED_BITS 5 nuclear@26: #endif nuclear@26: #ifndef PNG_DITHER_GREEN_BITS nuclear@26: # define PNG_DITHER_GREEN_BITS 5 nuclear@26: #endif nuclear@26: #ifndef PNG_DITHER_BLUE_BITS nuclear@26: # define PNG_DITHER_BLUE_BITS 5 nuclear@26: #endif nuclear@26: nuclear@26: /* This controls how fine the gamma correction becomes when you nuclear@26: * are only interested in 8 bits anyway. Increasing this value nuclear@26: * results in more memory being used, and more pow() functions nuclear@26: * being called to fill in the gamma tables. Don't set this value nuclear@26: * less then 8, and even that may not work (I haven't tested it). nuclear@26: */ nuclear@26: nuclear@26: #ifndef PNG_MAX_GAMMA_8 nuclear@26: # define PNG_MAX_GAMMA_8 11 nuclear@26: #endif nuclear@26: nuclear@26: /* This controls how much a difference in gamma we can tolerate before nuclear@26: * we actually start doing gamma conversion. nuclear@26: */ nuclear@26: #ifndef PNG_GAMMA_THRESHOLD nuclear@26: # define PNG_GAMMA_THRESHOLD 0.05 nuclear@26: #endif nuclear@26: nuclear@26: #endif /* PNG_INTERNAL */ nuclear@26: nuclear@26: /* The following uses const char * instead of char * for error nuclear@26: * and warning message functions, so some compilers won't complain. nuclear@26: * If you do not want to use const, define PNG_NO_CONST here. nuclear@26: */ nuclear@26: nuclear@26: #ifndef PNG_NO_CONST nuclear@26: # define PNG_CONST const nuclear@26: #else nuclear@26: # define PNG_CONST nuclear@26: #endif nuclear@26: nuclear@26: /* The following defines give you the ability to remove code from the nuclear@26: * library that you will not be using. I wish I could figure out how to nuclear@26: * automate this, but I can't do that without making it seriously hard nuclear@26: * on the users. So if you are not using an ability, change the #define nuclear@26: * to and #undef, and that part of the library will not be compiled. If nuclear@26: * your linker can't find a function, you may want to make sure the nuclear@26: * ability is defined here. Some of these depend upon some others being nuclear@26: * defined. I haven't figured out all the interactions here, so you may nuclear@26: * have to experiment awhile to get everything to compile. If you are nuclear@26: * creating or using a shared library, you probably shouldn't touch this, nuclear@26: * as it will affect the size of the structures, and this will cause bad nuclear@26: * things to happen if the library and/or application ever change. nuclear@26: */ nuclear@26: nuclear@26: /* Any features you will not be using can be undef'ed here */ nuclear@26: nuclear@26: /* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user nuclear@26: * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS nuclear@26: * on the compile line, then pick and choose which ones to define without nuclear@26: * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED nuclear@26: * if you only want to have a png-compliant reader/writer but don't need nuclear@26: * any of the extra transformations. This saves about 80 kbytes in a nuclear@26: * typical installation of the library. (PNG_NO_* form added in version nuclear@26: * 1.0.1c, for consistency) nuclear@26: */ nuclear@26: nuclear@26: /* The size of the png_text structure changed in libpng-1.0.6 when nuclear@26: * iTXt support was added. iTXt support was turned off by default through nuclear@26: * libpng-1.2.x, to support old apps that malloc the png_text structure nuclear@26: * instead of calling png_set_text() and letting libpng malloc it. It nuclear@26: * was turned on by default in libpng-1.3.0. nuclear@26: */ nuclear@26: nuclear@26: #if defined(PNG_1_0_X) || defined (PNG_1_2_X) nuclear@26: # ifndef PNG_NO_iTXt_SUPPORTED nuclear@26: # define PNG_NO_iTXt_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_READ_iTXt nuclear@26: # define PNG_NO_READ_iTXt nuclear@26: # endif nuclear@26: # ifndef PNG_NO_WRITE_iTXt nuclear@26: # define PNG_NO_WRITE_iTXt nuclear@26: # endif nuclear@26: #endif nuclear@26: nuclear@26: #if !defined(PNG_NO_iTXt_SUPPORTED) nuclear@26: # if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt) nuclear@26: # define PNG_READ_iTXt nuclear@26: # endif nuclear@26: # if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt) nuclear@26: # define PNG_WRITE_iTXt nuclear@26: # endif nuclear@26: #endif nuclear@26: nuclear@26: /* The following support, added after version 1.0.0, can be turned off here en nuclear@26: * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility nuclear@26: * with old applications that require the length of png_struct and png_info nuclear@26: * to remain unchanged. nuclear@26: */ nuclear@26: nuclear@26: #ifdef PNG_LEGACY_SUPPORTED nuclear@26: # define PNG_NO_FREE_ME nuclear@26: # define PNG_NO_READ_UNKNOWN_CHUNKS nuclear@26: # define PNG_NO_WRITE_UNKNOWN_CHUNKS nuclear@26: # define PNG_NO_READ_USER_CHUNKS nuclear@26: # define PNG_NO_READ_iCCP nuclear@26: # define PNG_NO_WRITE_iCCP nuclear@26: # define PNG_NO_READ_iTXt nuclear@26: # define PNG_NO_WRITE_iTXt nuclear@26: # define PNG_NO_READ_sCAL nuclear@26: # define PNG_NO_WRITE_sCAL nuclear@26: # define PNG_NO_READ_sPLT nuclear@26: # define PNG_NO_WRITE_sPLT nuclear@26: # define PNG_NO_INFO_IMAGE nuclear@26: # define PNG_NO_READ_RGB_TO_GRAY nuclear@26: # define PNG_NO_READ_USER_TRANSFORM nuclear@26: # define PNG_NO_WRITE_USER_TRANSFORM nuclear@26: # define PNG_NO_USER_MEM nuclear@26: # define PNG_NO_READ_EMPTY_PLTE nuclear@26: # define PNG_NO_MNG_FEATURES nuclear@26: # define PNG_NO_FIXED_POINT_SUPPORTED nuclear@26: #endif nuclear@26: nuclear@26: /* Ignore attempt to turn off both floating and fixed point support */ nuclear@26: #if !defined(PNG_FLOATING_POINT_SUPPORTED) || \ nuclear@26: !defined(PNG_NO_FIXED_POINT_SUPPORTED) nuclear@26: # define PNG_FIXED_POINT_SUPPORTED nuclear@26: #endif nuclear@26: nuclear@26: #ifndef PNG_NO_FREE_ME nuclear@26: # define PNG_FREE_ME_SUPPORTED nuclear@26: #endif nuclear@26: nuclear@26: #if defined(PNG_READ_SUPPORTED) nuclear@26: nuclear@26: #if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \ nuclear@26: !defined(PNG_NO_READ_TRANSFORMS) nuclear@26: # define PNG_READ_TRANSFORMS_SUPPORTED nuclear@26: #endif nuclear@26: nuclear@26: #ifdef PNG_READ_TRANSFORMS_SUPPORTED nuclear@26: # ifndef PNG_NO_READ_EXPAND nuclear@26: # define PNG_READ_EXPAND_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_READ_SHIFT nuclear@26: # define PNG_READ_SHIFT_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_READ_PACK nuclear@26: # define PNG_READ_PACK_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_READ_BGR nuclear@26: # define PNG_READ_BGR_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_READ_SWAP nuclear@26: # define PNG_READ_SWAP_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_READ_PACKSWAP nuclear@26: # define PNG_READ_PACKSWAP_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_READ_INVERT nuclear@26: # define PNG_READ_INVERT_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_READ_DITHER nuclear@26: # define PNG_READ_DITHER_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_READ_BACKGROUND nuclear@26: # define PNG_READ_BACKGROUND_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_READ_16_TO_8 nuclear@26: # define PNG_READ_16_TO_8_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_READ_FILLER nuclear@26: # define PNG_READ_FILLER_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_READ_GAMMA nuclear@26: # define PNG_READ_GAMMA_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_READ_GRAY_TO_RGB nuclear@26: # define PNG_READ_GRAY_TO_RGB_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_READ_SWAP_ALPHA nuclear@26: # define PNG_READ_SWAP_ALPHA_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_READ_INVERT_ALPHA nuclear@26: # define PNG_READ_INVERT_ALPHA_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_READ_STRIP_ALPHA nuclear@26: # define PNG_READ_STRIP_ALPHA_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_READ_USER_TRANSFORM nuclear@26: # define PNG_READ_USER_TRANSFORM_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_READ_RGB_TO_GRAY nuclear@26: # define PNG_READ_RGB_TO_GRAY_SUPPORTED nuclear@26: # endif nuclear@26: #endif /* PNG_READ_TRANSFORMS_SUPPORTED */ nuclear@26: nuclear@26: #if !defined(PNG_NO_PROGRESSIVE_READ) && \ nuclear@26: !defined(PNG_PROGRESSIVE_READ_SUPPORTED) /* if you don't do progressive */ nuclear@26: # define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */ nuclear@26: #endif /* about interlacing capability! You'll */ nuclear@26: /* still have interlacing unless you change the following line: */ nuclear@26: nuclear@26: #define PNG_READ_INTERLACING_SUPPORTED /* required in PNG-compliant decoders */ nuclear@26: nuclear@26: #ifndef PNG_NO_READ_COMPOSITE_NODIV nuclear@26: # ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */ nuclear@26: # define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */ nuclear@26: # endif nuclear@26: #endif nuclear@26: nuclear@26: #if defined(PNG_1_0_X) || defined (PNG_1_2_X) nuclear@26: /* Deprecated, will be removed from version 2.0.0. nuclear@26: Use PNG_MNG_FEATURES_SUPPORTED instead. */ nuclear@26: #ifndef PNG_NO_READ_EMPTY_PLTE nuclear@26: # define PNG_READ_EMPTY_PLTE_SUPPORTED nuclear@26: #endif nuclear@26: #endif nuclear@26: nuclear@26: #endif /* PNG_READ_SUPPORTED */ nuclear@26: nuclear@26: #if defined(PNG_WRITE_SUPPORTED) nuclear@26: nuclear@26: # if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \ nuclear@26: !defined(PNG_NO_WRITE_TRANSFORMS) nuclear@26: # define PNG_WRITE_TRANSFORMS_SUPPORTED nuclear@26: #endif nuclear@26: nuclear@26: #ifdef PNG_WRITE_TRANSFORMS_SUPPORTED nuclear@26: # ifndef PNG_NO_WRITE_SHIFT nuclear@26: # define PNG_WRITE_SHIFT_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_WRITE_PACK nuclear@26: # define PNG_WRITE_PACK_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_WRITE_BGR nuclear@26: # define PNG_WRITE_BGR_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_WRITE_SWAP nuclear@26: # define PNG_WRITE_SWAP_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_WRITE_PACKSWAP nuclear@26: # define PNG_WRITE_PACKSWAP_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_WRITE_INVERT nuclear@26: # define PNG_WRITE_INVERT_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_WRITE_FILLER nuclear@26: # define PNG_WRITE_FILLER_SUPPORTED /* same as WRITE_STRIP_ALPHA */ nuclear@26: # endif nuclear@26: # ifndef PNG_NO_WRITE_SWAP_ALPHA nuclear@26: # define PNG_WRITE_SWAP_ALPHA_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_WRITE_INVERT_ALPHA nuclear@26: # define PNG_WRITE_INVERT_ALPHA_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_WRITE_USER_TRANSFORM nuclear@26: # define PNG_WRITE_USER_TRANSFORM_SUPPORTED nuclear@26: # endif nuclear@26: #endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */ nuclear@26: nuclear@26: #if !defined(PNG_NO_WRITE_INTERLACING_SUPPORTED) && \ nuclear@26: !defined(PNG_WRITE_INTERLACING_SUPPORTED) nuclear@26: #define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant nuclear@26: encoders, but can cause trouble nuclear@26: if left undefined */ nuclear@26: #endif nuclear@26: nuclear@26: #if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \ nuclear@26: !defined(PNG_WRITE_WEIGHTED_FILTER) && \ nuclear@26: defined(PNG_FLOATING_POINT_SUPPORTED) nuclear@26: # define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED nuclear@26: #endif nuclear@26: nuclear@26: #ifndef PNG_NO_WRITE_FLUSH nuclear@26: # define PNG_WRITE_FLUSH_SUPPORTED nuclear@26: #endif nuclear@26: nuclear@26: #if defined(PNG_1_0_X) || defined (PNG_1_2_X) nuclear@26: /* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */ nuclear@26: #ifndef PNG_NO_WRITE_EMPTY_PLTE nuclear@26: # define PNG_WRITE_EMPTY_PLTE_SUPPORTED nuclear@26: #endif nuclear@26: #endif nuclear@26: nuclear@26: #endif /* PNG_WRITE_SUPPORTED */ nuclear@26: nuclear@26: #ifndef PNG_1_0_X nuclear@26: # ifndef PNG_NO_ERROR_NUMBERS nuclear@26: # define PNG_ERROR_NUMBERS_SUPPORTED nuclear@26: # endif nuclear@26: #endif /* PNG_1_0_X */ nuclear@26: nuclear@26: #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ nuclear@26: defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) nuclear@26: # ifndef PNG_NO_USER_TRANSFORM_PTR nuclear@26: # define PNG_USER_TRANSFORM_PTR_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: nuclear@26: #ifndef PNG_NO_STDIO nuclear@26: # define PNG_TIME_RFC1123_SUPPORTED nuclear@26: #endif nuclear@26: nuclear@26: /* This adds extra functions in pngget.c for accessing data from the nuclear@26: * info pointer (added in version 0.99) nuclear@26: * png_get_image_width() nuclear@26: * png_get_image_height() nuclear@26: * png_get_bit_depth() nuclear@26: * png_get_color_type() nuclear@26: * png_get_compression_type() nuclear@26: * png_get_filter_type() nuclear@26: * png_get_interlace_type() nuclear@26: * png_get_pixel_aspect_ratio() nuclear@26: * png_get_pixels_per_meter() nuclear@26: * png_get_x_offset_pixels() nuclear@26: * png_get_y_offset_pixels() nuclear@26: * png_get_x_offset_microns() nuclear@26: * png_get_y_offset_microns() nuclear@26: */ nuclear@26: #if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED) nuclear@26: # define PNG_EASY_ACCESS_SUPPORTED nuclear@26: #endif nuclear@26: nuclear@26: /* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0 nuclear@26: * and removed from version 1.2.20. The following will be removed nuclear@26: * from libpng-1.4.0 nuclear@26: */ nuclear@26: nuclear@26: #if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_OPTIMIZED_CODE) nuclear@26: # ifndef PNG_OPTIMIZED_CODE_SUPPORTED nuclear@26: # define PNG_OPTIMIZED_CODE_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: nuclear@26: #if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE) nuclear@26: # ifndef PNG_ASSEMBLER_CODE_SUPPORTED nuclear@26: # define PNG_ASSEMBLER_CODE_SUPPORTED nuclear@26: # endif nuclear@26: nuclear@26: # if defined(__GNUC__) && defined(__x86_64__) && (__GNUC__ < 4) nuclear@26: /* work around 64-bit gcc compiler bugs in gcc-3.x */ nuclear@26: # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) nuclear@26: # define PNG_NO_MMX_CODE nuclear@26: # endif nuclear@26: # endif nuclear@26: nuclear@26: # if defined(__APPLE__) nuclear@26: # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) nuclear@26: # define PNG_NO_MMX_CODE nuclear@26: # endif nuclear@26: # endif nuclear@26: nuclear@26: # if (defined(__MWERKS__) && ((__MWERKS__ < 0x0900) || macintosh)) nuclear@26: # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) nuclear@26: # define PNG_NO_MMX_CODE nuclear@26: # endif nuclear@26: # endif nuclear@26: nuclear@26: # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) nuclear@26: # define PNG_MMX_CODE_SUPPORTED nuclear@26: # endif nuclear@26: nuclear@26: #endif nuclear@26: /* end of obsolete code to be removed from libpng-1.4.0 */ nuclear@26: nuclear@26: #if !defined(PNG_1_0_X) nuclear@26: #if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED) nuclear@26: # define PNG_USER_MEM_SUPPORTED nuclear@26: #endif nuclear@26: #endif /* PNG_1_0_X */ nuclear@26: nuclear@26: /* Added at libpng-1.2.6 */ nuclear@26: #if !defined(PNG_1_0_X) nuclear@26: #ifndef PNG_SET_USER_LIMITS_SUPPORTED nuclear@26: #if !defined(PNG_NO_SET_USER_LIMITS) && !defined(PNG_SET_USER_LIMITS_SUPPORTED) nuclear@26: # define PNG_SET_USER_LIMITS_SUPPORTED nuclear@26: #endif nuclear@26: #endif nuclear@26: #endif /* PNG_1_0_X */ nuclear@26: nuclear@26: /* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGS no matter nuclear@26: * how large, set these limits to 0x7fffffffL nuclear@26: */ nuclear@26: #ifndef PNG_USER_WIDTH_MAX nuclear@26: # define PNG_USER_WIDTH_MAX 1000000L nuclear@26: #endif nuclear@26: #ifndef PNG_USER_HEIGHT_MAX nuclear@26: # define PNG_USER_HEIGHT_MAX 1000000L nuclear@26: #endif nuclear@26: nuclear@26: /* These are currently experimental features, define them if you want */ nuclear@26: nuclear@26: /* very little testing */ nuclear@26: /* nuclear@26: #ifdef PNG_READ_SUPPORTED nuclear@26: # ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED nuclear@26: # define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: */ nuclear@26: nuclear@26: /* This is only for PowerPC big-endian and 680x0 systems */ nuclear@26: /* some testing */ nuclear@26: /* nuclear@26: #ifndef PNG_READ_BIG_ENDIAN_SUPPORTED nuclear@26: # define PNG_READ_BIG_ENDIAN_SUPPORTED nuclear@26: #endif nuclear@26: */ nuclear@26: nuclear@26: /* Buggy compilers (e.g., gcc 2.7.2.2) need this */ nuclear@26: /* nuclear@26: #define PNG_NO_POINTER_INDEXING nuclear@26: */ nuclear@26: nuclear@26: /* These functions are turned off by default, as they will be phased out. */ nuclear@26: /* nuclear@26: #define PNG_USELESS_TESTS_SUPPORTED nuclear@26: #define PNG_CORRECT_PALETTE_SUPPORTED nuclear@26: */ nuclear@26: nuclear@26: /* Any chunks you are not interested in, you can undef here. The nuclear@26: * ones that allocate memory may be expecially important (hIST, nuclear@26: * tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info nuclear@26: * a bit smaller. nuclear@26: */ nuclear@26: nuclear@26: #if defined(PNG_READ_SUPPORTED) && \ nuclear@26: !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ nuclear@26: !defined(PNG_NO_READ_ANCILLARY_CHUNKS) nuclear@26: # define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED nuclear@26: #endif nuclear@26: nuclear@26: #if defined(PNG_WRITE_SUPPORTED) && \ nuclear@26: !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ nuclear@26: !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS) nuclear@26: # define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED nuclear@26: #endif nuclear@26: nuclear@26: #ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED nuclear@26: nuclear@26: #ifdef PNG_NO_READ_TEXT nuclear@26: # define PNG_NO_READ_iTXt nuclear@26: # define PNG_NO_READ_tEXt nuclear@26: # define PNG_NO_READ_zTXt nuclear@26: #endif nuclear@26: #ifndef PNG_NO_READ_bKGD nuclear@26: # define PNG_READ_bKGD_SUPPORTED nuclear@26: # define PNG_bKGD_SUPPORTED nuclear@26: #endif nuclear@26: #ifndef PNG_NO_READ_cHRM nuclear@26: # define PNG_READ_cHRM_SUPPORTED nuclear@26: # define PNG_cHRM_SUPPORTED nuclear@26: #endif nuclear@26: #ifndef PNG_NO_READ_gAMA nuclear@26: # define PNG_READ_gAMA_SUPPORTED nuclear@26: # define PNG_gAMA_SUPPORTED nuclear@26: #endif nuclear@26: #ifndef PNG_NO_READ_hIST nuclear@26: # define PNG_READ_hIST_SUPPORTED nuclear@26: # define PNG_hIST_SUPPORTED nuclear@26: #endif nuclear@26: #ifndef PNG_NO_READ_iCCP nuclear@26: # define PNG_READ_iCCP_SUPPORTED nuclear@26: # define PNG_iCCP_SUPPORTED nuclear@26: #endif nuclear@26: #ifndef PNG_NO_READ_iTXt nuclear@26: # ifndef PNG_READ_iTXt_SUPPORTED nuclear@26: # define PNG_READ_iTXt_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_iTXt_SUPPORTED nuclear@26: # define PNG_iTXt_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: #ifndef PNG_NO_READ_oFFs nuclear@26: # define PNG_READ_oFFs_SUPPORTED nuclear@26: # define PNG_oFFs_SUPPORTED nuclear@26: #endif nuclear@26: #ifndef PNG_NO_READ_pCAL nuclear@26: # define PNG_READ_pCAL_SUPPORTED nuclear@26: # define PNG_pCAL_SUPPORTED nuclear@26: #endif nuclear@26: #ifndef PNG_NO_READ_sCAL nuclear@26: # define PNG_READ_sCAL_SUPPORTED nuclear@26: # define PNG_sCAL_SUPPORTED nuclear@26: #endif nuclear@26: #ifndef PNG_NO_READ_pHYs nuclear@26: # define PNG_READ_pHYs_SUPPORTED nuclear@26: # define PNG_pHYs_SUPPORTED nuclear@26: #endif nuclear@26: #ifndef PNG_NO_READ_sBIT nuclear@26: # define PNG_READ_sBIT_SUPPORTED nuclear@26: # define PNG_sBIT_SUPPORTED nuclear@26: #endif nuclear@26: #ifndef PNG_NO_READ_sPLT nuclear@26: # define PNG_READ_sPLT_SUPPORTED nuclear@26: # define PNG_sPLT_SUPPORTED nuclear@26: #endif nuclear@26: #ifndef PNG_NO_READ_sRGB nuclear@26: # define PNG_READ_sRGB_SUPPORTED nuclear@26: # define PNG_sRGB_SUPPORTED nuclear@26: #endif nuclear@26: #ifndef PNG_NO_READ_tEXt nuclear@26: # define PNG_READ_tEXt_SUPPORTED nuclear@26: # define PNG_tEXt_SUPPORTED nuclear@26: #endif nuclear@26: #ifndef PNG_NO_READ_tIME nuclear@26: # define PNG_READ_tIME_SUPPORTED nuclear@26: # define PNG_tIME_SUPPORTED nuclear@26: #endif nuclear@26: #ifndef PNG_NO_READ_tRNS nuclear@26: # define PNG_READ_tRNS_SUPPORTED nuclear@26: # define PNG_tRNS_SUPPORTED nuclear@26: #endif nuclear@26: #ifndef PNG_NO_READ_zTXt nuclear@26: # define PNG_READ_zTXt_SUPPORTED nuclear@26: # define PNG_zTXt_SUPPORTED nuclear@26: #endif nuclear@26: #ifndef PNG_NO_READ_UNKNOWN_CHUNKS nuclear@26: # define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED nuclear@26: # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED nuclear@26: # define PNG_UNKNOWN_CHUNKS_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_HANDLE_AS_UNKNOWN nuclear@26: # define PNG_HANDLE_AS_UNKNOWN_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: #if !defined(PNG_NO_READ_USER_CHUNKS) && \ nuclear@26: defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) nuclear@26: # define PNG_READ_USER_CHUNKS_SUPPORTED nuclear@26: # define PNG_USER_CHUNKS_SUPPORTED nuclear@26: # ifdef PNG_NO_READ_UNKNOWN_CHUNKS nuclear@26: # undef PNG_NO_READ_UNKNOWN_CHUNKS nuclear@26: # endif nuclear@26: # ifdef PNG_NO_HANDLE_AS_UNKNOWN nuclear@26: # undef PNG_NO_HANDLE_AS_UNKNOWN nuclear@26: # endif nuclear@26: #endif nuclear@26: #ifndef PNG_NO_READ_OPT_PLTE nuclear@26: # define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */ nuclear@26: #endif /* optional PLTE chunk in RGB and RGBA images */ nuclear@26: #if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \ nuclear@26: defined(PNG_READ_zTXt_SUPPORTED) nuclear@26: # define PNG_READ_TEXT_SUPPORTED nuclear@26: # define PNG_TEXT_SUPPORTED nuclear@26: #endif nuclear@26: nuclear@26: #endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */ nuclear@26: nuclear@26: #ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED nuclear@26: nuclear@26: #ifdef PNG_NO_WRITE_TEXT nuclear@26: # define PNG_NO_WRITE_iTXt nuclear@26: # define PNG_NO_WRITE_tEXt nuclear@26: # define PNG_NO_WRITE_zTXt nuclear@26: #endif nuclear@26: #ifndef PNG_NO_WRITE_bKGD nuclear@26: # define PNG_WRITE_bKGD_SUPPORTED nuclear@26: # ifndef PNG_bKGD_SUPPORTED nuclear@26: # define PNG_bKGD_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: #ifndef PNG_NO_WRITE_cHRM nuclear@26: # define PNG_WRITE_cHRM_SUPPORTED nuclear@26: # ifndef PNG_cHRM_SUPPORTED nuclear@26: # define PNG_cHRM_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: #ifndef PNG_NO_WRITE_gAMA nuclear@26: # define PNG_WRITE_gAMA_SUPPORTED nuclear@26: # ifndef PNG_gAMA_SUPPORTED nuclear@26: # define PNG_gAMA_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: #ifndef PNG_NO_WRITE_hIST nuclear@26: # define PNG_WRITE_hIST_SUPPORTED nuclear@26: # ifndef PNG_hIST_SUPPORTED nuclear@26: # define PNG_hIST_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: #ifndef PNG_NO_WRITE_iCCP nuclear@26: # define PNG_WRITE_iCCP_SUPPORTED nuclear@26: # ifndef PNG_iCCP_SUPPORTED nuclear@26: # define PNG_iCCP_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: #ifndef PNG_NO_WRITE_iTXt nuclear@26: # ifndef PNG_WRITE_iTXt_SUPPORTED nuclear@26: # define PNG_WRITE_iTXt_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_iTXt_SUPPORTED nuclear@26: # define PNG_iTXt_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: #ifndef PNG_NO_WRITE_oFFs nuclear@26: # define PNG_WRITE_oFFs_SUPPORTED nuclear@26: # ifndef PNG_oFFs_SUPPORTED nuclear@26: # define PNG_oFFs_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: #ifndef PNG_NO_WRITE_pCAL nuclear@26: # define PNG_WRITE_pCAL_SUPPORTED nuclear@26: # ifndef PNG_pCAL_SUPPORTED nuclear@26: # define PNG_pCAL_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: #ifndef PNG_NO_WRITE_sCAL nuclear@26: # define PNG_WRITE_sCAL_SUPPORTED nuclear@26: # ifndef PNG_sCAL_SUPPORTED nuclear@26: # define PNG_sCAL_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: #ifndef PNG_NO_WRITE_pHYs nuclear@26: # define PNG_WRITE_pHYs_SUPPORTED nuclear@26: # ifndef PNG_pHYs_SUPPORTED nuclear@26: # define PNG_pHYs_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: #ifndef PNG_NO_WRITE_sBIT nuclear@26: # define PNG_WRITE_sBIT_SUPPORTED nuclear@26: # ifndef PNG_sBIT_SUPPORTED nuclear@26: # define PNG_sBIT_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: #ifndef PNG_NO_WRITE_sPLT nuclear@26: # define PNG_WRITE_sPLT_SUPPORTED nuclear@26: # ifndef PNG_sPLT_SUPPORTED nuclear@26: # define PNG_sPLT_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: #ifndef PNG_NO_WRITE_sRGB nuclear@26: # define PNG_WRITE_sRGB_SUPPORTED nuclear@26: # ifndef PNG_sRGB_SUPPORTED nuclear@26: # define PNG_sRGB_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: #ifndef PNG_NO_WRITE_tEXt nuclear@26: # define PNG_WRITE_tEXt_SUPPORTED nuclear@26: # ifndef PNG_tEXt_SUPPORTED nuclear@26: # define PNG_tEXt_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: #ifndef PNG_NO_WRITE_tIME nuclear@26: # define PNG_WRITE_tIME_SUPPORTED nuclear@26: # ifndef PNG_tIME_SUPPORTED nuclear@26: # define PNG_tIME_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: #ifndef PNG_NO_WRITE_tRNS nuclear@26: # define PNG_WRITE_tRNS_SUPPORTED nuclear@26: # ifndef PNG_tRNS_SUPPORTED nuclear@26: # define PNG_tRNS_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: #ifndef PNG_NO_WRITE_zTXt nuclear@26: # define PNG_WRITE_zTXt_SUPPORTED nuclear@26: # ifndef PNG_zTXt_SUPPORTED nuclear@26: # define PNG_zTXt_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: #ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS nuclear@26: # define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED nuclear@26: # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED nuclear@26: # define PNG_UNKNOWN_CHUNKS_SUPPORTED nuclear@26: # endif nuclear@26: # ifndef PNG_NO_HANDLE_AS_UNKNOWN nuclear@26: # ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED nuclear@26: # define PNG_HANDLE_AS_UNKNOWN_SUPPORTED nuclear@26: # endif nuclear@26: # endif nuclear@26: #endif nuclear@26: #if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \ nuclear@26: defined(PNG_WRITE_zTXt_SUPPORTED) nuclear@26: # define PNG_WRITE_TEXT_SUPPORTED nuclear@26: # ifndef PNG_TEXT_SUPPORTED nuclear@26: # define PNG_TEXT_SUPPORTED nuclear@26: # endif nuclear@26: #endif nuclear@26: nuclear@26: #endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */ nuclear@26: nuclear@26: /* Turn this off to disable png_read_png() and nuclear@26: * png_write_png() and leave the row_pointers member nuclear@26: * out of the info structure. nuclear@26: */ nuclear@26: #ifndef PNG_NO_INFO_IMAGE nuclear@26: # define PNG_INFO_IMAGE_SUPPORTED nuclear@26: #endif nuclear@26: nuclear@26: /* need the time information for reading tIME chunks */ nuclear@26: #if defined(PNG_tIME_SUPPORTED) nuclear@26: # if !defined(_WIN32_WCE) nuclear@26: /* "time.h" functions are not supported on WindowsCE */ nuclear@26: # include nuclear@26: # endif nuclear@26: #endif nuclear@26: nuclear@26: /* Some typedefs to get us started. These should be safe on most of the nuclear@26: * common platforms. The typedefs should be at least as large as the nuclear@26: * numbers suggest (a png_uint_32 must be at least 32 bits long), but they nuclear@26: * don't have to be exactly that size. Some compilers dislike passing nuclear@26: * unsigned shorts as function parameters, so you may be better off using nuclear@26: * unsigned int for png_uint_16. Likewise, for 64-bit systems, you may nuclear@26: * want to have unsigned int for png_uint_32 instead of unsigned long. nuclear@26: */ nuclear@26: nuclear@26: typedef unsigned long png_uint_32; nuclear@26: typedef long png_int_32; nuclear@26: typedef unsigned short png_uint_16; nuclear@26: typedef short png_int_16; nuclear@26: typedef unsigned char png_byte; nuclear@26: nuclear@26: /* This is usually size_t. It is typedef'ed just in case you need it to nuclear@26: change (I'm not sure if you will or not, so I thought I'd be safe) */ nuclear@26: #ifdef PNG_SIZE_T nuclear@26: typedef PNG_SIZE_T png_size_t; nuclear@26: # define png_sizeof(x) png_convert_size(sizeof(x)) nuclear@26: #else nuclear@26: typedef size_t png_size_t; nuclear@26: # define png_sizeof(x) sizeof(x) nuclear@26: #endif nuclear@26: nuclear@26: /* The following is needed for medium model support. It cannot be in the nuclear@26: * PNG_INTERNAL section. Needs modification for other compilers besides nuclear@26: * MSC. Model independent support declares all arrays and pointers to be nuclear@26: * large using the far keyword. The zlib version used must also support nuclear@26: * model independent data. As of version zlib 1.0.4, the necessary changes nuclear@26: * have been made in zlib. The USE_FAR_KEYWORD define triggers other nuclear@26: * changes that are needed. (Tim Wegner) nuclear@26: */ nuclear@26: nuclear@26: /* Separate compiler dependencies (problem here is that zlib.h always nuclear@26: defines FAR. (SJT) */ nuclear@26: #ifdef __BORLANDC__ nuclear@26: # if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__) nuclear@26: # define LDATA 1 nuclear@26: # else nuclear@26: # define LDATA 0 nuclear@26: # endif nuclear@26: /* GRR: why is Cygwin in here? Cygwin is not Borland C... */ nuclear@26: # if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__) nuclear@26: # define PNG_MAX_MALLOC_64K nuclear@26: # if (LDATA != 1) nuclear@26: # ifndef FAR nuclear@26: # define FAR __far nuclear@26: # endif nuclear@26: # define USE_FAR_KEYWORD nuclear@26: # endif /* LDATA != 1 */ nuclear@26: /* Possibly useful for moving data out of default segment. nuclear@26: * Uncomment it if you want. Could also define FARDATA as nuclear@26: * const if your compiler supports it. (SJT) nuclear@26: # define FARDATA FAR nuclear@26: */ nuclear@26: # endif /* __WIN32__, __FLAT__, __CYGWIN__ */ nuclear@26: #endif /* __BORLANDC__ */ nuclear@26: nuclear@26: nuclear@26: /* Suggest testing for specific compiler first before testing for nuclear@26: * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM, nuclear@26: * making reliance oncertain keywords suspect. (SJT) nuclear@26: */ nuclear@26: nuclear@26: /* MSC Medium model */ nuclear@26: #if defined(FAR) nuclear@26: # if defined(M_I86MM) nuclear@26: # define USE_FAR_KEYWORD nuclear@26: # define FARDATA FAR nuclear@26: # include nuclear@26: # endif nuclear@26: #endif nuclear@26: nuclear@26: /* SJT: default case */ nuclear@26: #ifndef FAR nuclear@26: # define FAR nuclear@26: #endif nuclear@26: nuclear@26: /* At this point FAR is always defined */ nuclear@26: #ifndef FARDATA nuclear@26: # define FARDATA nuclear@26: #endif nuclear@26: nuclear@26: /* Typedef for floating-point numbers that are converted nuclear@26: to fixed-point with a multiple of 100,000, e.g., int_gamma */ nuclear@26: typedef png_int_32 png_fixed_point; nuclear@26: nuclear@26: /* Add typedefs for pointers */ nuclear@26: typedef void FAR * png_voidp; nuclear@26: typedef png_byte FAR * png_bytep; nuclear@26: typedef png_uint_32 FAR * png_uint_32p; nuclear@26: typedef png_int_32 FAR * png_int_32p; nuclear@26: typedef png_uint_16 FAR * png_uint_16p; nuclear@26: typedef png_int_16 FAR * png_int_16p; nuclear@26: typedef PNG_CONST char FAR * png_const_charp; nuclear@26: typedef char FAR * png_charp; nuclear@26: typedef png_fixed_point FAR * png_fixed_point_p; nuclear@26: nuclear@26: #ifndef PNG_NO_STDIO nuclear@26: #if defined(_WIN32_WCE) nuclear@26: typedef HANDLE png_FILE_p; nuclear@26: #else nuclear@26: typedef FILE * png_FILE_p; nuclear@26: #endif nuclear@26: #endif nuclear@26: nuclear@26: #ifdef PNG_FLOATING_POINT_SUPPORTED nuclear@26: typedef double FAR * png_doublep; nuclear@26: #endif nuclear@26: nuclear@26: /* Pointers to pointers; i.e. arrays */ nuclear@26: typedef png_byte FAR * FAR * png_bytepp; nuclear@26: typedef png_uint_32 FAR * FAR * png_uint_32pp; nuclear@26: typedef png_int_32 FAR * FAR * png_int_32pp; nuclear@26: typedef png_uint_16 FAR * FAR * png_uint_16pp; nuclear@26: typedef png_int_16 FAR * FAR * png_int_16pp; nuclear@26: typedef PNG_CONST char FAR * FAR * png_const_charpp; nuclear@26: typedef char FAR * FAR * png_charpp; nuclear@26: typedef png_fixed_point FAR * FAR * png_fixed_point_pp; nuclear@26: #ifdef PNG_FLOATING_POINT_SUPPORTED nuclear@26: typedef double FAR * FAR * png_doublepp; nuclear@26: #endif nuclear@26: nuclear@26: /* Pointers to pointers to pointers; i.e., pointer to array */ nuclear@26: typedef char FAR * FAR * FAR * png_charppp; nuclear@26: nuclear@26: #if defined(PNG_1_0_X) || defined(PNG_1_2_X) nuclear@26: /* SPC - Is this stuff deprecated? */ nuclear@26: /* It'll be removed as of libpng-1.3.0 - GR-P */ nuclear@26: /* libpng typedefs for types in zlib. If zlib changes nuclear@26: * or another compression library is used, then change these. nuclear@26: * Eliminates need to change all the source files. nuclear@26: */ nuclear@26: typedef charf * png_zcharp; nuclear@26: typedef charf * FAR * png_zcharpp; nuclear@26: typedef z_stream FAR * png_zstreamp; nuclear@26: #endif /* (PNG_1_0_X) || defined(PNG_1_2_X) */ nuclear@26: nuclear@26: /* nuclear@26: * Define PNG_BUILD_DLL if the module being built is a Windows nuclear@26: * LIBPNG DLL. nuclear@26: * nuclear@26: * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL. nuclear@26: * It is equivalent to Microsoft predefined macro _DLL that is nuclear@26: * automatically defined when you compile using the share nuclear@26: * version of the CRT (C Run-Time library) nuclear@26: * nuclear@26: * The cygwin mods make this behavior a little different: nuclear@26: * Define PNG_BUILD_DLL if you are building a dll for use with cygwin nuclear@26: * Define PNG_STATIC if you are building a static library for use with cygwin, nuclear@26: * -or- if you are building an application that you want to link to the nuclear@26: * static library. nuclear@26: * PNG_USE_DLL is defined by default (no user action needed) unless one of nuclear@26: * the other flags is defined. nuclear@26: */ nuclear@26: nuclear@26: #if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL)) nuclear@26: # define PNG_DLL nuclear@26: #endif nuclear@26: /* If CYGWIN, then disallow GLOBAL ARRAYS unless building a static lib. nuclear@26: * When building a static lib, default to no GLOBAL ARRAYS, but allow nuclear@26: * command-line override nuclear@26: */ nuclear@26: #if defined(__CYGWIN__) nuclear@26: # if !defined(PNG_STATIC) nuclear@26: # if defined(PNG_USE_GLOBAL_ARRAYS) nuclear@26: # undef PNG_USE_GLOBAL_ARRAYS nuclear@26: # endif nuclear@26: # if !defined(PNG_USE_LOCAL_ARRAYS) nuclear@26: # define PNG_USE_LOCAL_ARRAYS nuclear@26: # endif nuclear@26: # else nuclear@26: # if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS) nuclear@26: # if defined(PNG_USE_GLOBAL_ARRAYS) nuclear@26: # undef PNG_USE_GLOBAL_ARRAYS nuclear@26: # endif nuclear@26: # endif nuclear@26: # endif nuclear@26: # if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) nuclear@26: # define PNG_USE_LOCAL_ARRAYS nuclear@26: # endif nuclear@26: #endif nuclear@26: nuclear@26: /* Do not use global arrays (helps with building DLL's) nuclear@26: * They are no longer used in libpng itself, since version 1.0.5c, nuclear@26: * but might be required for some pre-1.0.5c applications. nuclear@26: */ nuclear@26: #if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) nuclear@26: # if defined(PNG_NO_GLOBAL_ARRAYS) || \ nuclear@26: (defined(__GNUC__) && defined(PNG_DLL)) || defined(_MSC_VER) nuclear@26: # define PNG_USE_LOCAL_ARRAYS nuclear@26: # else nuclear@26: # define PNG_USE_GLOBAL_ARRAYS nuclear@26: # endif nuclear@26: #endif nuclear@26: nuclear@26: #if defined(__CYGWIN__) nuclear@26: # undef PNGAPI nuclear@26: # define PNGAPI __cdecl nuclear@26: # undef PNG_IMPEXP nuclear@26: # define PNG_IMPEXP nuclear@26: #endif nuclear@26: nuclear@26: /* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall", nuclear@26: * you may get warnings regarding the linkage of png_zalloc and png_zfree. nuclear@26: * Don't ignore those warnings; you must also reset the default calling nuclear@26: * convention in your compiler to match your PNGAPI, and you must build nuclear@26: * zlib and your applications the same way you build libpng. nuclear@26: */ nuclear@26: nuclear@26: #if defined(__MINGW32__) && !defined(PNG_MODULEDEF) nuclear@26: # ifndef PNG_NO_MODULEDEF nuclear@26: # define PNG_NO_MODULEDEF nuclear@26: # endif nuclear@26: #endif nuclear@26: nuclear@26: #if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF) nuclear@26: # define PNG_IMPEXP nuclear@26: #endif nuclear@26: nuclear@26: #if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \ nuclear@26: (( defined(_Windows) || defined(_WINDOWS) || \ nuclear@26: defined(WIN32) || defined(_WIN32) || defined(__WIN32__) )) nuclear@26: nuclear@26: # ifndef PNGAPI nuclear@26: # if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800)) nuclear@26: # define PNGAPI __cdecl nuclear@26: # else nuclear@26: # define PNGAPI _cdecl nuclear@26: # endif nuclear@26: # endif nuclear@26: nuclear@26: # if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \ nuclear@26: 0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */) nuclear@26: # define PNG_IMPEXP nuclear@26: # endif nuclear@26: nuclear@26: # if !defined(PNG_IMPEXP) nuclear@26: nuclear@26: # define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol nuclear@26: # define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol nuclear@26: nuclear@26: /* Borland/Microsoft */ nuclear@26: # if defined(_MSC_VER) || defined(__BORLANDC__) nuclear@26: # if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500) nuclear@26: # define PNG_EXPORT PNG_EXPORT_TYPE1 nuclear@26: # else nuclear@26: # define PNG_EXPORT PNG_EXPORT_TYPE2 nuclear@26: # if defined(PNG_BUILD_DLL) nuclear@26: # define PNG_IMPEXP __export nuclear@26: # else nuclear@26: # define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in nuclear@26: VC++ */ nuclear@26: # endif /* Exists in Borland C++ for nuclear@26: C++ classes (== huge) */ nuclear@26: # endif nuclear@26: # endif nuclear@26: nuclear@26: # if !defined(PNG_IMPEXP) nuclear@26: # if defined(PNG_BUILD_DLL) nuclear@26: # define PNG_IMPEXP __declspec(dllexport) nuclear@26: # else nuclear@26: # define PNG_IMPEXP __declspec(dllimport) nuclear@26: # endif nuclear@26: # endif nuclear@26: # endif /* PNG_IMPEXP */ nuclear@26: #else /* !(DLL || non-cygwin WINDOWS) */ nuclear@26: # if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) nuclear@26: # ifndef PNGAPI nuclear@26: # define PNGAPI _System nuclear@26: # endif nuclear@26: # else nuclear@26: # if 0 /* ... other platforms, with other meanings */ nuclear@26: # endif nuclear@26: # endif nuclear@26: #endif nuclear@26: nuclear@26: #ifndef PNGAPI nuclear@26: # define PNGAPI nuclear@26: #endif nuclear@26: #ifndef PNG_IMPEXP nuclear@26: # define PNG_IMPEXP nuclear@26: #endif nuclear@26: nuclear@26: #ifdef PNG_BUILDSYMS nuclear@26: # ifndef PNG_EXPORT nuclear@26: # define PNG_EXPORT(type,symbol) PNG_FUNCTION_EXPORT symbol END nuclear@26: # endif nuclear@26: # ifdef PNG_USE_GLOBAL_ARRAYS nuclear@26: # ifndef PNG_EXPORT_VAR nuclear@26: # define PNG_EXPORT_VAR(type) PNG_DATA_EXPORT nuclear@26: # endif nuclear@26: # endif nuclear@26: #endif nuclear@26: nuclear@26: #ifndef PNG_EXPORT nuclear@26: # define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol nuclear@26: #endif nuclear@26: nuclear@26: #ifdef PNG_USE_GLOBAL_ARRAYS nuclear@26: # ifndef PNG_EXPORT_VAR nuclear@26: # define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type nuclear@26: # endif nuclear@26: #endif nuclear@26: nuclear@26: /* User may want to use these so they are not in PNG_INTERNAL. Any library nuclear@26: * functions that are passed far data must be model independent. nuclear@26: */ nuclear@26: nuclear@26: #ifndef PNG_ABORT nuclear@26: # define PNG_ABORT() abort() nuclear@26: #endif nuclear@26: nuclear@26: #ifdef PNG_SETJMP_SUPPORTED nuclear@26: # define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) nuclear@26: #else nuclear@26: # define png_jmpbuf(png_ptr) \ nuclear@26: (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED) nuclear@26: #endif nuclear@26: nuclear@26: #if defined(USE_FAR_KEYWORD) /* memory model independent fns */ nuclear@26: /* use this to make far-to-near assignments */ nuclear@26: # define CHECK 1 nuclear@26: # define NOCHECK 0 nuclear@26: # define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK)) nuclear@26: # define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK)) nuclear@26: # define png_snprintf _fsnprintf /* Added to v 1.2.19 */ nuclear@26: # define png_strlen _fstrlen nuclear@26: # define png_memcmp _fmemcmp /* SJT: added */ nuclear@26: # define png_memcpy _fmemcpy nuclear@26: # define png_memset _fmemset nuclear@26: #else /* use the usual functions */ nuclear@26: # define CVT_PTR(ptr) (ptr) nuclear@26: # define CVT_PTR_NOCHECK(ptr) (ptr) nuclear@26: # ifndef PNG_NO_SNPRINTF nuclear@26: # ifdef _MSC_VER nuclear@26: # define png_snprintf _snprintf /* Added to v 1.2.19 */ nuclear@26: # define png_snprintf2 _snprintf nuclear@26: # define png_snprintf6 _snprintf nuclear@26: # else nuclear@26: # define png_snprintf snprintf /* Added to v 1.2.19 */ nuclear@26: # define png_snprintf2 snprintf nuclear@26: # define png_snprintf6 snprintf nuclear@26: # endif nuclear@26: # else nuclear@26: /* You don't have or don't want to use snprintf(). Caution: Using nuclear@26: * sprintf instead of snprintf exposes your application to accidental nuclear@26: * or malevolent buffer overflows. If you don't have snprintf() nuclear@26: * as a general rule you should provide one (you can get one from nuclear@26: * Portable OpenSSH). */ nuclear@26: # define png_snprintf(s1,n,fmt,x1) sprintf(s1,fmt,x1) nuclear@26: # define png_snprintf2(s1,n,fmt,x1,x2) sprintf(s1,fmt,x1,x2) nuclear@26: # define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \ nuclear@26: sprintf(s1,fmt,x1,x2,x3,x4,x5,x6) nuclear@26: # endif nuclear@26: # define png_strlen strlen nuclear@26: # define png_memcmp memcmp /* SJT: added */ nuclear@26: # define png_memcpy memcpy nuclear@26: # define png_memset memset nuclear@26: #endif nuclear@26: /* End of memory model independent support */ nuclear@26: nuclear@26: /* Just a little check that someone hasn't tried to define something nuclear@26: * contradictory. nuclear@26: */ nuclear@26: #if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K) nuclear@26: # undef PNG_ZBUF_SIZE nuclear@26: # define PNG_ZBUF_SIZE 65536L nuclear@26: #endif nuclear@26: nuclear@26: /* Added at libpng-1.2.8 */ nuclear@26: #endif /* PNG_VERSION_INFO_ONLY */ nuclear@26: nuclear@26: #endif /* PNGCONF_H */