misc/winutils/include/pngconf.h
author Wuzzy <Wuzzy2@mail.ru>
Mon, 12 Mar 2018 02:09:21 +0100
changeset 13169 6869d27a2f3f
parent 7889 57b117d441b9
permissions -rw-r--r--
ACF7: Add one pick hammer in crate Players often reported to screw up with the pick hammer, which is quite annoying. With one pick hammer more, this mission should be slightly less annoying.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7889
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
     1
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
     2
/* pngconf.h - machine configurable file for libpng
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
     3
 *
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
     4
 * libpng version 1.5.13 - September 27, 2012
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
     5
 *
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
     6
 * Copyright (c) 1998-2012 Glenn Randers-Pehrson
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
     7
 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
     8
 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
     9
 *
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    10
 * This code is released under the libpng license.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    11
 * For conditions of distribution and use, see the disclaimer
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    12
 * and license in png.h
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    13
 *
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    14
 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    15
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    16
/* Any machine specific code is near the front of this file, so if you
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    17
 * are configuring libpng for a machine, you may want to read the section
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    18
 * starting here down to where it starts to typedef png_color, png_text,
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    19
 * and png_info.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    20
 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    21
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    22
#ifndef PNGCONF_H
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    23
#define PNGCONF_H
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    24
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    25
#ifndef PNG_BUILDING_SYMBOL_TABLE
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    26
/* PNG_NO_LIMITS_H may be used to turn off the use of the standard C
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    27
 * definition file for  machine specific limits, this may impact the
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    28
 * correctness of the definitions below (see uses of INT_MAX).
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    29
 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    30
#  ifndef PNG_NO_LIMITS_H
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    31
#    include <limits.h>
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    32
#  endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    33
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    34
/* For the memory copy APIs (i.e. the standard definitions of these),
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    35
 * because this file defines png_memcpy and so on the base APIs must
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    36
 * be defined here.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    37
 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    38
#  ifdef BSD
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    39
#    include <strings.h>
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    40
#  else
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    41
#    include <string.h>
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    42
#  endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    43
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    44
/* For png_FILE_p - this provides the standard definition of a
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    45
 * FILE
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    46
 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    47
#  ifdef PNG_STDIO_SUPPORTED
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    48
#    include <stdio.h>
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    49
#  endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    50
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    51
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    52
/* This controls optimization of the reading of 16 and 32 bit values
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    53
 * from PNG files.  It can be set on a per-app-file basis - it
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    54
 * just changes whether a macro is used when the function is called.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    55
 * The library builder sets the default; if read functions are not
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    56
 * built into the library the macro implementation is forced on.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    57
 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    58
#ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    59
#  define PNG_USE_READ_MACROS
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    60
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    61
#if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    62
#  if PNG_DEFAULT_READ_MACROS
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    63
#    define PNG_USE_READ_MACROS
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    64
#  endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    65
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    66
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    67
/* COMPILER SPECIFIC OPTIONS.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    68
 *
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    69
 * These options are provided so that a variety of difficult compilers
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    70
 * can be used.  Some are fixed at build time (e.g. PNG_API_RULE
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    71
 * below) but still have compiler specific implementations, others
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    72
 * may be changed on a per-file basis when compiling against libpng.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    73
 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    74
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    75
/* The PNGARG macro protects us against machines that don't have function
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    76
 * prototypes (ie K&R style headers).  If your compiler does not handle
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    77
 * function prototypes, define this macro and use the included ansi2knr.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    78
 * I've always been able to use _NO_PROTO as the indicator, but you may
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    79
 * need to drag the empty declaration out in front of here, or change the
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    80
 * ifdef to suit your own needs.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    81
 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    82
#ifndef PNGARG
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    83
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    84
#  ifdef OF /* zlib prototype munger */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    85
#    define PNGARG(arglist) OF(arglist)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    86
#  else
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    87
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    88
#    ifdef _NO_PROTO
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    89
#      define PNGARG(arglist) ()
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    90
#    else
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    91
#      define PNGARG(arglist) arglist
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    92
#    endif /* _NO_PROTO */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    93
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    94
#  endif /* OF */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    95
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    96
#endif /* PNGARG */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    97
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    98
/* Function calling conventions.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
    99
 * =============================
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   100
 * Normally it is not necessary to specify to the compiler how to call
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   101
 * a function - it just does it - however on x86 systems derived from
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   102
 * Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   103
 * and some others) there are multiple ways to call a function and the
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   104
 * default can be changed on the compiler command line.  For this reason
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   105
 * libpng specifies the calling convention of every exported function and
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   106
 * every function called via a user supplied function pointer.  This is
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   107
 * done in this file by defining the following macros:
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   108
 *
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   109
 * PNGAPI    Calling convention for exported functions.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   110
 * PNGCBAPI  Calling convention for user provided (callback) functions.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   111
 * PNGCAPI   Calling convention used by the ANSI-C library (required
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   112
 *           for longjmp callbacks and sometimes used internally to
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   113
 *           specify the calling convention for zlib).
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   114
 *
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   115
 * These macros should never be overridden.  If it is necessary to
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   116
 * change calling convention in a private build this can be done
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   117
 * by setting PNG_API_RULE (which defaults to 0) to one of the values
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   118
 * below to select the correct 'API' variants.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   119
 *
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   120
 * PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   121
 *                This is correct in every known environment.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   122
 * PNG_API_RULE=1 Use the operating system convention for PNGAPI and
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   123
 *                the 'C' calling convention (from PNGCAPI) for
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   124
 *                callbacks (PNGCBAPI).  This is no longer required
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   125
 *                in any known environment - if it has to be used
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   126
 *                please post an explanation of the problem to the
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   127
 *                libpng mailing list.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   128
 *
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   129
 * These cases only differ if the operating system does not use the C
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   130
 * calling convention, at present this just means the above cases
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   131
 * (x86 DOS/Windows sytems) and, even then, this does not apply to
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   132
 * Cygwin running on those systems.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   133
 *
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   134
 * Note that the value must be defined in pnglibconf.h so that what
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   135
 * the application uses to call the library matches the conventions
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   136
 * set when building the library.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   137
 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   138
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   139
/* Symbol export
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   140
 * =============
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   141
 * When building a shared library it is almost always necessary to tell
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   142
 * the compiler which symbols to export.  The png.h macro 'PNG_EXPORT'
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   143
 * is used to mark the symbols.  On some systems these symbols can be
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   144
 * extracted at link time and need no special processing by the compiler,
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   145
 * on other systems the symbols are flagged by the compiler and just
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   146
 * the declaration requires a special tag applied (unfortunately) in a
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   147
 * compiler dependent way.  Some systems can do either.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   148
 *
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   149
 * A small number of older systems also require a symbol from a DLL to
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   150
 * be flagged to the program that calls it.  This is a problem because
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   151
 * we do not know in the header file included by application code that
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   152
 * the symbol will come from a shared library, as opposed to a statically
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   153
 * linked one.  For this reason the application must tell us by setting
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   154
 * the magic flag PNG_USE_DLL to turn on the special processing before
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   155
 * it includes png.h.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   156
 *
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   157
 * Four additional macros are used to make this happen:
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   158
 *
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   159
 * PNG_IMPEXP The magic (if any) to cause a symbol to be exported from
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   160
 *            the build or imported if PNG_USE_DLL is set - compiler
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   161
 *            and system specific.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   162
 *
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   163
 * PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   164
 *                       'type', compiler specific.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   165
 *
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   166
 * PNG_DLL_EXPORT Set to the magic to use during a libpng build to
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   167
 *                make a symbol exported from the DLL.  Not used in the
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   168
 *                public header files; see pngpriv.h for how it is used
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   169
 *                in the libpng build.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   170
 *
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   171
 * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   172
 *                from a DLL - used to define PNG_IMPEXP when
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   173
 *                PNG_USE_DLL is set.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   174
 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   175
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   176
/* System specific discovery.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   177
 * ==========================
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   178
 * This code is used at build time to find PNG_IMPEXP, the API settings
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   179
 * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   180
 * import processing is possible.  On Windows/x86 systems it also sets
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   181
 * compiler-specific macros to the values required to change the calling
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   182
 * conventions of the various functions.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   183
 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   184
#if ( defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   185
      defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) ) &&\
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   186
    ( defined(_X86_) || defined(_X64_) || defined(_M_IX86) ||\
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   187
      defined(_M_X64) || defined(_M_IA64) )
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   188
  /* Windows system (DOS doesn't support DLLs) running on x86/x64.  Includes
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   189
   * builds under Cygwin or MinGW.  Also includes Watcom builds but these need
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   190
   * special treatment because they are not compatible with GCC or Visual C
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   191
   * because of different calling conventions.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   192
   */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   193
