diff options
Diffstat (limited to 'pngconf.h')
-rw-r--r-- | pngconf.h | 264 |
1 files changed, 210 insertions, 54 deletions
@@ -1,7 +1,7 @@ /* pngconf.h - machine configurable file for libpng * - * libpng version 1.0.50 - September 10, 2009 + * libpng version 1.0.51rc01 - November 18, 2009 * Copyright (c) 1998-2009 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -34,6 +34,14 @@ #endif #endif +#ifdef PNG_1_0_X +# ifndef PNG_iTXt_SUPPORTED +# ifndef PNG_NO_iTXt +# define PNG_NO_iTXt +# endif +# endif +#endif + /* * Added at libpng-1.2.8 * @@ -109,8 +117,33 @@ # define PNG_WRITE_SUPPORTED #endif +/* Enabled in 1.2.41. */ +#ifdef PNG_ALLOW_BENIGN_ERRORS +# define png_benign_error png_warning +# define png_chunk_benign_error png_chunk_warning +#else +# ifndef PNG_BENIGN_ERRORS_SUPPORTED +# define png_benign_error png_error +# define png_chunk_benign_error png_chunk_error +# endif +#endif + +/* Added in libpng-1.2.41 */ +#if !defined(PNG_NO_WARNINGS) && !defined(PNG_WARNINGS_SUPPORTED) +# define PNG_WARNINGS_SUPPORTED +#endif + +#if !defined(PNG_NO_ERROR_TEXT) && !defined(PNG_ERROR_TEXT_SUPPORTED) +# define PNG_ERROR_TEXT_SUPPORTED +#endif + +#if !defined(PNG_NO_CHECK_cHRM) && !defined(PNG_CHECK_cHRM_SUPPORTED) +# define PNG_CHECK_cHRM_SUPPORTED +#endif + /* Enabled by default in 1.2.0. You can disable this if you don't need to - support PNGs that are embedded in MNG datastreams */ + * support PNGs that are embedded in MNG datastreams + */ #if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES) # ifndef PNG_MNG_FEATURES_SUPPORTED # define PNG_MNG_FEATURES_SUPPORTED @@ -168,44 +201,44 @@ * PNG_BUILD_DLL and PNG_STATIC because those change some defaults * such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed. */ -#if defined(__CYGWIN__) -# if defined(ALL_STATIC) -# if defined(PNG_BUILD_DLL) +#ifdef __CYGWIN__ +# ifdef ALL_STATIC +# ifdef PNG_BUILD_DLL # undef PNG_BUILD_DLL # endif -# if defined(PNG_USE_DLL) +# ifdef PNG_USE_DLL # undef PNG_USE_DLL # endif -# if defined(PNG_DLL) +# ifdef PNG_DLL # undef PNG_DLL # endif -# if !defined(PNG_STATIC) +# ifndef PNG_STATIC # define PNG_STATIC # endif # else -# if defined (PNG_BUILD_DLL) -# if defined(PNG_STATIC) +# ifdef PNG_BUILD_DLL +# ifdef PNG_STATIC # undef PNG_STATIC # endif -# if defined(PNG_USE_DLL) +# ifdef PNG_USE_DLL # undef PNG_USE_DLL # endif -# if !defined(PNG_DLL) +# ifndef PNG_DLL # define PNG_DLL # endif # else -# if defined(PNG_STATIC) -# if defined(PNG_USE_DLL) +# ifdef PNG_STATIC +# ifdef PNG_USE_DLL # undef PNG_USE_DLL # endif -# if defined(PNG_DLL) +# ifdef PNG_DLL # undef PNG_DLL # endif # else -# if !defined(PNG_USE_DLL) +# ifndef PNG_USE_DLL # define PNG_USE_DLL # endif -# if !defined(PNG_DLL) +# ifndef PNG_DLL # define PNG_DLL # endif # endif @@ -226,7 +259,11 @@ * #define PNG_NO_STDIO */ -#if defined(_WIN32_WCE) +#if !defined(PNG_NO_STDIO) && !defined(PNG_STDIO_SUPPORTED) +# define PNG_STDIO_SUPPORTED +#endif + +#ifdef _WIN32_WCE # include <windows.h> /* Console I/O functions are not supported on WindowsCE */ # define PNG_NO_CONSOLE_IO @@ -255,12 +292,16 @@ # endif # endif # else -# if !defined(_WIN32_WCE) +# ifndef _WIN32_WCE /* "stdio.h" functions are not supported on WindowsCE */ # include <stdio.h> # endif # endif +#if !(defined PNG_NO_CONSOLE_IO) && !defined(PNG_CONSOLE_IO_SUPPORTED) +# define PNG_CONSOLE_IO_SUPPORTED +#endif + /* This macro protects us against machines that don't have function * prototypes (ie K&R style headers). If your compiler does not handle * function prototypes, define this macro and use the included ansi2knr. @@ -372,8 +413,8 @@ * them inside an appropriate ifdef/endif pair for portability. */ -#if defined(PNG_FLOATING_POINT_SUPPORTED) -# if defined(MACOS) +#ifdef PNG_FLOATING_POINT_SUPPORTED +# ifdef MACOS /* We need to check that <math.h> hasn't already been included earlier * as it seems it doesn't agree with <fp.h>, yet we should really use * <fp.h> if possible. @@ -583,18 +624,22 @@ # ifndef PNG_NO_READ_BACKGROUND # define PNG_READ_BACKGROUND_SUPPORTED # endif +#ifndef PNG_1_0_X # ifndef PNG_NO_READ_16_TO_8 # define PNG_READ_16_TO_8_SUPPORTED # endif +#endif # ifndef PNG_NO_READ_FILLER # define PNG_READ_FILLER_SUPPORTED # endif # ifndef PNG_NO_READ_GAMMA # define PNG_READ_GAMMA_SUPPORTED # endif +#ifndef PNG_1_0_X # ifndef PNG_NO_READ_GRAY_TO_RGB # define PNG_READ_GRAY_TO_RGB_SUPPORTED # endif +#endif # ifndef PNG_NO_READ_SWAP_ALPHA # define PNG_READ_SWAP_ALPHA_SUPPORTED # endif @@ -612,11 +657,20 @@ # endif #endif /* PNG_READ_TRANSFORMS_SUPPORTED */ +/* PNG_PROGRESSIVE_READ_NOT_SUPPORTED is deprecated. */ #if !defined(PNG_NO_PROGRESSIVE_READ) && \ - !defined(PNG_PROGRESSIVE_READ_SUPPORTED) /* if you don't do progressive */ -# define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */ -#endif /* about interlacing capability! You'll */ - /* still have interlacing unless you change the following line: */ + !defined(PNG_PROGRESSIVE_READ_NOT_SUPPORTED) /* if you don't do progressive */ +# define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */ +#endif /* about interlacing capability! You'll */ + /* still have interlacing unless you change the following define: */ +#define PNG_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */ + +/* PNG_NO_SEQUENTIAL_READ_SUPPORTED is deprecated. */ +#if !defined(PNG_NO_SEQUENTIAL_READ) && \ + !defined(PNG_SEQUENTIAL_READ_SUPPORTED) && \ + !defined(PNG_NO_SEQUENTIAL_READ_SUPPORTED) +# define PNG_SEQUENTIAL_READ_SUPPORTED +#endif #define PNG_READ_INTERLACING_SUPPORTED /* required in PNG-compliant decoders */ @@ -668,9 +722,11 @@ # ifndef PNG_NO_WRITE_SWAP_ALPHA # define PNG_WRITE_SWAP_ALPHA_SUPPORTED # endif +#ifndef PNG_1_0_X # ifndef PNG_NO_WRITE_INVERT_ALPHA # define PNG_WRITE_INVERT_ALPHA_SUPPORTED # endif +#endif # ifndef PNG_NO_WRITE_USER_TRANSFORM # define PNG_WRITE_USER_TRANSFORM_SUPPORTED # endif @@ -702,6 +758,7 @@ #endif /* PNG_WRITE_SUPPORTED */ +#define PNG_NO_ERROR_NUMBERS #ifndef PNG_1_0_X # ifndef PNG_NO_ERROR_NUMBERS # define PNG_ERROR_NUMBERS_SUPPORTED @@ -762,7 +819,7 @@ # endif # endif -# if defined(__APPLE__) +# ifdef __APPLE__ # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) # define PNG_NO_MMX_CODE # endif @@ -781,19 +838,20 @@ #endif /* end of obsolete code to be removed from libpng-1.4.0 */ -#if !defined(PNG_1_0_X) +/* Added at libpng-1.2.0 */ +#ifndef PNG_1_0_X #if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED) # define PNG_USER_MEM_SUPPORTED #endif #endif /* PNG_1_0_X */ /* Added at libpng-1.2.6 */ -#if !defined(PNG_1_0_X) -#ifndef PNG_SET_USER_LIMITS_SUPPORTED -#if !defined(PNG_NO_SET_USER_LIMITS) && !defined(PNG_SET_USER_LIMITS_SUPPORTED) -# define PNG_SET_USER_LIMITS_SUPPORTED -#endif -#endif +#ifndef PNG_1_0_X +# ifndef PNG_SET_USER_LIMITS_SUPPORTED +# ifndef PNG_NO_SET_USER_LIMITS +# define PNG_SET_USER_LIMITS_SUPPORTED +# endif +# endif #endif /* PNG_1_0_X */ /* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGS no matter @@ -806,6 +864,27 @@ # define PNG_USER_HEIGHT_MAX 1000000L #endif +#ifndef PNG_1_0_X +/* Added at libpng-1.2.41 */ +#ifndef PNG_USER_CHUNK_CACHE_MAX +# define PNG_USER_CHUNK_CACHE_MAX 0x7fffffffL +#endif +#endif + +#ifndef PNG_LITERAL_SHARP +# define PNG_LITERAL_SHARP 0x23 +#endif +#ifndef PNG_LITERAL_LEFT_SQUARE_BRACKET +# define PNG_LITERAL_LEFT_SQUARE_BRACKET 0x5b +#endif +#ifndef PNG_LITERAL_RIGHT_SQUARE_BRACKET +# define PNG_LITERAL_RIGHT_SQUARE_BRACKET 0x5d +#endif + +/* Added at libpng-1.2.34 */ +#ifndef PNG_STRING_NEWLINE +#define PNG_STRING_NEWLINE "\n" +#endif /* These are currently experimental features, define them if you want */ @@ -831,6 +910,11 @@ #define PNG_NO_POINTER_INDEXING */ +#if !defined(PNG_NO_POINTER_INDEXING) && \ + !defined(PNG_POINTER_INDEXING_SUPPORTED) +# define PNG_POINTER_INDEXING_SUPPORTED +#endif + /* These functions are turned off by default, as they will be phased out. */ /* #define PNG_USELESS_TESTS_SUPPORTED @@ -1089,8 +1173,23 @@ # endif #endif +#ifdef PNG_WRITE_tIME_SUPPORTED +# ifndef PNG_NO_CONVERT_tIME +# ifndef _WIN32_WCE +/* The "tm" structure is not supported on WindowsCE */ +# ifndef PNG_CONVERT_tIME_SUPPORTED +# define PNG_CONVERT_tIME_SUPPORTED +# endif +# endif +# endif +#endif + #endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */ +#if !defined(PNG_NO_WRITE_FILTER) && !defined(PNG_WRITE_FILTER_SUPPORTED) +# define PNG_WRITE_FILTER_SUPPORTED +#endif + #ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS # define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED @@ -1113,12 +1212,10 @@ # define PNG_INFO_IMAGE_SUPPORTED #endif -/* need the time information for reading tIME chunks */ -#if defined(PNG_tIME_SUPPORTED) -# if !defined(_WIN32_WCE) +/* Need the time information for converting tIME chunks */ +#ifdef PNG_CONVERT_tIME_SUPPORTED /* "time.h" functions are not supported on WindowsCE */ # include <time.h> -# endif #endif /* Some typedefs to get us started. These should be safe on most of the @@ -1187,8 +1284,8 @@ typedef unsigned char png_byte; */ /* MSC Medium model */ -#if defined(FAR) -# if defined(M_I86MM) +#ifdef FAR +# ifdef M_I86MM # define USE_FAR_KEYWORD # define FARDATA FAR # include <dos.h> @@ -1221,7 +1318,7 @@ typedef char FAR * png_charp; typedef png_fixed_point FAR * png_fixed_point_p; #ifndef PNG_NO_STDIO -#if defined(_WIN32_WCE) +#ifdef _WIN32_WCE typedef HANDLE png_FILE_p; #else typedef FILE * png_FILE_p; @@ -1285,17 +1382,17 @@ typedef z_stream FAR * png_zstreamp; * When building a static lib, default to no GLOBAL ARRAYS, but allow * command-line override */ -#if defined(__CYGWIN__) -# if !defined(PNG_STATIC) -# if defined(PNG_USE_GLOBAL_ARRAYS) +#ifdef __CYGWIN__ +# ifndef PNG_STATIC +# ifdef PNG_USE_GLOBAL_ARRAYS # undef PNG_USE_GLOBAL_ARRAYS # endif -# if !defined(PNG_USE_LOCAL_ARRAYS) +# ifndef PNG_USE_LOCAL_ARRAYS # define PNG_USE_LOCAL_ARRAYS # endif # else # if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS) -# if defined(PNG_USE_GLOBAL_ARRAYS) +# ifdef PNG_USE_GLOBAL_ARRAYS # undef PNG_USE_GLOBAL_ARRAYS # endif # endif @@ -1318,7 +1415,7 @@ typedef z_stream FAR * png_zstreamp; # endif #endif -#if defined(__CYGWIN__) +#ifdef __CYGWIN__ # undef PNGAPI # define PNGAPI __cdecl # undef PNG_IMPEXP @@ -1359,7 +1456,7 @@ typedef z_stream FAR * png_zstreamp; # define PNG_IMPEXP # endif -# if !defined(PNG_IMPEXP) +# ifndef PNG_IMPEXP # define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol # define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol @@ -1370,7 +1467,7 @@ typedef z_stream FAR * png_zstreamp; # define PNG_EXPORT PNG_EXPORT_TYPE1 # else # define PNG_EXPORT PNG_EXPORT_TYPE2 -# if defined(PNG_BUILD_DLL) +# ifdef PNG_BUILD_DLL # define PNG_IMPEXP __export # else # define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in @@ -1380,8 +1477,8 @@ typedef z_stream FAR * png_zstreamp; # endif # endif -# if !defined(PNG_IMPEXP) -# if defined(PNG_BUILD_DLL) +# ifndef PNG_IMPEXP +# ifdef PNG_BUILD_DLL # define PNG_IMPEXP __declspec(dllexport) # else # define PNG_IMPEXP __declspec(dllimport) @@ -1427,6 +1524,64 @@ typedef z_stream FAR * png_zstreamp; # endif #endif +/* Support for compiler specific function attributes. These are used + * so that where compiler support is available incorrect use of API + * functions in png.h will generate compiler warnings. Added at libpng + * version 1.2.41. + */ +#ifdef __GNUC__ +# ifndef PNG_USE_RESULT +# define PNG_USE_RESULT __attribute__((__warn_unused_result__)) +# endif +# ifndef PNG_NORETURN +# define PNG_NORETURN __attribute__((__noreturn__)) +# endif +# ifndef PNG_ALLOCATED +# define PNG_ALLOCATED __attribute__((__malloc__)) +# endif + +# ifndef PNG_CONFIGURE_LIBPNG + /* This specifically protects structure members that should only be + * accessed from within the library, therefore should be empty during + * a library build. + */ +# ifndef PNG_DEPRECATED +# define PNG_DEPRECATED __attribute__((__deprecated__)) +# endif +# ifndef PNG_DEPSTRUCT +# define PNG_DEPSTRUCT __attribute__((__deprecated__)) +# endif +# ifndef PNG_PRIVATE +#if 0 /* Doesn't work so we use deprecated instead*/ +# define PNG_PRIVATE \ + __attribute__((warning("This function is not exported by libpng."))) +#else +# define PNG_PRIVATE \ + __attribute__((__deprecated__)) +#endif +# endif +# endif +#endif + +#ifndef PNG_DEPRECATED +# define PNG_DEPRECATED /* Use of this function is deprecated */ +#endif +#ifndef PNG_USE_RESULT +# define PNG_USE_RESULT /* The result of this function must be checked */ +#endif +#ifndef PNG_NORETURN +# define PNG_NORETURN /* This function does not return */ +#endif +#ifndef PNG_ALLOCATED +# define PNG_ALLOCATED /* The result of the function is new memory */ +#endif +#ifndef PNG_DEPSTRUCT +# define PNG_DEPSTRUCT /* Access to this struct member is deprecated */ +#endif +#ifndef PNG_PRIVATE +# define PNG_PRIVATE /* This is a private libpng function */ +#endif + /* User may want to use these so they are not in PNG_INTERNAL. Any library * functions that are passed far data must be model independent. */ @@ -1442,8 +1597,8 @@ typedef z_stream FAR * png_zstreamp; (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED) #endif -#if defined(USE_FAR_KEYWORD) /* memory model independent fns */ -/* use this to make far-to-near assignments */ +#ifdef USE_FAR_KEYWORD /* memory model independent fns */ +/* Use this to make far-to-near assignments */ # define CHECK 1 # define NOCHECK 0 # define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK)) @@ -1453,7 +1608,7 @@ typedef z_stream FAR * png_zstreamp; # define png_memcmp _fmemcmp /* SJT: added */ # define png_memcpy _fmemcpy # define png_memset _fmemset -#else /* use the usual functions */ +#else /* Use the usual functions */ # define CVT_PTR(ptr) (ptr) # define CVT_PTR_NOCHECK(ptr) (ptr) # ifndef PNG_NO_SNPRINTF @@ -1471,7 +1626,8 @@ typedef z_stream FAR * png_zstreamp; * sprintf instead of snprintf exposes your application to accidental * or malevolent buffer overflows. If you don't have snprintf() * as a general rule you should provide one (you can get one from - * Portable OpenSSH). */ + * Portable OpenSSH). + */ # define png_snprintf(s1,n,fmt,x1) sprintf(s1,fmt,x1) # define png_snprintf2(s1,n,fmt,x1,x2) sprintf(s1,fmt,x1,x2) # define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \ |