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