#  if PNG_API_RULE == 2
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   194
    /* If this line results in an error, either because __watcall is not
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   195
     * understood or because of a redefine just below you cannot use *this*
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   196
     * build of the library with the compiler you are using.  *This* build was
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   197
     * build using Watcom and applications must also be built using Watcom!
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   198
     */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   199
#    define PNGCAPI __watcall
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   200
#  endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   201
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   202
#  if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   203
#    define PNGCAPI __cdecl
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   204
#    if PNG_API_RULE == 1
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   205
#      define PNGAPI __stdcall
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   206
#    endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   207
#  else
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   208
    /* An older compiler, or one not detected (erroneously) above,
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   209
     * if necessary override on the command line to get the correct
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   210
     * variants for the compiler.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   211
     */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   212
#    ifndef PNGCAPI
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   213
#      define PNGCAPI _cdecl
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   214
#    endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   215
#    if PNG_API_RULE == 1 && !defined(PNGAPI)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   216
#      define PNGAPI _stdcall
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   217
#    endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   218
#  endif /* compiler/api */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   219
  /* NOTE: PNGCBAPI always defaults to PNGCAPI. */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   220
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   221
#  if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   222
   ERROR: PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   223
#  endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   224
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   225
#  if (defined(_MSC_VER) && _MSC_VER < 800) ||\
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   226
      (defined(__BORLANDC__) && __BORLANDC__ < 0x500)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   227
    /* older Borland and MSC
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   228
     * compilers used '__export' and required this to be after
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   229
     * the type.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   230
     */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   231
