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