michael@0: michael@0: /* pngconf.h - machine configurable file for libpng michael@0: * michael@0: * libpng version 1.6.10 - March 6, 2014 michael@0: * michael@0: * Copyright (c) 1998-2013 Glenn Randers-Pehrson michael@0: * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) michael@0: * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) michael@0: * michael@0: * This code is released under the libpng license. michael@0: * For conditions of distribution and use, see the disclaimer michael@0: * and license in png.h michael@0: * michael@0: */ michael@0: michael@0: /* Any machine specific code is near the front of this file, so if you michael@0: * are configuring libpng for a machine, you may want to read the section michael@0: * starting here down to where it starts to typedef png_color, png_text, michael@0: * and png_info. michael@0: */ michael@0: michael@0: #ifndef PNGCONF_H michael@0: #define PNGCONF_H michael@0: michael@0: /* To do: Do all of this in scripts/pnglibconf.dfa */ michael@0: #ifdef PNG_SAFE_LIMITS_SUPPORTED michael@0: # ifdef PNG_USER_WIDTH_MAX michael@0: # undef PNG_USER_WIDTH_MAX michael@0: # define PNG_USER_WIDTH_MAX 1000000L michael@0: # endif michael@0: # ifdef PNG_USER_HEIGHT_MAX michael@0: # undef PNG_USER_HEIGHT_MAX michael@0: # define PNG_USER_HEIGHT_MAX 1000000L michael@0: # endif michael@0: # ifdef PNG_USER_CHUNK_MALLOC_MAX michael@0: # undef PNG_USER_CHUNK_MALLOC_MAX michael@0: # define PNG_USER_CHUNK_MALLOC_MAX 4000000L michael@0: # endif michael@0: # ifdef PNG_USER_CHUNK_CACHE_MAX michael@0: # undef PNG_USER_CHUNK_CACHE_MAX michael@0: # define PNG_USER_CHUNK_CACHE_MAX 128 michael@0: # endif michael@0: #endif michael@0: michael@0: #ifndef PNG_BUILDING_SYMBOL_TABLE /* else includes may cause problems */ michael@0: michael@0: /* From libpng 1.6.0 libpng requires an ANSI X3.159-1989 ("ISOC90") compliant C michael@0: * compiler for correct compilation. The following header files are required by michael@0: * the standard. If your compiler doesn't provide these header files, or they michael@0: * do not match the standard, you will need to provide/improve them. michael@0: */ michael@0: #include michael@0: #include michael@0: michael@0: /* Library header files. These header files are all defined by ISOC90; libpng michael@0: * expects conformant implementations, however, an ISOC90 conformant system need michael@0: * not provide these header files if the functionality cannot be implemented. michael@0: * In this case it will be necessary to disable the relevant parts of libpng in michael@0: * the build of pnglibconf.h. michael@0: * michael@0: * Prior to 1.6.0 string.h was included here; the API changes in 1.6.0 to not michael@0: * include this unnecessary header file. michael@0: */ michael@0: michael@0: #ifdef PNG_STDIO_SUPPORTED michael@0: /* Required for the definition of FILE: */ michael@0: # include michael@0: #endif michael@0: michael@0: #ifdef PNG_SETJMP_SUPPORTED michael@0: /* Required for the definition of jmp_buf and the declaration of longjmp: */ michael@0: # include michael@0: #endif michael@0: michael@0: #ifdef PNG_CONVERT_tIME_SUPPORTED michael@0: /* Required for struct tm: */ michael@0: # include michael@0: #endif michael@0: michael@0: #endif /* PNG_BUILDING_SYMBOL_TABLE */ michael@0: michael@0: /* Prior to 1.6.0 it was possible to turn off 'const' in declarations using michael@0: * PNG_NO_CONST; this is no longer supported except for data declarations which michael@0: * apparently still cause problems in 2011 on some compilers. michael@0: */ michael@0: #define PNG_CONST const /* backward compatibility only */ michael@0: michael@0: /* This controls optimization of the reading of 16 and 32 bit values michael@0: * from PNG files. It can be set on a per-app-file basis - it michael@0: * just changes whether a macro is used when the function is called. michael@0: * The library builder sets the default; if read functions are not michael@0: * built into the library the macro implementation is forced on. michael@0: */ michael@0: #ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED michael@0: # define PNG_USE_READ_MACROS michael@0: #endif michael@0: #if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS) michael@0: # if PNG_DEFAULT_READ_MACROS michael@0: # define PNG_USE_READ_MACROS michael@0: # endif michael@0: #endif michael@0: michael@0: /* COMPILER SPECIFIC OPTIONS. michael@0: * michael@0: * These options are provided so that a variety of difficult compilers michael@0: * can be used. Some are fixed at build time (e.g. PNG_API_RULE michael@0: * below) but still have compiler specific implementations, others michael@0: * may be changed on a per-file basis when compiling against libpng. michael@0: */ michael@0: michael@0: /* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect michael@0: * against legacy (pre ISOC90) compilers that did not understand function michael@0: * prototypes. It is not required for modern C compilers. michael@0: */ michael@0: #ifndef PNGARG michael@0: # define PNGARG(arglist) arglist michael@0: #endif michael@0: michael@0: /* Function calling conventions. michael@0: * ============================= michael@0: * Normally it is not necessary to specify to the compiler how to call michael@0: * a function - it just does it - however on x86 systems derived from michael@0: * Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems michael@0: * and some others) there are multiple ways to call a function and the michael@0: * default can be changed on the compiler command line. For this reason michael@0: * libpng specifies the calling convention of every exported function and michael@0: * every function called via a user supplied function pointer. This is michael@0: * done in this file by defining the following macros: michael@0: * michael@0: * PNGAPI Calling convention for exported functions. michael@0: * PNGCBAPI Calling convention for user provided (callback) functions. michael@0: * PNGCAPI Calling convention used by the ANSI-C library (required michael@0: * for longjmp callbacks and sometimes used internally to michael@0: * specify the calling convention for zlib). michael@0: * michael@0: * These macros should never be overridden. If it is necessary to michael@0: * change calling convention in a private build this can be done michael@0: * by setting PNG_API_RULE (which defaults to 0) to one of the values michael@0: * below to select the correct 'API' variants. michael@0: * michael@0: * PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout. michael@0: * This is correct in every known environment. michael@0: * PNG_API_RULE=1 Use the operating system convention for PNGAPI and michael@0: * the 'C' calling convention (from PNGCAPI) for michael@0: * callbacks (PNGCBAPI). This is no longer required michael@0: * in any known environment - if it has to be used michael@0: * please post an explanation of the problem to the michael@0: * libpng mailing list. michael@0: * michael@0: * These cases only differ if the operating system does not use the C michael@0: * calling convention, at present this just means the above cases michael@0: * (x86 DOS/Windows sytems) and, even then, this does not apply to michael@0: * Cygwin running on those systems. michael@0: * michael@0: * Note that the value must be defined in pnglibconf.h so that what michael@0: * the application uses to call the library matches the conventions michael@0: * set when building the library. michael@0: */ michael@0: michael@0: /* Symbol export michael@0: * ============= michael@0: * When building a shared library it is almost always necessary to tell michael@0: * the compiler which symbols to export. The png.h macro 'PNG_EXPORT' michael@0: * is used to mark the symbols. On some systems these symbols can be michael@0: * extracted at link time and need no special processing by the compiler, michael@0: * on other systems the symbols are flagged by the compiler and just michael@0: * the declaration requires a special tag applied (unfortunately) in a michael@0: * compiler dependent way. Some systems can do either. michael@0: * michael@0: * A small number of older systems also require a symbol from a DLL to michael@0: * be flagged to the program that calls it. This is a problem because michael@0: * we do not know in the header file included by application code that michael@0: * the symbol will come from a shared library, as opposed to a statically michael@0: * linked one. For this reason the application must tell us by setting michael@0: * the magic flag PNG_USE_DLL to turn on the special processing before michael@0: * it includes png.h. michael@0: * michael@0: * Four additional macros are used to make this happen: michael@0: * michael@0: * PNG_IMPEXP The magic (if any) to cause a symbol to be exported from michael@0: * the build or imported if PNG_USE_DLL is set - compiler michael@0: * and system specific. michael@0: * michael@0: * PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to michael@0: * 'type', compiler specific. michael@0: * michael@0: * PNG_DLL_EXPORT Set to the magic to use during a libpng build to michael@0: * make a symbol exported from the DLL. Not used in the michael@0: * public header files; see pngpriv.h for how it is used michael@0: * in the libpng build. michael@0: * michael@0: * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come michael@0: * from a DLL - used to define PNG_IMPEXP when michael@0: * PNG_USE_DLL is set. michael@0: */ michael@0: michael@0: /* System specific discovery. michael@0: * ========================== michael@0: * This code is used at build time to find PNG_IMPEXP, the API settings michael@0: * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL michael@0: * import processing is possible. On Windows systems it also sets michael@0: * compiler-specific macros to the values required to change the calling michael@0: * conventions of the various functions. michael@0: */ michael@0: #if defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\ michael@0: defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) michael@0: /* Windows system (DOS doesn't support DLLs). Includes builds under Cygwin or michael@0: * MinGW on any architecture currently supported by Windows. Also includes michael@0: * Watcom builds but these need special treatment because they are not michael@0: * compatible with GCC or Visual C because of different calling conventions. michael@0: */ michael@0: # if PNG_API_RULE == 2 michael@0: /* If this line results in an error, either because __watcall is not michael@0: * understood or because of a redefine just below you cannot use *this* michael@0: * build of the library with the compiler you are using. *This* build was michael@0: * build using Watcom and applications must also be built using Watcom! michael@0: */ michael@0: # define PNGCAPI __watcall michael@0: # endif michael@0: michael@0: # if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800)) michael@0: # define PNGCAPI __cdecl michael@0: # if PNG_API_RULE == 1 michael@0: /* If this line results in an error __stdcall is not understood and michael@0: * PNG_API_RULE should not have been set to '1'. michael@0: */ michael@0: # define PNGAPI __stdcall michael@0: # endif michael@0: # else michael@0: /* An older compiler, or one not detected (erroneously) above, michael@0: * if necessary override on the command line to get the correct michael@0: * variants for the compiler. michael@0: */ michael@0: # ifndef PNGCAPI michael@0: # define PNGCAPI _cdecl michael@0: # endif michael@0: # if PNG_API_RULE == 1 && !defined(PNGAPI) michael@0: # define PNGAPI _stdcall michael@0: # endif michael@0: # endif /* compiler/api */ michael@0: michael@0: /* NOTE: PNGCBAPI always defaults to PNGCAPI. */ michael@0: michael@0: # if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD) michael@0: # error "PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed" michael@0: # endif michael@0: michael@0: # if (defined(_MSC_VER) && _MSC_VER < 800) ||\ michael@0: (defined(__BORLANDC__) && __BORLANDC__ < 0x500) michael@0: /* older Borland and MSC michael@0: * compilers used '__export' and required this to be after michael@0: * the type. michael@0: */ michael@0: # ifndef PNG_EXPORT_TYPE michael@0: # define PNG_EXPORT_TYPE(type) type PNG_IMPEXP michael@0: # endif michael@0: # define PNG_DLL_EXPORT __export michael@0: # else /* newer compiler */ michael@0: # define PNG_DLL_EXPORT __declspec(dllexport) michael@0: # ifndef PNG_DLL_IMPORT michael@0: # define PNG_DLL_IMPORT __declspec(dllimport) michael@0: # endif michael@0: # endif /* compiler */ michael@0: michael@0: #else /* !Windows */ michael@0: # if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) michael@0: # define PNGAPI _System michael@0: # else /* !Windows/x86 && !OS/2 */ michael@0: /* Use the defaults, or define PNG*API on the command line (but michael@0: * this will have to be done for every compile!) michael@0: */ michael@0: # endif /* other system, !OS/2 */ michael@0: #endif /* !Windows/x86 */ michael@0: michael@0: /* Now do all the defaulting . */ michael@0: #ifndef PNGCAPI michael@0: # define PNGCAPI michael@0: #endif michael@0: #ifndef PNGCBAPI michael@0: # define PNGCBAPI PNGCAPI michael@0: #endif michael@0: #ifndef PNGAPI michael@0: # define PNGAPI PNGCAPI michael@0: #endif michael@0: michael@0: /* PNG_IMPEXP may be set on the compilation system command line or (if not set) michael@0: * then in an internal header file when building the library, otherwise (when michael@0: * using the library) it is set here. michael@0: */ michael@0: #ifndef PNG_IMPEXP michael@0: # if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT) michael@0: /* This forces use of a DLL, disallowing static linking */ michael@0: # define PNG_IMPEXP PNG_DLL_IMPORT michael@0: # endif michael@0: michael@0: # ifndef PNG_IMPEXP michael@0: # define PNG_IMPEXP michael@0: # endif michael@0: #endif michael@0: michael@0: /* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat michael@0: * 'attributes' as a storage class - the attributes go at the start of the michael@0: * function definition, and attributes are always appended regardless of the michael@0: * compiler. This considerably simplifies these macros but may cause problems michael@0: * if any compilers both need function attributes and fail to handle them as michael@0: * a storage class (this is unlikely.) michael@0: */ michael@0: #ifndef PNG_FUNCTION michael@0: # define PNG_FUNCTION(type, name, args, attributes) attributes type name args michael@0: #endif michael@0: michael@0: #ifndef PNG_EXPORT_TYPE michael@0: # define PNG_EXPORT_TYPE(type) PNG_IMPEXP type michael@0: #endif michael@0: michael@0: /* The ordinal value is only relevant when preprocessing png.h for symbol michael@0: * table entries, so we discard it here. See the .dfn files in the michael@0: * scripts directory. michael@0: */ michael@0: #ifndef PNG_EXPORTA michael@0: michael@0: # define PNG_EXPORTA(ordinal, type, name, args, attributes)\ michael@0: PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args), \ michael@0: extern attributes) michael@0: #endif michael@0: michael@0: /* ANSI-C (C90) does not permit a macro to be invoked with an empty argument, michael@0: * so make something non-empty to satisfy the requirement: michael@0: */ michael@0: #define PNG_EMPTY /*empty list*/ michael@0: michael@0: #define PNG_EXPORT(ordinal, type, name, args)\ michael@0: PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY) michael@0: michael@0: /* Use PNG_REMOVED to comment out a removed interface. */ michael@0: #ifndef PNG_REMOVED michael@0: # define PNG_REMOVED(ordinal, type, name, args, attributes) michael@0: #endif michael@0: michael@0: #ifndef PNG_CALLBACK michael@0: # define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args) michael@0: #endif michael@0: michael@0: /* Support for compiler specific function attributes. These are used michael@0: * so that where compiler support is available incorrect use of API michael@0: * functions in png.h will generate compiler warnings. michael@0: * michael@0: * Added at libpng-1.2.41. michael@0: */ michael@0: michael@0: #ifndef PNG_NO_PEDANTIC_WARNINGS michael@0: # ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED michael@0: # define PNG_PEDANTIC_WARNINGS_SUPPORTED michael@0: # endif michael@0: #endif michael@0: michael@0: #ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED michael@0: /* Support for compiler specific function attributes. These are used michael@0: * so that where compiler support is available, incorrect use of API michael@0: * functions in png.h will generate compiler warnings. Added at libpng michael@0: * version 1.2.41. Disabling these removes the warnings but may also produce michael@0: * less efficient code. michael@0: */ michael@0: # if defined(__clang__) michael@0: /* Clang defines both __clang__ and __GNUC__. Check __clang__ first. */ michael@0: # if !defined(PNG_USE_RESULT) && __has_attribute(__warn_unused_result__) michael@0: # define PNG_USE_RESULT __attribute__((__warn_unused_result__)) michael@0: # endif michael@0: # if !defined(PNG_NORETURN) && __has_attribute(__noreturn__) michael@0: # define PNG_NORETURN __attribute__((__noreturn__)) michael@0: # endif michael@0: # if !defined(PNG_ALLOCATED) && __has_attribute(__malloc__) michael@0: # define PNG_ALLOCATED __attribute__((__malloc__)) michael@0: # endif michael@0: # if !defined(PNG_DEPRECATED) && __has_attribute(__deprecated__) michael@0: # define PNG_DEPRECATED __attribute__((__deprecated__)) michael@0: # endif michael@0: # if !defined(PNG_PRIVATE) michael@0: # ifdef __has_extension michael@0: # if __has_extension(attribute_unavailable_with_message) michael@0: # define PNG_PRIVATE __attribute__((__unavailable__(\ michael@0: "This function is not exported by libpng."))) michael@0: # endif michael@0: # endif michael@0: # endif michael@0: # ifndef PNG_RESTRICT michael@0: # define PNG_RESTRICT __restrict michael@0: # endif michael@0: michael@0: # elif defined(__GNUC__) michael@0: # ifndef PNG_USE_RESULT michael@0: # define PNG_USE_RESULT __attribute__((__warn_unused_result__)) michael@0: # endif michael@0: # ifndef PNG_NORETURN michael@0: # define PNG_NORETURN __attribute__((__noreturn__)) michael@0: # endif michael@0: # if __GNUC__ >= 3 michael@0: # ifndef PNG_ALLOCATED michael@0: # define PNG_ALLOCATED __attribute__((__malloc__)) michael@0: # endif michael@0: # ifndef PNG_DEPRECATED michael@0: # define PNG_DEPRECATED __attribute__((__deprecated__)) michael@0: # endif michael@0: # ifndef PNG_PRIVATE michael@0: # if 0 /* Doesn't work so we use deprecated instead*/ michael@0: # define PNG_PRIVATE \ michael@0: __attribute__((warning("This function is not exported by libpng."))) michael@0: # else michael@0: # define PNG_PRIVATE \ michael@0: __attribute__((__deprecated__)) michael@0: # endif michael@0: # endif michael@0: # if ((__GNUC__ > 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1)) michael@0: # ifndef PNG_RESTRICT michael@0: # define PNG_RESTRICT __restrict michael@0: # endif michael@0: # endif /* __GNUC__.__GNUC_MINOR__ > 3.0 */ michael@0: # endif /* __GNUC__ >= 3 */ michael@0: michael@0: # elif defined(_MSC_VER) && (_MSC_VER >= 1300) michael@0: # ifndef PNG_USE_RESULT michael@0: # define PNG_USE_RESULT /* not supported */ michael@0: # endif michael@0: # ifndef PNG_NORETURN michael@0: # define PNG_NORETURN __declspec(noreturn) michael@0: # endif michael@0: # ifndef PNG_ALLOCATED michael@0: # if (_MSC_VER >= 1400) michael@0: # define PNG_ALLOCATED __declspec(restrict) michael@0: # endif michael@0: # endif michael@0: # ifndef PNG_DEPRECATED michael@0: # define PNG_DEPRECATED __declspec(deprecated) michael@0: # endif michael@0: # ifndef PNG_PRIVATE michael@0: # define PNG_PRIVATE __declspec(deprecated) michael@0: # endif michael@0: # ifndef PNG_RESTRICT michael@0: # if (_MSC_VER >= 1400) michael@0: # define PNG_RESTRICT __restrict michael@0: # endif michael@0: # endif michael@0: michael@0: # elif defined(__WATCOMC__) michael@0: # ifndef PNG_RESTRICT michael@0: # define PNG_RESTRICT __restrict michael@0: # endif michael@0: # endif michael@0: #endif /* PNG_PEDANTIC_WARNINGS */ michael@0: michael@0: #ifndef PNG_DEPRECATED michael@0: # define PNG_DEPRECATED /* Use of this function is deprecated */ michael@0: #endif michael@0: #ifndef PNG_USE_RESULT michael@0: # define PNG_USE_RESULT /* The result of this function must be checked */ michael@0: #endif michael@0: #ifndef PNG_NORETURN michael@0: # define PNG_NORETURN /* This function does not return */ michael@0: #endif michael@0: #ifndef PNG_ALLOCATED michael@0: # define PNG_ALLOCATED /* The result of the function is new memory */ michael@0: #endif michael@0: #ifndef PNG_PRIVATE michael@0: # define PNG_PRIVATE /* This is a private libpng function */ michael@0: #endif michael@0: #ifndef PNG_RESTRICT michael@0: # define PNG_RESTRICT /* The C99 "restrict" feature */ michael@0: #endif michael@0: michael@0: #ifndef PNG_FP_EXPORT /* A floating point API. */ michael@0: # ifdef PNG_FLOATING_POINT_SUPPORTED michael@0: # define PNG_FP_EXPORT(ordinal, type, name, args)\ michael@0: PNG_EXPORT(ordinal, type, name, args); michael@0: # else /* No floating point APIs */ michael@0: # define PNG_FP_EXPORT(ordinal, type, name, args) michael@0: # endif michael@0: #endif michael@0: #ifndef PNG_FIXED_EXPORT /* A fixed point API. */ michael@0: # ifdef PNG_FIXED_POINT_SUPPORTED michael@0: # define PNG_FIXED_EXPORT(ordinal, type, name, args)\ michael@0: PNG_EXPORT(ordinal, type, name, args); michael@0: # else /* No fixed point APIs */ michael@0: # define PNG_FIXED_EXPORT(ordinal, type, name, args) michael@0: # endif michael@0: #endif michael@0: michael@0: #ifndef PNG_BUILDING_SYMBOL_TABLE michael@0: /* Some typedefs to get us started. These should be safe on most of the common michael@0: * platforms. michael@0: * michael@0: * png_uint_32 and png_int_32 may, currently, be larger than required to hold a michael@0: * 32-bit value however this is not normally advisable. michael@0: * michael@0: * png_uint_16 and png_int_16 should always be two bytes in size - this is michael@0: * verified at library build time. michael@0: * michael@0: * png_byte must always be one byte in size. michael@0: * michael@0: * The checks below use constants from limits.h, as defined by the ISOC90 michael@0: * standard. michael@0: */ michael@0: #if CHAR_BIT == 8 && UCHAR_MAX == 255 michael@0: typedef unsigned char png_byte; michael@0: #else michael@0: # error "libpng requires 8 bit bytes" michael@0: #endif michael@0: michael@0: #if INT_MIN == -32768 && INT_MAX == 32767 michael@0: typedef int png_int_16; michael@0: #elif SHRT_MIN == -32768 && SHRT_MAX == 32767 michael@0: typedef short png_int_16; michael@0: #else michael@0: # error "libpng requires a signed 16 bit type" michael@0: #endif michael@0: michael@0: #if UINT_MAX == 65535 michael@0: typedef unsigned int png_uint_16; michael@0: #elif USHRT_MAX == 65535 michael@0: typedef unsigned short png_uint_16; michael@0: #else michael@0: # error "libpng requires an unsigned 16 bit type" michael@0: #endif michael@0: michael@0: #if INT_MIN < -2147483646 && INT_MAX > 2147483646 michael@0: typedef int png_int_32; michael@0: #elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646 michael@0: typedef long int png_int_32; michael@0: #else michael@0: # error "libpng requires a signed 32 bit (or more) type" michael@0: #endif michael@0: michael@0: #if UINT_MAX > 4294967294 michael@0: typedef unsigned int png_uint_32; michael@0: #elif ULONG_MAX > 4294967294 michael@0: typedef unsigned long int png_uint_32; michael@0: #else michael@0: # error "libpng requires an unsigned 32 bit (or more) type" michael@0: #endif michael@0: michael@0: /* Prior to 1.6.0 it was possible to disable the use of size_t, 1.6.0, however, michael@0: * requires an ISOC90 compiler and relies on consistent behavior of sizeof. michael@0: */ michael@0: typedef size_t png_size_t; michael@0: typedef ptrdiff_t png_ptrdiff_t; michael@0: michael@0: /* libpng needs to know the maximum value of 'size_t' and this controls the michael@0: * definition of png_alloc_size_t, below. This maximum value of size_t limits michael@0: * but does not control the maximum allocations the library makes - there is michael@0: * direct application control of this through png_set_user_limits(). michael@0: */ michael@0: #ifndef PNG_SMALL_SIZE_T michael@0: /* Compiler specific tests for systems where size_t is known to be less than michael@0: * 32 bits (some of these systems may no longer work because of the lack of michael@0: * 'far' support; see above.) michael@0: */ michael@0: # if (defined(__TURBOC__) && !defined(__FLAT__)) ||\ michael@0: (defined(_MSC_VER) && defined(MAXSEG_64K)) michael@0: # define PNG_SMALL_SIZE_T michael@0: # endif michael@0: #endif michael@0: michael@0: /* png_alloc_size_t is guaranteed to be no smaller than png_size_t, and no michael@0: * smaller than png_uint_32. Casts from png_size_t or png_uint_32 to michael@0: * png_alloc_size_t are not necessary; in fact, it is recommended not to use michael@0: * them at all so that the compiler can complain when something turns out to be michael@0: * problematic. michael@0: * michael@0: * Casts in the other direction (from png_alloc_size_t to png_size_t or michael@0: * png_uint_32) should be explicitly applied; however, we do not expect to michael@0: * encounter practical situations that require such conversions. michael@0: * michael@0: * PNG_SMALL_SIZE_T must be defined if the maximum value of size_t is less than michael@0: * 4294967295 - i.e. less than the maximum value of png_uint_32. michael@0: */ michael@0: #ifdef PNG_SMALL_SIZE_T michael@0: typedef png_uint_32 png_alloc_size_t; michael@0: #else michael@0: typedef png_size_t png_alloc_size_t; michael@0: #endif michael@0: michael@0: /* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler michael@0: * implementations of Intel CPU specific support of user-mode segmented address michael@0: * spaces, where 16-bit pointers address more than 65536 bytes of memory using michael@0: * separate 'segment' registers. The implementation requires two different michael@0: * types of pointer (only one of which includes the segment value.) michael@0: * michael@0: * If required this support is available in version 1.2 of libpng and may be michael@0: * available in versions through 1.5, although the correctness of the code has michael@0: * not been verified recently. michael@0: */ michael@0: michael@0: /* Typedef for floating-point numbers that are converted to fixed-point with a michael@0: * multiple of 100,000, e.g., gamma michael@0: */ michael@0: typedef png_int_32 png_fixed_point; michael@0: michael@0: /* Add typedefs for pointers */ michael@0: typedef void * png_voidp; michael@0: typedef const void * png_const_voidp; michael@0: typedef png_byte * png_bytep; michael@0: typedef const png_byte * png_const_bytep; michael@0: typedef png_uint_32 * png_uint_32p; michael@0: typedef const png_uint_32 * png_const_uint_32p; michael@0: typedef png_int_32 * png_int_32p; michael@0: typedef const png_int_32 * png_const_int_32p; michael@0: typedef png_uint_16 * png_uint_16p; michael@0: typedef const png_uint_16 * png_const_uint_16p; michael@0: typedef png_int_16 * png_int_16p; michael@0: typedef const png_int_16 * png_const_int_16p; michael@0: typedef char * png_charp; michael@0: typedef const char * png_const_charp; michael@0: typedef png_fixed_point * png_fixed_point_p; michael@0: typedef const png_fixed_point * png_const_fixed_point_p; michael@0: typedef png_size_t * png_size_tp; michael@0: typedef const png_size_t * png_const_size_tp; michael@0: michael@0: #ifdef PNG_STDIO_SUPPORTED michael@0: typedef FILE * png_FILE_p; michael@0: #endif michael@0: michael@0: #ifdef PNG_FLOATING_POINT_SUPPORTED michael@0: typedef double * png_doublep; michael@0: typedef const double * png_const_doublep; michael@0: #endif michael@0: michael@0: /* Pointers to pointers; i.e. arrays */ michael@0: typedef png_byte * * png_bytepp; michael@0: typedef png_uint_32 * * png_uint_32pp; michael@0: typedef png_int_32 * * png_int_32pp; michael@0: typedef png_uint_16 * * png_uint_16pp; michael@0: typedef png_int_16 * * png_int_16pp; michael@0: typedef const char * * png_const_charpp; michael@0: typedef char * * png_charpp; michael@0: typedef png_fixed_point * * png_fixed_point_pp; michael@0: #ifdef PNG_FLOATING_POINT_SUPPORTED michael@0: typedef double * * png_doublepp; michael@0: #endif michael@0: michael@0: /* Pointers to pointers to pointers; i.e., pointer to array */ michael@0: typedef char * * * png_charppp; michael@0: michael@0: #endif /* PNG_BUILDING_SYMBOL_TABLE */ michael@0: michael@0: #endif /* PNGCONF_H */