#    ifndef PNG_EXPORT_TYPE
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   232
#      define PNG_EXPORT_TYPE(type) type PNG_IMPEXP
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   233
#    endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   234
#    define PNG_DLL_EXPORT __export
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   235
#  else /* newer compiler */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   236
#    define PNG_DLL_EXPORT __declspec(dllexport)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   237
#    ifndef PNG_DLL_IMPORT
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   238
#      define PNG_DLL_IMPORT __declspec(dllimport)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   239
#    endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   240
#  endif /* compiler */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   241
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   242
#else /* !Windows/x86 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   243
#  if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   244
#    define PNGAPI _System
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   245
#  else /* !Windows/x86 && !OS/2 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   246
    /* Use the defaults, or define PNG*API on the command line (but
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   247
     * this will have to be done for every compile!)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   248
     */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   249
#  endif /* other system, !OS/2 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   250
#endif /* !Windows/x86 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   251
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   252
/* Now do all the defaulting . */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   253
#ifndef PNGCAPI
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   254
#  define PNGCAPI
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   255
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   256
#ifndef PNGCBAPI
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   257
#  define PNGCBAPI PNGCAPI
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   258
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   259
#ifndef PNGAPI
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   260
#  define PNGAPI PNGCAPI
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   261
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   262
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   263
/* PNG_IMPEXP may be set on the compilation system command line or (if not set)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   264
 * then in an internal header file when building the library, otherwise (when
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   265
 * using the library) it is set here.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   266
 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   267
#ifndef PNG_IMPEXP
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   268
#  if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   269
     /* This forces use of a DLL, disallowing static linking */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   270
#    define PNG_IMPEXP PNG_DLL_IMPORT
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   271
#  endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   272
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   273
#  ifndef PNG_IMPEXP
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   274
#    define PNG_IMPEXP
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   275
#  endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   276
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   277
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   278
/* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   279
 * 'attributes' as a storage class - the attributes go at the start of the
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   280
 * function definition, and attributes are always appended regardless of the
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   281
 * compiler.  This considerably simplifies these macros but may cause problems
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   282
 * if any compilers both need function attributes and fail to handle them as
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   283
 * a storage class (this is unlikely.)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   284
 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   285
#ifndef PNG_FUNCTION
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   286
#  define PNG_FUNCTION(type, name, args, attributes) attributes type name args
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   287
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   288
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   289
#ifndef PNG_EXPORT_TYPE
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   290
#  define PNG_EXPORT_TYPE(type) PNG_IMPEXP type
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   291
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   292
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   293
   /* The ordinal value is only relevant when preprocessing png.h for symbol
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   294
    * table entries, so we discard it here.  See the .dfn files in the
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   295
    * scripts directory.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   296
    */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   297
