0N/A/*
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/A/* pngconf.h - machine configurable file for libpng
0N/A *
0N/A * This file is available under and governed by the GNU General Public
0N/A * License version 2 only, as published by the Free Software Foundation.
0N/A * However, the following notice accompanied the original version of this
0N/A * file and, per its terms, should not be removed:
0N/A *
4418N/A * libpng version 1.5.4 - July 7, 2011
4418N/A *
4418N/A * Copyright (c) 1998-2011 Glenn Randers-Pehrson
0N/A * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
0N/A * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
4418N/A *
4418N/A * This code is released under the libpng license.
4418N/A * For conditions of distribution and use, see the disclaimer
4418N/A * and license in png.h
4418N/A *
0N/A */
0N/A
0N/A/* Any machine specific code is near the front of this file, so if you
0N/A * are configuring libpng for a machine, you may want to read the section
0N/A * starting here down to where it starts to typedef png_color, png_text,
0N/A * and png_info.
0N/A */
0N/A
0N/A#ifndef PNGCONF_H
0N/A#define PNGCONF_H
0N/A
4418N/A#ifndef PNG_BUILDING_SYMBOL_TABLE
4418N/A/* PNG_NO_LIMITS_H may be used to turn off the use of the standard C
4418N/A * definition file for machine specific limits, this may impact the
4418N/A * correctness of the definitons below (see uses of INT_MAX).
0N/A */
4418N/A# ifndef PNG_NO_LIMITS_H
4418N/A# include <limits.h>
0N/A# endif
0N/A
4418N/A/* For the memory copy APIs (i.e. the standard definitions of these),
4418N/A * because this file defines png_memcpy and so on the base APIs must
4418N/A * be defined here.
0N/A */
4418N/A# ifdef BSD
4418N/A# include <strings.h>
4418N/A# else
4418N/A# include <string.h>
4418N/A# endif
0N/A
4418N/A/* For png_FILE_p - this provides the standard definition of a
4418N/A * FILE
4418N/A */
4418N/A# ifdef PNG_STDIO_SUPPORTED
4418N/A# include <stdio.h>
0N/A# endif
0N/A#endif
0N/A
4418N/A/* This controls optimization of the reading of 16 and 32 bit values
4418N/A * from PNG files. It can be set on a per-app-file basis - it
4418N/A * just changes whether a macro is used to the function is called.
4418N/A * The library builder sets the default, if read functions are not
4418N/A * built into the library the macro implementation is forced on.
0N/A */
4418N/A#ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED
4418N/A# define PNG_USE_READ_MACROS
0N/A#endif
4418N/A#if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS)
4418N/A# if PNG_DEFAULT_READ_MACROS
4418N/A# define PNG_USE_READ_MACROS
0N/A# endif
0N/A#endif
0N/A
4418N/A/* COMPILER SPECIFIC OPTIONS.
0N/A *
4418N/A * These options are provided so that a variety of difficult compilers
4418N/A * can be used. Some are fixed at build time (e.g. PNG_API_RULE
4418N/A * below) but still have compiler specific implementations, others
4418N/A * may be changed on a per-file basis when compiling against libpng.
0N/A */
0N/A
4418N/A/* The PNGARG macro protects us against machines that don't have function
0N/A * prototypes (ie K&R style headers). If your compiler does not handle
0N/A * function prototypes, define this macro and use the included ansi2knr.
0N/A * I've always been able to use _NO_PROTO as the indicator, but you may
0N/A * need to drag the empty declaration out in front of here, or change the
0N/A * ifdef to suit your own needs.
0N/A */
0N/A#ifndef PNGARG
0N/A
4418N/A# ifdef OF /* zlib prototype munger */
4418N/A# define PNGARG(arglist) OF(arglist)
4418N/A# else
0N/A
4418N/A# ifdef _NO_PROTO
4418N/A# define PNGARG(arglist) ()
4418N/A# else
4418N/A# define PNGARG(arglist) arglist
4418N/A# endif /* _NO_PROTO */
0N/A
4418N/A# endif /* OF */
0N/A
0N/A#endif /* PNGARG */
0N/A
4418N/A/* Function calling conventions.
4418N/A * =============================
4418N/A * Normally it is not necessary to specify to the compiler how to call
4418N/A * a function - it just does it - however on x86 systems derived from
4418N/A * Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems
4418N/A * and some others) there are multiple ways to call a function and the
4418N/A * default can be changed on the compiler command line. For this reason
4418N/A * libpng specifies the calling convention of every exported function and
4418N/A * every function called via a user supplied function pointer. This is
4418N/A * done in this file by defining the following macros:
4418N/A *
4418N/A * PNGAPI Calling convention for exported functions.
4418N/A * PNGCBAPI Calling convention for user provided (callback) functions.
4418N/A * PNGCAPI Calling convention used by the ANSI-C library (required
4418N/A * for longjmp callbacks and sometimes used internally to
4418N/A * specify the calling convention for zlib).
4418N/A *
4418N/A * These macros should never be overridden. If it is necessary to
4418N/A * change calling convention in a private build this can be done
4418N/A * by setting PNG_API_RULE (which defaults to 0) to one of the values
4418N/A * below to select the correct 'API' variants.
4418N/A *
4418N/A * PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout.
4418N/A * This is correct in every known environment.
4418N/A * PNG_API_RULE=1 Use the operating system convention for PNGAPI and
4418N/A * the 'C' calling convention (from PNGCAPI) for
4418N/A * callbacks (PNGCBAPI). This is no longer required
4418N/A * in any known environment - if it has to be used
4418N/A * please post an explanation of the problem to the
4418N/A * libpng mailing list.
4418N/A *
4418N/A * These cases only differ if the operating system does not use the C
4418N/A * calling convention, at present this just means the above cases
4418N/A * (x86 DOS/Windows sytems) and, even then, this does not apply to
4418N/A * Cygwin running on those systems.
4418N/A *
4418N/A * Note that the value must be defined in pnglibconf.h so that what
4418N/A * the application uses to call the library matches the conventions
4418N/A * set when building the library.
4418N/A */
4418N/A
4418N/A/* Symbol export
4418N/A * =============
4418N/A * When building a shared library it is almost always necessary to tell
4418N/A * the compiler which symbols to export. The png.h macro 'PNG_EXPORT'
4418N/A * is used to mark the symbols. On some systems these symbols can be
4418N/A * extracted at link time and need no special processing by the compiler,
4418N/A * on other systems the symbols are flagged by the compiler and just
4418N/A * the declaration requires a special tag applied (unfortunately) in a
4418N/A * compiler dependent way. Some systems can do either.
4418N/A *
4418N/A * A small number of older systems also require a symbol from a DLL to
4418N/A * be flagged to the program that calls it. This is a problem because
4418N/A * we do not know in the header file included by application code that
4418N/A * the symbol will come from a shared library, as opposed to a statically
4418N/A * linked one. For this reason the application must tell us by setting
4418N/A * the magic flag PNG_USE_DLL to turn on the special processing before
4418N/A * it includes png.h.
4418N/A *
4418N/A * Four additional macros are used to make this happen:
4418N/A *
4418N/A * PNG_IMPEXP The magic (if any) to cause a symbol to be exported from
4418N/A * the build or imported if PNG_USE_DLL is set - compiler
4418N/A * and system specific.
4418N/A *
4418N/A * PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to
4418N/A * 'type', compiler specific.
4418N/A *
4418N/A * PNG_DLL_EXPORT Set to the magic to use during a libpng build to
4418N/A * make a symbol exported from the DLL.
4418N/A *
4418N/A * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come
4418N/A * from a DLL - used to define PNG_IMPEXP when
4418N/A * PNG_USE_DLL is set.
4418N/A */
4418N/A
4418N/A/* System specific discovery.
4418N/A * ==========================
4418N/A * This code is used at build time to find PNG_IMPEXP, the API settings
4418N/A * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL
4418N/A * import processing is possible. On Windows/x86 systems it also sets
4418N/A * compiler-specific macros to the values required to change the calling
4418N/A * conventions of the various functions.
0N/A */
4418N/A#if ( defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\
4418N/A defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) ) &&\
4418N/A ( defined(_X86_) || defined(_X64_) || defined(_M_IX86) ||\
4418N/A defined(_M_X64) || defined(_M_IA64) )
4418N/A /* Windows system (DOS doesn't support DLLs) running on x86/x64. Includes
4418N/A * builds under Cygwin or MinGW. Also includes Watcom builds but these need
4418N/A * special treatment because they are not compatible with GCC or Visual C
4418N/A * because of different calling conventions.
4418N/A */
4418N/A# if PNG_API_RULE == 2
4418N/A /* If this line results in an error, either because __watcall is not
4418N/A * understood or because of a redefine just below you cannot use *this*
4418N/A * build of the library with the compiler you are using. *This* build was
4418N/A * build using Watcom and applications must also be built using Watcom!
4418N/A */
4418N/A# define PNGCAPI __watcall
4418N/A# endif
4418N/A
4418N/A# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
4418N/A# define PNGCAPI __cdecl
4418N/A# if PNG_API_RULE == 1
4418N/A# define PNGAPI __stdcall
4418N/A# endif
4418N/A# else
4418N/A /* An older compiler, or one not detected (erroneously) above,
4418N/A * if necessary override on the command line to get the correct
4418N/A * variants for the compiler.
4418N/A */
4418N/A# ifndef PNGCAPI
4418N/A# define PNGCAPI _cdecl
4418N/A# endif
4418N/A# if PNG_API_RULE == 1 && !defined(PNGAPI)
4418N/A# define PNGAPI _stdcall
4418N/A# endif
4418N/A# endif /* compiler/api */
4418N/A /* NOTE: PNGCBAPI always defaults to PNGCAPI. */
4418N/A
4418N/A# if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)
4418N/A ERROR: PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed
4418N/A# endif
4418N/A
4418N/A# if (defined(_MSC_VER) && _MSC_VER < 800) ||\
4418N/A (defined(__BORLANDC__) && __BORLANDC__ < 0x500)
4418N/A /* older Borland and MSC
4418N/A * compilers used '__export' and required this to be after
4418N/A * the type.
4418N/A */
4418N/A# ifndef PNG_EXPORT_TYPE
4418N/A# define PNG_EXPORT_TYPE(type) type PNG_IMPEXP
4418N/A# endif
4418N/A# define PNG_DLL_EXPORT __export
4418N/A# else /* newer compiler */
4418N/A# define PNG_DLL_EXPORT __declspec(dllexport)
4418N/A# ifndef PNG_DLL_IMPORT
4418N/A# define PNG_DLL_IMPORT __declspec(dllimport)
4418N/A# endif
4418N/A# endif /* compiler */
4418N/A
4418N/A#else /* !Windows/x86 */
4418N/A# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
4418N/A# define PNGAPI _System
4418N/A# else /* !Windows/x86 && !OS/2 */
4418N/A /* Use the defaults, or define PNG*API on the command line (but
4418N/A * this will have to be done for every compile!)
4418N/A */
4418N/A# endif /* other system, !OS/2 */
4418N/A#endif /* !Windows/x86 */
4418N/A
4418N/A/* Now do all the defaulting . */
4418N/A#ifndef PNGCAPI
4418N/A# define PNGCAPI
4418N/A#endif
4418N/A#ifndef PNGCBAPI
4418N/A# define PNGCBAPI PNGCAPI
4418N/A#endif
4418N/A#ifndef PNGAPI
4418N/A# define PNGAPI PNGCAPI
4418N/A#endif
4418N/A
4418N/A/* The default for PNG_IMPEXP depends on whether the library is
4418N/A * being built or used.
4418N/A */
4418N/A#ifndef PNG_IMPEXP
4418N/A# ifdef PNGLIB_BUILD
4418N/A /* Building the library */
4418N/A# if (defined(DLL_EXPORT)/*from libtool*/ ||\
4418N/A defined(_WINDLL) || defined(_DLL) || defined(__DLL__) ||\
4418N/A defined(_USRDLL) ||\
4418N/A defined(PNG_BUILD_DLL)) && defined(PNG_DLL_EXPORT)
4418N/A /* Building a DLL. */
4418N/A# define PNG_IMPEXP PNG_DLL_EXPORT
4418N/A# endif /* DLL */
4418N/A# else
4418N/A /* Using the library */
4418N/A# if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT)
4418N/A /* This forces use of a DLL, disallowing static linking */
4418N/A# define PNG_IMPEXP PNG_DLL_IMPORT
4418N/A# endif
4418N/A# endif
4418N/A
4418N/A# ifndef PNG_IMPEXP
4418N/A# define PNG_IMPEXP
0N/A# endif
0N/A#endif
0N/A
4418N/A/* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat
4418N/A * 'attributes' as a storage class - the attributes go at the start of the
4418N/A * function definition, and attributes are always appended regardless of the
4418N/A * compiler. This considerably simplifies these macros but may cause problems
4418N/A * if any compilers both need function attributes and fail to handle them as
4418N/A * a storage class (this is unlikely.)
4418N/A */
4418N/A#ifndef PNG_FUNCTION
4418N/A# define PNG_FUNCTION(type, name, args, attributes) attributes type name args
4418N/A#endif
4418N/A
4418N/A#ifndef PNG_EXPORT_TYPE
4418N/A# define PNG_EXPORT_TYPE(type) PNG_IMPEXP type
0N/A#endif
0N/A
4418N/A /* The ordinal value is only relevant when preprocessing png.h for symbol
4418N/A * table entries, so we discard it here. See the .dfn files in the
4418N/A * scripts directory.
4418N/A */
4418N/A#ifndef PNG_EXPORTA
4418N/A
4418N/A# define PNG_EXPORTA(ordinal, type, name, args, attributes)\
4418N/A PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args), \
4418N/A extern attributes)
0N/A#endif
0N/A
4418N/A/* ANSI-C (C90) does not permit a macro to be invoked with an empty argument,
4418N/A * so make something non-empty to satisfy the requirement:
4418N/A */
4418N/A#define PNG_EMPTY /*empty list*/
4418N/A
4418N/A#define PNG_EXPORT(ordinal, type, name, args)\
4418N/A PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY)
4418N/A
4418N/A/* Use PNG_REMOVED to comment out a removed interface. */
4418N/A#ifndef PNG_REMOVED
4418N/A# define PNG_REMOVED(ordinal, type, name, args, attributes)
4418N/A#endif
4418N/A
4418N/A#ifndef PNG_CALLBACK
4418N/A# define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args)
4418N/A#endif
4418N/A
4418N/A/* Support for compiler specific function attributes. These are used
4418N/A * so that where compiler support is available incorrect use of API
4418N/A * functions in png.h will generate compiler warnings.
4418N/A *
4418N/A * Added at libpng-1.2.41.
0N/A */
0N/A
4418N/A#ifndef PNG_NO_PEDANTIC_WARNINGS
4418N/A# ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED
4418N/A# define PNG_PEDANTIC_WARNINGS_SUPPORTED
0N/A# endif
0N/A#endif
0N/A
4418N/A#ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED
4418N/A /* Support for compiler specific function attributes. These are used
4418N/A * so that where compiler support is available incorrect use of API
4418N/A * functions in png.h will generate compiler warnings. Added at libpng
4418N/A * version 1.2.41.
4418N/A */
4418N/A# if defined(__GNUC__)
4418N/A# ifndef PNG_USE_RESULT
4418N/A# define PNG_USE_RESULT __attribute__((__warn_unused_result__))
4418N/A# endif
4418N/A# ifndef PNG_NORETURN
4418N/A# define PNG_NORETURN __attribute__((__noreturn__))
4418N/A# endif
4418N/A# ifndef PNG_ALLOCATED
4418N/A# define PNG_ALLOCATED __attribute__((__malloc__))
4418N/A# endif
0N/A
4418N/A /* This specifically protects structure members that should only be
4418N/A * accessed from within the library, therefore should be empty during
4418N/A * a library build.
4418N/A */
4418N/A# ifndef PNGLIB_BUILD
4418N/A# ifndef PNG_DEPRECATED
4418N/A# define PNG_DEPRECATED __attribute__((__deprecated__))
4418N/A# endif
4418N/A# ifndef PNG_PRIVATE
4418N/A# if 0 /* Doesn't work so we use deprecated instead*/
4418N/A# define PNG_PRIVATE \
4418N/A __attribute__((warning("This function is not exported by libpng.")))
4418N/A# else
4418N/A# define PNG_PRIVATE \
4418N/A __attribute__((__deprecated__))
4418N/A# endif
4418N/A# endif
4418N/A# endif /* PNGLIB_BUILD */
4418N/A# endif /* __GNUC__ */
0N/A
4418N/A# if defined(_MSC_VER) && (_MSC_VER >= 1300)
4418N/A# ifndef PNG_USE_RESULT
4418N/A# define PNG_USE_RESULT /* not supported */
4418N/A# endif
4418N/A# ifndef PNG_NORETURN
4418N/A# define PNG_NORETURN __declspec(noreturn)
4418N/A# endif
4418N/A# ifndef PNG_ALLOCATED
4418N/A# if (_MSC_VER >= 1400)
4418N/A# define PNG_ALLOCATED __declspec(restrict)
4418N/A# endif
4418N/A# endif
4418N/A
4418N/A /* This specifically protects structure members that should only be
4418N/A * accessed from within the library, therefore should be empty during
4418N/A * a library build.
4418N/A */
4418N/A# ifndef PNGLIB_BUILD
4418N/A# ifndef PNG_DEPRECATED
4418N/A# define PNG_DEPRECATED __declspec(deprecated)
4418N/A# endif
4418N/A# ifndef PNG_PRIVATE
4418N/A# define PNG_PRIVATE __declspec(deprecated)
4418N/A# endif
4418N/A# endif /* PNGLIB_BUILD */
4418N/A# endif /* _MSC_VER */
4418N/A#endif /* PNG_PEDANTIC_WARNINGS */
4418N/A
4418N/A#ifndef PNG_DEPRECATED
4418N/A# define PNG_DEPRECATED /* Use of this function is deprecated */
0N/A#endif
4418N/A#ifndef PNG_USE_RESULT
4418N/A# define PNG_USE_RESULT /* The result of this function must be checked */
4418N/A#endif
4418N/A#ifndef PNG_NORETURN
4418N/A# define PNG_NORETURN /* This function does not return */
0N/A#endif
4418N/A#ifndef PNG_ALLOCATED
4418N/A# define PNG_ALLOCATED /* The result of the function is new memory */
4418N/A#endif
4418N/A#ifndef PNG_PRIVATE
4418N/A# define PNG_PRIVATE /* This is a private libpng function */
0N/A#endif
4418N/A#ifndef PNG_FP_EXPORT /* A floating point API. */
4418N/A# ifdef PNG_FLOATING_POINT_SUPPORTED
4418N/A# define PNG_FP_EXPORT(ordinal, type, name, args)\
4418N/A PNG_EXPORT(ordinal, type, name, args)
4418N/A# else /* No floating point APIs */
4418N/A# define PNG_FP_EXPORT(ordinal, type, name, args)
4418N/A# endif
0N/A#endif
4418N/A#ifndef PNG_FIXED_EXPORT /* A fixed point API. */
4418N/A# ifdef PNG_FIXED_POINT_SUPPORTED
4418N/A# define PNG_FIXED_EXPORT(ordinal, type, name, args)\
4418N/A PNG_EXPORT(ordinal, type, name, args)
4418N/A# else /* No fixed point APIs */
4418N/A# define PNG_FIXED_EXPORT(ordinal, type, name, args)
4418N/A# endif
0N/A#endif
0N/A
0N/A/* The following uses const char * instead of char * for error
0N/A * and warning message functions, so some compilers won't complain.
0N/A * If you do not want to use const, define PNG_NO_CONST here.
4418N/A *
4418N/A * This should not change how the APIs are called, so it can be done
4418N/A * on a per-file basis in the application.
0N/A */
4418N/A#ifndef PNG_CONST
4418N/A# ifndef PNG_NO_CONST
4418N/A# define PNG_CONST const
4418N/A# else
4418N/A# define PNG_CONST
0N/A# endif
0N/A#endif
0N/A
0N/A/* Some typedefs to get us started. These should be safe on most of the
0N/A * common platforms. The typedefs should be at least as large as the
0N/A * numbers suggest (a png_uint_32 must be at least 32 bits long), but they
0N/A * don't have to be exactly that size. Some compilers dislike passing
0N/A * unsigned shorts as function parameters, so you may be better off using
4418N/A * unsigned int for png_uint_16.
0N/A */
0N/A
4418N/A#if defined(INT_MAX) && (INT_MAX > 0x7ffffffeL)
4418N/Atypedef unsigned int png_uint_32;
4418N/Atypedef int png_int_32;
4418N/A#else
0N/Atypedef unsigned long png_uint_32;
0N/Atypedef long png_int_32;
4418N/A#endif
0N/Atypedef unsigned short png_uint_16;
0N/Atypedef short png_int_16;
0N/Atypedef unsigned char png_byte;
0N/A
4418N/A#ifdef PNG_NO_SIZE_T
4418N/Atypedef unsigned int png_size_t;
0N/A#else
4418N/Atypedef size_t png_size_t;
0N/A#endif
4418N/A#define png_sizeof(x) (sizeof (x))
0N/A
0N/A/* The following is needed for medium model support. It cannot be in the
4418N/A * pngpriv.h header. Needs modification for other compilers besides
0N/A * MSC. Model independent support declares all arrays and pointers to be
0N/A * large using the far keyword. The zlib version used must also support
0N/A * model independent data. As of version zlib 1.0.4, the necessary changes
0N/A * have been made in zlib. The USE_FAR_KEYWORD define triggers other
0N/A * changes that are needed. (Tim Wegner)
0N/A */
0N/A
0N/A/* Separate compiler dependencies (problem here is that zlib.h always
4418N/A * defines FAR. (SJT)
4418N/A */
0N/A#ifdef __BORLANDC__
0N/A# if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
0N/A# define LDATA 1
0N/A# else
0N/A# define LDATA 0
0N/A# endif
4418N/A /* GRR: why is Cygwin in here? Cygwin is not Borland C... */
0N/A# if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__)
4418N/A# define PNG_MAX_MALLOC_64K /* only used in build */
0N/A# if (LDATA != 1)
0N/A# ifndef FAR
0N/A# define FAR __far
0N/A# endif
0N/A# define USE_FAR_KEYWORD
0N/A# endif /* LDATA != 1 */
4418N/A /* Possibly useful for moving data out of default segment.
4418N/A * Uncomment it if you want. Could also define FARDATA as
4418N/A * const if your compiler supports it. (SJT)
4418N/A# define FARDATA FAR
4418N/A */
0N/A# endif /* __WIN32__, __FLAT__, __CYGWIN__ */
0N/A#endif /* __BORLANDC__ */
0N/A
0N/A
0N/A/* Suggest testing for specific compiler first before testing for
0N/A * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM,
0N/A * making reliance oncertain keywords suspect. (SJT)
0N/A */
0N/A
0N/A/* MSC Medium model */
4418N/A#ifdef FAR
4418N/A# ifdef M_I86MM
0N/A# define USE_FAR_KEYWORD
0N/A# define FARDATA FAR
0N/A# include <dos.h>
0N/A# endif
0N/A#endif
0N/A
0N/A/* SJT: default case */
0N/A#ifndef FAR
0N/A# define FAR
0N/A#endif
0N/A
0N/A/* At this point FAR is always defined */
0N/A#ifndef FARDATA
0N/A# define FARDATA
0N/A#endif
0N/A
0N/A/* Typedef for floating-point numbers that are converted
4418N/A * to fixed-point with a multiple of 100,000, e.g., gamma
4418N/A */
0N/Atypedef png_int_32 png_fixed_point;
0N/A
0N/A/* Add typedefs for pointers */
4418N/Atypedef void FAR * png_voidp;
4418N/Atypedef PNG_CONST void FAR * png_const_voidp;
4418N/Atypedef png_byte FAR * png_bytep;
4418N/Atypedef PNG_CONST png_byte FAR * png_const_bytep;
4418N/Atypedef png_uint_32 FAR * png_uint_32p;
4418N/Atypedef PNG_CONST png_uint_32 FAR * png_const_uint_32p;
4418N/Atypedef png_int_32 FAR * png_int_32p;
4418N/Atypedef PNG_CONST png_int_32 FAR * png_const_int_32p;
4418N/Atypedef png_uint_16 FAR * png_uint_16p;
4418N/Atypedef PNG_CONST png_uint_16 FAR * png_const_uint_16p;
4418N/Atypedef png_int_16 FAR * png_int_16p;
4418N/Atypedef PNG_CONST png_int_16 FAR * png_const_int_16p;
4418N/Atypedef char FAR * png_charp;
4418N/Atypedef PNG_CONST char FAR * png_const_charp;
4418N/Atypedef png_fixed_point FAR * png_fixed_point_p;
4418N/Atypedef PNG_CONST png_fixed_point FAR * png_const_fixed_point_p;
4418N/Atypedef png_size_t FAR * png_size_tp;
4418N/Atypedef PNG_CONST png_size_t FAR * png_const_size_tp;
0N/A
4418N/A#ifdef PNG_STDIO_SUPPORTED
4418N/Atypedef FILE * png_FILE_p;
0N/A#endif
0N/A
0N/A#ifdef PNG_FLOATING_POINT_SUPPORTED
4418N/Atypedef double FAR * png_doublep;
4418N/Atypedef PNG_CONST double FAR * png_const_doublep;
0N/A#endif
0N/A
0N/A/* Pointers to pointers; i.e. arrays */
0N/Atypedef png_byte FAR * FAR * png_bytepp;
0N/Atypedef png_uint_32 FAR * FAR * png_uint_32pp;
0N/Atypedef png_int_32 FAR * FAR * png_int_32pp;
0N/Atypedef png_uint_16 FAR * FAR * png_uint_16pp;
0N/Atypedef png_int_16 FAR * FAR * png_int_16pp;
0N/Atypedef PNG_CONST char FAR * FAR * png_const_charpp;
0N/Atypedef char FAR * FAR * png_charpp;
0N/Atypedef png_fixed_point FAR * FAR * png_fixed_point_pp;
0N/A#ifdef PNG_FLOATING_POINT_SUPPORTED
0N/Atypedef double FAR * FAR * png_doublepp;
0N/A#endif
0N/A
0N/A/* Pointers to pointers to pointers; i.e., pointer to array */
0N/Atypedef char FAR * FAR * FAR * png_charppp;
0N/A
4418N/A/* png_alloc_size_t is guaranteed to be no smaller than png_size_t,
4418N/A * and no smaller than png_uint_32. Casts from png_size_t or png_uint_32
4418N/A * to png_alloc_size_t are not necessary; in fact, it is recommended
4418N/A * not to use them at all so that the compiler can complain when something
4418N/A * turns out to be problematic.
4418N/A * Casts in the other direction (from png_alloc_size_t to png_size_t or
4418N/A * png_uint_32) should be explicitly applied; however, we do not expect
4418N/A * to encounter practical situations that require such conversions.
0N/A */
4418N/A#if defined(__TURBOC__) && !defined(__FLAT__)
4418N/A typedef unsigned long png_alloc_size_t;
4418N/A#else
4418N/A# if defined(_MSC_VER) && defined(MAXSEG_64K)
4418N/A typedef unsigned long png_alloc_size_t;
4418N/A# else
4418N/A /* This is an attempt to detect an old Windows system where (int) is
4418N/A * actually 16 bits, in that case png_malloc must have an argument with a
4418N/A * bigger size to accomodate the requirements of the library.
4418N/A */
4418N/A# if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_)) && \
4418N/A (!defined(INT_MAX) || INT_MAX <= 0x7ffffffeL)
4418N/A typedef DWORD png_alloc_size_t;
4418N/A# else
4418N/A typedef png_size_t png_alloc_size_t;
0N/A# endif
0N/A# endif
0N/A#endif
0N/A
0N/A#endif /* PNGCONF_H */