#ifndef PNG_EXPORTA
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   298
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   299
#  define PNG_EXPORTA(ordinal, type, name, args, attributes)\
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   300
      PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args), \
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   301
        extern attributes)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   302
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   303
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   304
/* ANSI-C (C90) does not permit a macro to be invoked with an empty argument,
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   305
 * so make something non-empty to satisfy the requirement:
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   306
 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   307
#define PNG_EMPTY /*empty list*/
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   308
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   309
#define PNG_EXPORT(ordinal, type, name, args)\
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   310
   PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   311
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   312
/* Use PNG_REMOVED to comment out a removed interface. */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   313
#ifndef PNG_REMOVED
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   314
#  define PNG_REMOVED(ordinal, type, name, args, attributes)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   315
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   316
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   317
#ifndef PNG_CALLBACK
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   318
#  define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   319
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   320
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   321
/* Support for compiler specific function attributes.  These are used
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   322
 * so that where compiler support is available incorrect use of API
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   323
 * functions in png.h will generate compiler warnings.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   324
 *
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   325
 * Added at libpng-1.2.41.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   326
 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   327
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   328
#ifndef PNG_NO_PEDANTIC_WARNINGS
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   329
#  ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   330
#    define PNG_PEDANTIC_WARNINGS_SUPPORTED
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   331
#  endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   332
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   333
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   334
#ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   335
  /* Support for compiler specific function attributes.  These are used
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   336
   * so that where compiler support is available incorrect use of API
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   337
   * functions in png.h will generate compiler warnings.  Added at libpng
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   338
   * version 1.2.41.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   339
   */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   340
#  if defined(__GNUC__)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   341
#    ifndef PNG_USE_RESULT
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   342
#      define PNG_USE_RESULT __attribute__((__warn_unused_result__))
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   343
#    endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   344
#    ifndef PNG_NORETURN
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   345
#      define PNG_NORETURN   __attribute__((__noreturn__))
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   346
#    endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   347
#    if __GNUC__ >= 3
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   348
#      ifndef PNG_ALLOCATED
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   349
#        define PNG_ALLOCATED  __attribute__((__malloc__))
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   350
#      endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   351
#      ifndef PNG_DEPRECATED
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   352
#        define PNG_DEPRECATED __attribute__((__deprecated__))
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   353
#      endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   354
#      ifndef PNG_PRIVATE
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   355
#        if 0 /* Doesn't work so we use deprecated instead*/
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   356
#          define PNG_PRIVATE \
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   357
            __attribute__((warning("This function is not exported by libpng.")))
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   358
#        else
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   359
#          define PNG_PRIVATE \
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   360
            __attribute__((__deprecated__))
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   361
#        endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   362
#      endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   363
#    endif /*  __GNUC__ >= 3 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   364
#  endif /* __GNUC__ */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   365
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   366
#  if defined(_MSC_VER)  && (_MSC_VER >= 1300)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   367
#    ifndef PNG_USE_RESULT
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   368
#      define PNG_USE_RESULT /* not supported */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   369
#    endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   370
#    ifndef PNG_NORETURN
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   371
#      define PNG_NORETURN __declspec(noreturn)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   372
#    endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   373
#    ifndef PNG_ALLOCATED
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   374
#      if (_MSC_VER >= 1400)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   375
#        define PNG_ALLOCATED __declspec(restrict)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   376
#      endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   377
#    endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   378
#    ifndef PNG_DEPRECATED
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   379
#      define PNG_DEPRECATED __declspec(deprecated)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   380
#    endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   381
#    ifndef PNG_PRIVATE
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   382
#      define PNG_PRIVATE __declspec(deprecated)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   383
#    endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   384
#  endif /* _MSC_VER */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   385
#endif /* PNG_PEDANTIC_WARNINGS */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   386
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   387
#ifndef PNG_DEPRECATED
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   388
#  define PNG_DEPRECATED  /* Use of this function is deprecated */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   389
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   390
#ifndef PNG_USE_RESULT
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   391
#  define PNG_USE_RESULT  /* The result of this function must be checked */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   392
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   393
#ifndef PNG_NORETURN
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   394
#  define PNG_NORETURN    /* This function does not return */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   395
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   396
#ifndef PNG_ALLOCATED
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   397
#  define PNG_ALLOCATED   /* The result of the function is new memory */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   398
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   399
#ifndef PNG_PRIVATE
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   400
#  define PNG_PRIVATE     /* This is a private libpng function */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   401
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   402
#ifndef PNG_FP_EXPORT     /* A floating point API. */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   403
#  ifdef PNG_FLOATING_POINT_SUPPORTED
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   404
#     define PNG_FP_EXPORT(ordinal, type, name, args)\
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   405
         PNG_EXPORT(ordinal, type, name, args);
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   406
#  else                   /* No floating point APIs */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   407
#     define PNG_FP_EXPORT(ordinal, type, name, args)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   408
#  endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   409
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   410
#ifndef PNG_FIXED_EXPORT  /* A fixed point API. */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   411
#  ifdef PNG_FIXED_POINT_SUPPORTED
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   412
#     define PNG_FIXED_EXPORT(ordinal, type, name, args)\
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   413
         PNG_EXPORT(ordinal, type, name, args);
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   414
#  else                   /* No fixed point APIs */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   415
#     define PNG_FIXED_EXPORT(ordinal, type, name, args)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   416
#  endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   417
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   418
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   419
/* The following uses const char * instead of char * for error
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   420
 * and warning message functions, so some compilers won't complain.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   421
 * If you do not want to use const, define PNG_NO_CONST here.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   422
 *
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   423
 * This should not change how the APIs are called, so it can be done
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   424
 * on a per-file basis in the application.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   425
 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   426
#ifndef PNG_CONST
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   427
#  ifndef PNG_NO_CONST
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   428
#    define PNG_CONST const
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   429
#  else
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   430
#    define PNG_CONST
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   431
#  endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   432
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   433
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   434
/* Some typedefs to get us started.  These should be safe on most of the
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   435
 * common platforms.  The typedefs should be at least as large as the
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   436
 * numbers suggest (a png_uint_32 must be at least 32 bits long), but they
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   437
 * don't have to be exactly that size.  Some compilers dislike passing
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   438
 * unsigned shorts as function parameters, so you may be better off using
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   439
 * unsigned int for png_uint_16.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   440
 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   441
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   442
#if defined(INT_MAX) && (INT_MAX > 0x7ffffffeL)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   443
typedef unsigned int png_uint_32;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   444
typedef int png_int_32;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   445
#else
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   446
typedef unsigned long png_uint_32;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   447
typedef long png_int_32;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   448
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   449
typedef unsigned short png_uint_16;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   450
typedef short png_int_16;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   451
typedef unsigned char png_byte;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   452
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   453
#ifdef PNG_NO_SIZE_T
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   454
typedef unsigned int png_size_t;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   455
#else
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   456
typedef size_t png_size_t;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   457
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   458
#define png_sizeof(x) (sizeof (x))
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   459
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   460
/* The following is needed for medium model support.  It cannot be in the
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   461
 * pngpriv.h header.  Needs modification for other compilers besides
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   462
 * MSC.  Model independent support declares all arrays and pointers to be
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   463
 * large using the far keyword.  The zlib version used must also support
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   464
 * model independent data.  As of version zlib 1.0.4, the necessary changes
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   465
 * have been made in zlib.  The USE_FAR_KEYWORD define triggers other
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   466
 * changes that are needed. (Tim Wegner)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   467
 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   468
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   469
/* Separate compiler dependencies (problem here is that zlib.h always
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   470
 * defines FAR. (SJT)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   471
 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   472
#ifdef __BORLANDC__
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   473
#  if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   474
#    define LDATA 1
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   475
#  else
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   476
#    define LDATA 0
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   477
#  endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   478
  /* GRR:  why is Cygwin in here?  Cygwin is not Borland C... */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   479
#  if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   480
#    define PNG_MAX_MALLOC_64K /* only used in build */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   481
#    if (LDATA != 1)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   482
#      ifndef FAR
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   483
#        define FAR __far
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   484
#      endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   485
#      define USE_FAR_KEYWORD
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   486
#    endif   /* LDATA != 1 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   487
         /* Possibly useful for moving data out of default segment.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   488
          * Uncomment it if you want. Could also define FARDATA as
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   489
          * const if your compiler supports it. (SJT)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   490
#        define FARDATA FAR
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   491
          */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   492
#  endif  /* __WIN32__, __FLAT__, __CYGWIN__ */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   493
#endif   /* __BORLANDC__ */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   494
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   495
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   496
/* Suggest testing for specific compiler first before testing for
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   497
 * FAR.  The Watcom compiler defines both __MEDIUM__ and M_I86MM,
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   498
 * making reliance oncertain keywords suspect. (SJT)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   499
 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   500
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   501
/* MSC Medium model */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   502
#ifdef FAR
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   503
#  ifdef M_I86MM
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   504
#    define USE_FAR_KEYWORD
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   505
#    define FARDATA FAR
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   506
#    include <dos.h>
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   507
#  endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   508
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   509
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   510
/* SJT: default case */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   511
#ifndef FAR
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   512
#  define FAR
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   513
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   514
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   515
/* At this point FAR is always defined */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   516
#ifndef FARDATA
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   517
#  define FARDATA
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   518
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   519
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   520
/* Typedef for floating-point numbers that are converted
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   521
 * to fixed-point with a multiple of 100,000, e.g., gamma
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   522
 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   523
typedef png_int_32 png_fixed_point;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   524
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   525
/* Add typedefs for pointers */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   526
typedef void                      FAR * png_voidp;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   527
typedef PNG_CONST void            FAR * png_const_voidp;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   528
typedef png_byte                  FAR * png_bytep;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   529
typedef PNG_CONST png_byte        FAR * png_const_bytep;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   530
typedef png_uint_32               FAR * png_uint_32p;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   531
typedef PNG_CONST png_uint_32     FAR * png_const_uint_32p;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   532
typedef png_int_32                FAR * png_int_32p;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   533
typedef PNG_CONST png_int_32      FAR * png_const_int_32p;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   534
typedef png_uint_16               FAR * png_uint_16p;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   535
typedef PNG_CONST png_uint_16     FAR * png_const_uint_16p;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   536
typedef png_int_16                FAR * png_int_16p;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   537
typedef PNG_CONST png_int_16      FAR * png_const_int_16p;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   538
typedef char                      FAR * png_charp;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   539
typedef PNG_CONST char            FAR * png_const_charp;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   540
typedef png_fixed_point           FAR * png_fixed_point_p;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   541
typedef PNG_CONST png_fixed_point FAR * png_const_fixed_point_p;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   542
typedef png_size_t                FAR * png_size_tp;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   543
typedef PNG_CONST png_size_t      FAR * png_const_size_tp;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   544
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   545
#ifdef PNG_STDIO_SUPPORTED
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   546
typedef FILE            * png_FILE_p;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   547
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   548
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   549
#ifdef PNG_FLOATING_POINT_SUPPORTED
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   550
typedef double           FAR * png_doublep;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   551
typedef PNG_CONST double FAR * png_const_doublep;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   552
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   553
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   554
/* Pointers to pointers; i.e. arrays */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   555
typedef png_byte        FAR * FAR * png_bytepp;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   556
typedef png_uint_32     FAR * FAR * png_uint_32pp;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   557
typedef png_int_32      FAR * FAR * png_int_32pp;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   558
typedef png_uint_16     FAR * FAR * png_uint_16pp;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   559
typedef png_int_16      FAR * FAR * png_int_16pp;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   560
typedef PNG_CONST char  FAR * FAR * png_const_charpp;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   561
typedef char            FAR * FAR * png_charpp;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   562
typedef png_fixed_point FAR * FAR * png_fixed_point_pp;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   563
#ifdef PNG_FLOATING_POINT_SUPPORTED
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   564
typedef double          FAR * FAR * png_doublepp;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   565
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   566
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   567
/* Pointers to pointers to pointers; i.e., pointer to array */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   568
typedef char            FAR * FAR * FAR * png_charppp;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   569
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   570
/* png_alloc_size_t is guaranteed to be no smaller than png_size_t,
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   571
 * and no smaller than png_uint_32.  Casts from png_size_t or png_uint_32
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   572
 * to png_alloc_size_t are not necessary; in fact, it is recommended
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   573
 * not to use them at all so that the compiler can complain when something
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   574
 * turns out to be problematic.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   575
 * Casts in the other direction (from png_alloc_size_t to png_size_t or
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   576
 * png_uint_32) should be explicitly applied; however, we do not expect
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   577
 * to encounter practical situations that require such conversions.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   578
 */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   579
#if defined(__TURBOC__) && !defined(__FLAT__)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   580
   typedef unsigned long png_alloc_size_t;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   581
#else
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   582
#  if defined(_MSC_VER) && defined(MAXSEG_64K)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   583
     typedef unsigned long    png_alloc_size_t;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   584
#  else
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   585
     /* This is an attempt to detect an old Windows system where (int) is
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   586
      * actually 16 bits, in that case png_malloc must have an argument with a
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   587
      * bigger size to accomodate the requirements of the library.
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   588
      */
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   589
#    if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_)) && \
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   590
        (!defined(INT_MAX) || INT_MAX <= 0x7ffffffeL)
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   591
       typedef DWORD         png_alloc_size_t;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   592
#    else
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   593
       typedef png_size_t    png_alloc_size_t;
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   594
#    endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   595
#  endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   596
#endif
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   597
57b117d441b9 consistent line endings
nemo
parents: 7812
diff changeset
   598
#endif /* PNGCONF_H */