istereo2

annotate libs/libpng/pngconf.h @ 21:8f41da60b9f5

revert accidentally commited ui change
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 02 Oct 2015 04:55:54 +0300
parents
children
rev   line source
nuclear@2 1
nuclear@2 2 /* pngconf.h - machine configurable file for libpng
nuclear@2 3 *
nuclear@2 4 * libpng version 1.2.33 - October 31, 2008
nuclear@2 5 * For conditions of distribution and use, see copyright notice in png.h
nuclear@2 6 * Copyright (c) 1998-2008 Glenn Randers-Pehrson
nuclear@2 7 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
nuclear@2 8 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
nuclear@2 9 */
nuclear@2 10
nuclear@2 11 /* Any machine specific code is near the front of this file, so if you
nuclear@2 12 * are configuring libpng for a machine, you may want to read the section
nuclear@2 13 * starting here down to where it starts to typedef png_color, png_text,
nuclear@2 14 * and png_info.
nuclear@2 15 */
nuclear@2 16
nuclear@2 17 #ifndef PNGCONF_H
nuclear@2 18 #define PNGCONF_H
nuclear@2 19
nuclear@2 20 #define PNG_1_2_X
nuclear@2 21
nuclear@2 22 /*
nuclear@2 23 * PNG_USER_CONFIG has to be defined on the compiler command line. This
nuclear@2 24 * includes the resource compiler for Windows DLL configurations.
nuclear@2 25 */
nuclear@2 26 #ifdef PNG_USER_CONFIG
nuclear@2 27 # ifndef PNG_USER_PRIVATEBUILD
nuclear@2 28 # define PNG_USER_PRIVATEBUILD
nuclear@2 29 # endif
nuclear@2 30 #include "pngusr.h"
nuclear@2 31 #endif
nuclear@2 32
nuclear@2 33 /* PNG_CONFIGURE_LIBPNG is set by the "configure" script. */
nuclear@2 34 #ifdef PNG_CONFIGURE_LIBPNG
nuclear@2 35 #ifdef HAVE_CONFIG_H
nuclear@2 36 #include "config.h"
nuclear@2 37 #endif
nuclear@2 38 #endif
nuclear@2 39
nuclear@2 40 /*
nuclear@2 41 * Added at libpng-1.2.8
nuclear@2 42 *
nuclear@2 43 * If you create a private DLL you need to define in "pngusr.h" the followings:
nuclear@2 44 * #define PNG_USER_PRIVATEBUILD <Describes by whom and why this version of
nuclear@2 45 * the DLL was built>
nuclear@2 46 * e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons."
nuclear@2 47 * #define PNG_USER_DLLFNAME_POSTFIX <two-letter postfix that serve to
nuclear@2 48 * distinguish your DLL from those of the official release. These
nuclear@2 49 * correspond to the trailing letters that come after the version
nuclear@2 50 * number and must match your private DLL name>
nuclear@2 51 * e.g. // private DLL "libpng13gx.dll"
nuclear@2 52 * #define PNG_USER_DLLFNAME_POSTFIX "gx"
nuclear@2 53 *
nuclear@2 54 * The following macros are also at your disposal if you want to complete the
nuclear@2 55 * DLL VERSIONINFO structure.
nuclear@2 56 * - PNG_USER_VERSIONINFO_COMMENTS
nuclear@2 57 * - PNG_USER_VERSIONINFO_COMPANYNAME
nuclear@2 58 * - PNG_USER_VERSIONINFO_LEGALTRADEMARKS
nuclear@2 59 */
nuclear@2 60
nuclear@2 61 #ifdef __STDC__
nuclear@2 62 #ifdef SPECIALBUILD
nuclear@2 63 # pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\
nuclear@2 64 are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.")
nuclear@2 65 #endif
nuclear@2 66
nuclear@2 67 #ifdef PRIVATEBUILD
nuclear@2 68 # pragma message("PRIVATEBUILD is deprecated.\
nuclear@2 69 Use PNG_USER_PRIVATEBUILD instead.")
nuclear@2 70 # define PNG_USER_PRIVATEBUILD PRIVATEBUILD
nuclear@2 71 #endif
nuclear@2 72 #endif /* __STDC__ */
nuclear@2 73
nuclear@2 74 #ifndef PNG_VERSION_INFO_ONLY
nuclear@2 75
nuclear@2 76 /* End of material added to libpng-1.2.8 */
nuclear@2 77
nuclear@2 78 /* Added at libpng-1.2.19, removed at libpng-1.2.20 because it caused trouble
nuclear@2 79 Restored at libpng-1.2.21 */
nuclear@2 80 #if !defined(PNG_NO_WARN_UNINITIALIZED_ROW) && \
nuclear@2 81 !defined(PNG_WARN_UNINITIALIZED_ROW)
nuclear@2 82 # define PNG_WARN_UNINITIALIZED_ROW 1
nuclear@2 83 #endif
nuclear@2 84 /* End of material added at libpng-1.2.19/1.2.21 */
nuclear@2 85
nuclear@2 86 /* This is the size of the compression buffer, and thus the size of
nuclear@2 87 * an IDAT chunk. Make this whatever size you feel is best for your
nuclear@2 88 * machine. One of these will be allocated per png_struct. When this
nuclear@2 89 * is full, it writes the data to the disk, and does some other
nuclear@2 90 * calculations. Making this an extremely small size will slow
nuclear@2 91 * the library down, but you may want to experiment to determine
nuclear@2 92 * where it becomes significant, if you are concerned with memory
nuclear@2 93 * usage. Note that zlib allocates at least 32Kb also. For readers,
nuclear@2 94 * this describes the size of the buffer available to read the data in.
nuclear@2 95 * Unless this gets smaller than the size of a row (compressed),
nuclear@2 96 * it should not make much difference how big this is.
nuclear@2 97 */
nuclear@2 98
nuclear@2 99 #ifndef PNG_ZBUF_SIZE
nuclear@2 100 # define PNG_ZBUF_SIZE 8192
nuclear@2 101 #endif
nuclear@2 102
nuclear@2 103 /* Enable if you want a write-only libpng */
nuclear@2 104
nuclear@2 105 #ifndef PNG_NO_READ_SUPPORTED
nuclear@2 106 # define PNG_READ_SUPPORTED
nuclear@2 107 #endif
nuclear@2 108
nuclear@2 109 /* Enable if you want a read-only libpng */
nuclear@2 110
nuclear@2 111 #ifndef PNG_NO_WRITE_SUPPORTED
nuclear@2 112 # define PNG_WRITE_SUPPORTED
nuclear@2 113 #endif
nuclear@2 114
nuclear@2 115 /* Enabled by default in 1.2.0. You can disable this if you don't need to
nuclear@2 116 support PNGs that are embedded in MNG datastreams */
nuclear@2 117 #if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES)
nuclear@2 118 # ifndef PNG_MNG_FEATURES_SUPPORTED
nuclear@2 119 # define PNG_MNG_FEATURES_SUPPORTED
nuclear@2 120 # endif
nuclear@2 121 #endif
nuclear@2 122
nuclear@2 123 #ifndef PNG_NO_FLOATING_POINT_SUPPORTED
nuclear@2 124 # ifndef PNG_FLOATING_POINT_SUPPORTED
nuclear@2 125 # define PNG_FLOATING_POINT_SUPPORTED
nuclear@2 126 # endif
nuclear@2 127 #endif
nuclear@2 128
nuclear@2 129 /* If you are running on a machine where you cannot allocate more
nuclear@2 130 * than 64K of memory at once, uncomment this. While libpng will not
nuclear@2 131 * normally need that much memory in a chunk (unless you load up a very
nuclear@2 132 * large file), zlib needs to know how big of a chunk it can use, and
nuclear@2 133 * libpng thus makes sure to check any memory allocation to verify it
nuclear@2 134 * will fit into memory.
nuclear@2 135 #define PNG_MAX_MALLOC_64K
nuclear@2 136 */
nuclear@2 137 #if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K)
nuclear@2 138 # define PNG_MAX_MALLOC_64K
nuclear@2 139 #endif
nuclear@2 140
nuclear@2 141 /* Special munging to support doing things the 'cygwin' way:
nuclear@2 142 * 'Normal' png-on-win32 defines/defaults:
nuclear@2 143 * PNG_BUILD_DLL -- building dll
nuclear@2 144 * PNG_USE_DLL -- building an application, linking to dll
nuclear@2 145 * (no define) -- building static library, or building an
nuclear@2 146 * application and linking to the static lib
nuclear@2 147 * 'Cygwin' defines/defaults:
nuclear@2 148 * PNG_BUILD_DLL -- (ignored) building the dll
nuclear@2 149 * (no define) -- (ignored) building an application, linking to the dll
nuclear@2 150 * PNG_STATIC -- (ignored) building the static lib, or building an
nuclear@2 151 * application that links to the static lib.
nuclear@2 152 * ALL_STATIC -- (ignored) building various static libs, or building an
nuclear@2 153 * application that links to the static libs.
nuclear@2 154 * Thus,
nuclear@2 155 * a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and
nuclear@2 156 * this bit of #ifdefs will define the 'correct' config variables based on
nuclear@2 157 * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but
nuclear@2 158 * unnecessary.
nuclear@2 159 *
nuclear@2 160 * Also, the precedence order is:
nuclear@2 161 * ALL_STATIC (since we can't #undef something outside our namespace)
nuclear@2 162 * PNG_BUILD_DLL
nuclear@2 163 * PNG_STATIC
nuclear@2 164 * (nothing) == PNG_USE_DLL
nuclear@2 165 *
nuclear@2 166 * CYGWIN (2002-01-20): The preceding is now obsolete. With the advent
nuclear@2 167 * of auto-import in binutils, we no longer need to worry about
nuclear@2 168 * __declspec(dllexport) / __declspec(dllimport) and friends. Therefore,
nuclear@2 169 * we don't need to worry about PNG_STATIC or ALL_STATIC when it comes
nuclear@2 170 * to __declspec() stuff. However, we DO need to worry about
nuclear@2 171 * PNG_BUILD_DLL and PNG_STATIC because those change some defaults
nuclear@2 172 * such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed.
nuclear@2 173 */
nuclear@2 174 #if defined(__CYGWIN__)
nuclear@2 175 # if defined(ALL_STATIC)
nuclear@2 176 # if defined(PNG_BUILD_DLL)
nuclear@2 177 # undef PNG_BUILD_DLL
nuclear@2 178 # endif
nuclear@2 179 # if defined(PNG_USE_DLL)
nuclear@2 180 # undef PNG_USE_DLL
nuclear@2 181 # endif
nuclear@2 182 # if defined(PNG_DLL)
nuclear@2 183 # undef PNG_DLL
nuclear@2 184 # endif
nuclear@2 185 # if !defined(PNG_STATIC)
nuclear@2 186 # define PNG_STATIC
nuclear@2 187 # endif
nuclear@2 188 # else
nuclear@2 189 # if defined (PNG_BUILD_DLL)
nuclear@2 190 # if defined(PNG_STATIC)
nuclear@2 191 # undef PNG_STATIC
nuclear@2 192 # endif
nuclear@2 193 # if defined(PNG_USE_DLL)
nuclear@2 194 # undef PNG_USE_DLL
nuclear@2 195 # endif
nuclear@2 196 # if !defined(PNG_DLL)
nuclear@2 197 # define PNG_DLL
nuclear@2 198 # endif
nuclear@2 199 # else
nuclear@2 200 # if defined(PNG_STATIC)
nuclear@2 201 # if defined(PNG_USE_DLL)
nuclear@2 202 # undef PNG_USE_DLL
nuclear@2 203 # endif
nuclear@2 204 # if defined(PNG_DLL)
nuclear@2 205 # undef PNG_DLL
nuclear@2 206 # endif
nuclear@2 207 # else
nuclear@2 208 # if !defined(PNG_USE_DLL)
nuclear@2 209 # define PNG_USE_DLL
nuclear@2 210 # endif
nuclear@2 211 # if !defined(PNG_DLL)
nuclear@2 212 # define PNG_DLL
nuclear@2 213 # endif
nuclear@2 214 # endif
nuclear@2 215 # endif
nuclear@2 216 # endif
nuclear@2 217 #endif
nuclear@2 218
nuclear@2 219 /* This protects us against compilers that run on a windowing system
nuclear@2 220 * and thus don't have or would rather us not use the stdio types:
nuclear@2 221 * stdin, stdout, and stderr. The only one currently used is stderr
nuclear@2 222 * in png_error() and png_warning(). #defining PNG_NO_CONSOLE_IO will
nuclear@2 223 * prevent these from being compiled and used. #defining PNG_NO_STDIO
nuclear@2 224 * will also prevent these, plus will prevent the entire set of stdio
nuclear@2 225 * macros and functions (FILE *, printf, etc.) from being compiled and used,
nuclear@2 226 * unless (PNG_DEBUG > 0) has been #defined.
nuclear@2 227 *
nuclear@2 228 * #define PNG_NO_CONSOLE_IO
nuclear@2 229 * #define PNG_NO_STDIO
nuclear@2 230 */
nuclear@2 231
nuclear@2 232 #if defined(_WIN32_WCE)
nuclear@2 233 # include <windows.h>
nuclear@2 234 /* Console I/O functions are not supported on WindowsCE */
nuclear@2 235 # define PNG_NO_CONSOLE_IO
nuclear@2 236 # ifdef PNG_DEBUG
nuclear@2 237 # undef PNG_DEBUG
nuclear@2 238 # endif
nuclear@2 239 #endif
nuclear@2 240
nuclear@2 241 #ifdef PNG_BUILD_DLL
nuclear@2 242 # ifndef PNG_CONSOLE_IO_SUPPORTED
nuclear@2 243 # ifndef PNG_NO_CONSOLE_IO
nuclear@2 244 # define PNG_NO_CONSOLE_IO
nuclear@2 245 # endif
nuclear@2 246 # endif
nuclear@2 247 #endif
nuclear@2 248
nuclear@2 249 # ifdef PNG_NO_STDIO
nuclear@2 250 # ifndef PNG_NO_CONSOLE_IO
nuclear@2 251 # define PNG_NO_CONSOLE_IO
nuclear@2 252 # endif
nuclear@2 253 # ifdef PNG_DEBUG
nuclear@2 254 # if (PNG_DEBUG > 0)
nuclear@2 255 # include <stdio.h>
nuclear@2 256 # endif
nuclear@2 257 # endif
nuclear@2 258 # else
nuclear@2 259 # if !defined(_WIN32_WCE)
nuclear@2 260 /* "stdio.h" functions are not supported on WindowsCE */
nuclear@2 261 # include <stdio.h>
nuclear@2 262 # endif
nuclear@2 263 # endif
nuclear@2 264
nuclear@2 265 /* This macro protects us against machines that don't have function
nuclear@2 266 * prototypes (ie K&R style headers). If your compiler does not handle
nuclear@2 267 * function prototypes, define this macro and use the included ansi2knr.
nuclear@2 268 * I've always been able to use _NO_PROTO as the indicator, but you may
nuclear@2 269 * need to drag the empty declaration out in front of here, or change the
nuclear@2 270 * ifdef to suit your own needs.
nuclear@2 271 */
nuclear@2 272 #ifndef PNGARG
nuclear@2 273
nuclear@2 274 #ifdef OF /* zlib prototype munger */
nuclear@2 275 # define PNGARG(arglist) OF(arglist)
nuclear@2 276 #else
nuclear@2 277
nuclear@2 278 #ifdef _NO_PROTO
nuclear@2 279 # define PNGARG(arglist) ()
nuclear@2 280 # ifndef PNG_TYPECAST_NULL
nuclear@2 281 # define PNG_TYPECAST_NULL
nuclear@2 282 # endif
nuclear@2 283 #else
nuclear@2 284 # define PNGARG(arglist) arglist
nuclear@2 285 #endif /* _NO_PROTO */
nuclear@2 286
nuclear@2 287
nuclear@2 288 #endif /* OF */
nuclear@2 289
nuclear@2 290 #endif /* PNGARG */
nuclear@2 291
nuclear@2 292 /* Try to determine if we are compiling on a Mac. Note that testing for
nuclear@2 293 * just __MWERKS__ is not good enough, because the Codewarrior is now used
nuclear@2 294 * on non-Mac platforms.
nuclear@2 295 */
nuclear@2 296 #ifndef MACOS
nuclear@2 297 # if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
nuclear@2 298 defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
nuclear@2 299 # define MACOS
nuclear@2 300 # endif
nuclear@2 301 #endif
nuclear@2 302
nuclear@2 303 /* enough people need this for various reasons to include it here */
nuclear@2 304 #if !defined(MACOS) && !defined(RISCOS) && !defined(_WIN32_WCE)
nuclear@2 305 # include <sys/types.h>
nuclear@2 306 #endif
nuclear@2 307
nuclear@2 308 #if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED)
nuclear@2 309 # define PNG_SETJMP_SUPPORTED
nuclear@2 310 #endif
nuclear@2 311
nuclear@2 312 #ifdef PNG_SETJMP_SUPPORTED
nuclear@2 313 /* This is an attempt to force a single setjmp behaviour on Linux. If
nuclear@2 314 * the X config stuff didn't define _BSD_SOURCE we wouldn't need this.
nuclear@2 315 */
nuclear@2 316
nuclear@2 317 # ifdef __linux__
nuclear@2 318 # ifdef _BSD_SOURCE
nuclear@2 319 # define PNG_SAVE_BSD_SOURCE
nuclear@2 320 # undef _BSD_SOURCE
nuclear@2 321 # endif
nuclear@2 322 # ifdef _SETJMP_H
nuclear@2 323 /* If you encounter a compiler error here, see the explanation
nuclear@2 324 * near the end of INSTALL.
nuclear@2 325 */
nuclear@2 326 __pngconf.h__ already includes setjmp.h;
nuclear@2 327 __dont__ include it again.;
nuclear@2 328 # endif
nuclear@2 329 # endif /* __linux__ */
nuclear@2 330
nuclear@2 331 /* include setjmp.h for error handling */
nuclear@2 332 # include <setjmp.h>
nuclear@2 333
nuclear@2 334 # ifdef __linux__
nuclear@2 335 # ifdef PNG_SAVE_BSD_SOURCE
nuclear@2 336 # ifndef _BSD_SOURCE
nuclear@2 337 # define _BSD_SOURCE
nuclear@2 338 # endif
nuclear@2 339 # undef PNG_SAVE_BSD_SOURCE
nuclear@2 340 # endif
nuclear@2 341 # endif /* __linux__ */
nuclear@2 342 #endif /* PNG_SETJMP_SUPPORTED */
nuclear@2 343
nuclear@2 344 #ifdef BSD
nuclear@2 345 # include <strings.h>
nuclear@2 346 #else
nuclear@2 347 # include <string.h>
nuclear@2 348 #endif
nuclear@2 349
nuclear@2 350 /* Other defines for things like memory and the like can go here. */
nuclear@2 351 #ifdef PNG_INTERNAL
nuclear@2 352
nuclear@2 353 #include <stdlib.h>
nuclear@2 354
nuclear@2 355 /* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which
nuclear@2 356 * aren't usually used outside the library (as far as I know), so it is
nuclear@2 357 * debatable if they should be exported at all. In the future, when it is
nuclear@2 358 * possible to have run-time registry of chunk-handling functions, some of
nuclear@2 359 * these will be made available again.
nuclear@2 360 #define PNG_EXTERN extern
nuclear@2 361 */
nuclear@2 362 #define PNG_EXTERN
nuclear@2 363
nuclear@2 364 /* Other defines specific to compilers can go here. Try to keep
nuclear@2 365 * them inside an appropriate ifdef/endif pair for portability.
nuclear@2 366 */
nuclear@2 367
nuclear@2 368 #if defined(PNG_FLOATING_POINT_SUPPORTED)
nuclear@2 369 # if defined(MACOS)
nuclear@2 370 /* We need to check that <math.h> hasn't already been included earlier
nuclear@2 371 * as it seems it doesn't agree with <fp.h>, yet we should really use
nuclear@2 372 * <fp.h> if possible.
nuclear@2 373 */
nuclear@2 374 # if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
nuclear@2 375 # include <fp.h>
nuclear@2 376 # endif
nuclear@2 377 # else
nuclear@2 378 # include <math.h>
nuclear@2 379 # endif
nuclear@2 380 # if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
nuclear@2 381 /* Amiga SAS/C: We must include builtin FPU functions when compiling using
nuclear@2 382 * MATH=68881
nuclear@2 383 */
nuclear@2 384 # include <m68881.h>
nuclear@2 385 # endif
nuclear@2 386 #endif
nuclear@2 387
nuclear@2 388 /* Codewarrior on NT has linking problems without this. */
nuclear@2 389 #if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__)
nuclear@2 390 # define PNG_ALWAYS_EXTERN
nuclear@2 391 #endif
nuclear@2 392
nuclear@2 393 /* This provides the non-ANSI (far) memory allocation routines. */
nuclear@2 394 #if defined(__TURBOC__) && defined(__MSDOS__)
nuclear@2 395 # include <mem.h>
nuclear@2 396 # include <alloc.h>
nuclear@2 397 #endif
nuclear@2 398
nuclear@2 399 /* I have no idea why is this necessary... */
nuclear@2 400 #if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \
nuclear@2 401 defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__))
nuclear@2 402 # include <malloc.h>
nuclear@2 403 #endif
nuclear@2 404
nuclear@2 405 /* This controls how fine the dithering gets. As this allocates
nuclear@2 406 * a largish chunk of memory (32K), those who are not as concerned
nuclear@2 407 * with dithering quality can decrease some or all of these.
nuclear@2 408 */
nuclear@2 409 #ifndef PNG_DITHER_RED_BITS
nuclear@2 410 # define PNG_DITHER_RED_BITS 5
nuclear@2 411 #endif
nuclear@2 412 #ifndef PNG_DITHER_GREEN_BITS
nuclear@2 413 # define PNG_DITHER_GREEN_BITS 5
nuclear@2 414 #endif
nuclear@2 415 #ifndef PNG_DITHER_BLUE_BITS
nuclear@2 416 # define PNG_DITHER_BLUE_BITS 5
nuclear@2 417 #endif
nuclear@2 418
nuclear@2 419 /* This controls how fine the gamma correction becomes when you
nuclear@2 420 * are only interested in 8 bits anyway. Increasing this value
nuclear@2 421 * results in more memory being used, and more pow() functions
nuclear@2 422 * being called to fill in the gamma tables. Don't set this value
nuclear@2 423 * less then 8, and even that may not work (I haven't tested it).
nuclear@2 424 */
nuclear@2 425
nuclear@2 426 #ifndef PNG_MAX_GAMMA_8
nuclear@2 427 # define PNG_MAX_GAMMA_8 11
nuclear@2 428 #endif
nuclear@2 429
nuclear@2 430 /* This controls how much a difference in gamma we can tolerate before
nuclear@2 431 * we actually start doing gamma conversion.
nuclear@2 432 */
nuclear@2 433 #ifndef PNG_GAMMA_THRESHOLD
nuclear@2 434 # define PNG_GAMMA_THRESHOLD 0.05
nuclear@2 435 #endif
nuclear@2 436
nuclear@2 437 #endif /* PNG_INTERNAL */
nuclear@2 438
nuclear@2 439 /* The following uses const char * instead of char * for error
nuclear@2 440 * and warning message functions, so some compilers won't complain.
nuclear@2 441 * If you do not want to use const, define PNG_NO_CONST here.
nuclear@2 442 */
nuclear@2 443
nuclear@2 444 #ifndef PNG_NO_CONST
nuclear@2 445 # define PNG_CONST const
nuclear@2 446 #else
nuclear@2 447 # define PNG_CONST
nuclear@2 448 #endif
nuclear@2 449
nuclear@2 450 /* The following defines give you the ability to remove code from the
nuclear@2 451 * library that you will not be using. I wish I could figure out how to
nuclear@2 452 * automate this, but I can't do that without making it seriously hard
nuclear@2 453 * on the users. So if you are not using an ability, change the #define
nuclear@2 454 * to and #undef, and that part of the library will not be compiled. If
nuclear@2 455 * your linker can't find a function, you may want to make sure the
nuclear@2 456 * ability is defined here. Some of these depend upon some others being
nuclear@2 457 * defined. I haven't figured out all the interactions here, so you may
nuclear@2 458 * have to experiment awhile to get everything to compile. If you are
nuclear@2 459 * creating or using a shared library, you probably shouldn't touch this,
nuclear@2 460 * as it will affect the size of the structures, and this will cause bad
nuclear@2 461 * things to happen if the library and/or application ever change.
nuclear@2 462 */
nuclear@2 463
nuclear@2 464 /* Any features you will not be using can be undef'ed here */
nuclear@2 465
nuclear@2 466 /* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user
nuclear@2 467 * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS
nuclear@2 468 * on the compile line, then pick and choose which ones to define without
nuclear@2 469 * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED
nuclear@2 470 * if you only want to have a png-compliant reader/writer but don't need
nuclear@2 471 * any of the extra transformations. This saves about 80 kbytes in a
nuclear@2 472 * typical installation of the library. (PNG_NO_* form added in version
nuclear@2 473 * 1.0.1c, for consistency)
nuclear@2 474 */
nuclear@2 475
nuclear@2 476 /* The size of the png_text structure changed in libpng-1.0.6 when
nuclear@2 477 * iTXt support was added. iTXt support was turned off by default through
nuclear@2 478 * libpng-1.2.x, to support old apps that malloc the png_text structure
nuclear@2 479 * instead of calling png_set_text() and letting libpng malloc it. It
nuclear@2 480 * was turned on by default in libpng-1.3.0.
nuclear@2 481 */
nuclear@2 482
nuclear@2 483 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
nuclear@2 484 # ifndef PNG_NO_iTXt_SUPPORTED
nuclear@2 485 # define PNG_NO_iTXt_SUPPORTED
nuclear@2 486 # endif
nuclear@2 487 # ifndef PNG_NO_READ_iTXt
nuclear@2 488 # define PNG_NO_READ_iTXt
nuclear@2 489 # endif
nuclear@2 490 # ifndef PNG_NO_WRITE_iTXt
nuclear@2 491 # define PNG_NO_WRITE_iTXt
nuclear@2 492 # endif
nuclear@2 493 #endif
nuclear@2 494
nuclear@2 495 #if !defined(PNG_NO_iTXt_SUPPORTED)
nuclear@2 496 # if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt)
nuclear@2 497 # define PNG_READ_iTXt
nuclear@2 498 # endif
nuclear@2 499 # if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt)
nuclear@2 500 # define PNG_WRITE_iTXt
nuclear@2 501 # endif
nuclear@2 502 #endif
nuclear@2 503
nuclear@2 504 /* The following support, added after version 1.0.0, can be turned off here en
nuclear@2 505 * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility
nuclear@2 506 * with old applications that require the length of png_struct and png_info
nuclear@2 507 * to remain unchanged.
nuclear@2 508 */
nuclear@2 509
nuclear@2 510 #ifdef PNG_LEGACY_SUPPORTED
nuclear@2 511 # define PNG_NO_FREE_ME
nuclear@2 512 # define PNG_NO_READ_UNKNOWN_CHUNKS
nuclear@2 513 # define PNG_NO_WRITE_UNKNOWN_CHUNKS
nuclear@2 514 # define PNG_NO_READ_USER_CHUNKS
nuclear@2 515 # define PNG_NO_READ_iCCP
nuclear@2 516 # define PNG_NO_WRITE_iCCP
nuclear@2 517 # define PNG_NO_READ_iTXt
nuclear@2 518 # define PNG_NO_WRITE_iTXt
nuclear@2 519 # define PNG_NO_READ_sCAL
nuclear@2 520 # define PNG_NO_WRITE_sCAL
nuclear@2 521 # define PNG_NO_READ_sPLT
nuclear@2 522 # define PNG_NO_WRITE_sPLT
nuclear@2 523 # define PNG_NO_INFO_IMAGE
nuclear@2 524 # define PNG_NO_READ_RGB_TO_GRAY
nuclear@2 525 # define PNG_NO_READ_USER_TRANSFORM
nuclear@2 526 # define PNG_NO_WRITE_USER_TRANSFORM
nuclear@2 527 # define PNG_NO_USER_MEM
nuclear@2 528 # define PNG_NO_READ_EMPTY_PLTE
nuclear@2 529 # define PNG_NO_MNG_FEATURES
nuclear@2 530 # define PNG_NO_FIXED_POINT_SUPPORTED
nuclear@2 531 #endif
nuclear@2 532
nuclear@2 533 /* Ignore attempt to turn off both floating and fixed point support */
nuclear@2 534 #if !defined(PNG_FLOATING_POINT_SUPPORTED) || \
nuclear@2 535 !defined(PNG_NO_FIXED_POINT_SUPPORTED)
nuclear@2 536 # define PNG_FIXED_POINT_SUPPORTED
nuclear@2 537 #endif
nuclear@2 538
nuclear@2 539 #ifndef PNG_NO_FREE_ME
nuclear@2 540 # define PNG_FREE_ME_SUPPORTED
nuclear@2 541 #endif
nuclear@2 542
nuclear@2 543 #if defined(PNG_READ_SUPPORTED)
nuclear@2 544
nuclear@2 545 #if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \
nuclear@2 546 !defined(PNG_NO_READ_TRANSFORMS)
nuclear@2 547 # define PNG_READ_TRANSFORMS_SUPPORTED
nuclear@2 548 #endif
nuclear@2 549
nuclear@2 550 #ifdef PNG_READ_TRANSFORMS_SUPPORTED
nuclear@2 551 # ifndef PNG_NO_READ_EXPAND
nuclear@2 552 # define PNG_READ_EXPAND_SUPPORTED
nuclear@2 553 # endif
nuclear@2 554 # ifndef PNG_NO_READ_SHIFT
nuclear@2 555 # define PNG_READ_SHIFT_SUPPORTED
nuclear@2 556 # endif
nuclear@2 557 # ifndef PNG_NO_READ_PACK
nuclear@2 558 # define PNG_READ_PACK_SUPPORTED
nuclear@2 559 # endif
nuclear@2 560 # ifndef PNG_NO_READ_BGR
nuclear@2 561 # define PNG_READ_BGR_SUPPORTED
nuclear@2 562 # endif
nuclear@2 563 # ifndef PNG_NO_READ_SWAP
nuclear@2 564 # define PNG_READ_SWAP_SUPPORTED
nuclear@2 565 # endif
nuclear@2 566 # ifndef PNG_NO_READ_PACKSWAP
nuclear@2 567 # define PNG_READ_PACKSWAP_SUPPORTED
nuclear@2 568 # endif
nuclear@2 569 # ifndef PNG_NO_READ_INVERT
nuclear@2 570 # define PNG_READ_INVERT_SUPPORTED
nuclear@2 571 # endif
nuclear@2 572 # ifndef PNG_NO_READ_DITHER
nuclear@2 573 # define PNG_READ_DITHER_SUPPORTED
nuclear@2 574 # endif
nuclear@2 575 # ifndef PNG_NO_READ_BACKGROUND
nuclear@2 576 # define PNG_READ_BACKGROUND_SUPPORTED
nuclear@2 577 # endif
nuclear@2 578 # ifndef PNG_NO_READ_16_TO_8
nuclear@2 579 # define PNG_READ_16_TO_8_SUPPORTED
nuclear@2 580 # endif
nuclear@2 581 # ifndef PNG_NO_READ_FILLER
nuclear@2 582 # define PNG_READ_FILLER_SUPPORTED
nuclear@2 583 # endif
nuclear@2 584 # ifndef PNG_NO_READ_GAMMA
nuclear@2 585 # define PNG_READ_GAMMA_SUPPORTED
nuclear@2 586 # endif
nuclear@2 587 # ifndef PNG_NO_READ_GRAY_TO_RGB
nuclear@2 588 # define PNG_READ_GRAY_TO_RGB_SUPPORTED
nuclear@2 589 # endif
nuclear@2 590 # ifndef PNG_NO_READ_SWAP_ALPHA
nuclear@2 591 # define PNG_READ_SWAP_ALPHA_SUPPORTED
nuclear@2 592 # endif
nuclear@2 593 # ifndef PNG_NO_READ_INVERT_ALPHA
nuclear@2 594 # define PNG_READ_INVERT_ALPHA_SUPPORTED
nuclear@2 595 # endif
nuclear@2 596 # ifndef PNG_NO_READ_STRIP_ALPHA
nuclear@2 597 # define PNG_READ_STRIP_ALPHA_SUPPORTED
nuclear@2 598 # endif
nuclear@2 599 # ifndef PNG_NO_READ_USER_TRANSFORM
nuclear@2 600 # define PNG_READ_USER_TRANSFORM_SUPPORTED
nuclear@2 601 # endif
nuclear@2 602 # ifndef PNG_NO_READ_RGB_TO_GRAY
nuclear@2 603 # define PNG_READ_RGB_TO_GRAY_SUPPORTED
nuclear@2 604 # endif
nuclear@2 605 #endif /* PNG_READ_TRANSFORMS_SUPPORTED */
nuclear@2 606
nuclear@2 607 #if !defined(PNG_NO_PROGRESSIVE_READ) && \
nuclear@2 608 !defined(PNG_PROGRESSIVE_READ_SUPPORTED) /* if you don't do progressive */
nuclear@2 609 # define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */
nuclear@2 610 #endif /* about interlacing capability! You'll */
nuclear@2 611 /* still have interlacing unless you change the following line: */
nuclear@2 612
nuclear@2 613 #define PNG_READ_INTERLACING_SUPPORTED /* required in PNG-compliant decoders */
nuclear@2 614
nuclear@2 615 #ifndef PNG_NO_READ_COMPOSITE_NODIV
nuclear@2 616 # ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */
nuclear@2 617 # define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */
nuclear@2 618 # endif
nuclear@2 619 #endif
nuclear@2 620
nuclear@2 621 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
nuclear@2 622 /* Deprecated, will be removed from version 2.0.0.
nuclear@2 623 Use PNG_MNG_FEATURES_SUPPORTED instead. */
nuclear@2 624 #ifndef PNG_NO_READ_EMPTY_PLTE
nuclear@2 625 # define PNG_READ_EMPTY_PLTE_SUPPORTED
nuclear@2 626 #endif
nuclear@2 627 #endif
nuclear@2 628
nuclear@2 629 #endif /* PNG_READ_SUPPORTED */
nuclear@2 630
nuclear@2 631 #if defined(PNG_WRITE_SUPPORTED)
nuclear@2 632
nuclear@2 633 # if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \
nuclear@2 634 !defined(PNG_NO_WRITE_TRANSFORMS)
nuclear@2 635 # define PNG_WRITE_TRANSFORMS_SUPPORTED
nuclear@2 636 #endif
nuclear@2 637
nuclear@2 638 #ifdef PNG_WRITE_TRANSFORMS_SUPPORTED
nuclear@2 639 # ifndef PNG_NO_WRITE_SHIFT
nuclear@2 640 # define PNG_WRITE_SHIFT_SUPPORTED
nuclear@2 641 # endif
nuclear@2 642 # ifndef PNG_NO_WRITE_PACK
nuclear@2 643 # define PNG_WRITE_PACK_SUPPORTED
nuclear@2 644 # endif
nuclear@2 645 # ifndef PNG_NO_WRITE_BGR
nuclear@2 646 # define PNG_WRITE_BGR_SUPPORTED
nuclear@2 647 # endif
nuclear@2 648 # ifndef PNG_NO_WRITE_SWAP
nuclear@2 649 # define PNG_WRITE_SWAP_SUPPORTED
nuclear@2 650 # endif
nuclear@2 651 # ifndef PNG_NO_WRITE_PACKSWAP
nuclear@2 652 # define PNG_WRITE_PACKSWAP_SUPPORTED
nuclear@2 653 # endif
nuclear@2 654 # ifndef PNG_NO_WRITE_INVERT
nuclear@2 655 # define PNG_WRITE_INVERT_SUPPORTED
nuclear@2 656 # endif
nuclear@2 657 # ifndef PNG_NO_WRITE_FILLER
nuclear@2 658 # define PNG_WRITE_FILLER_SUPPORTED /* same as WRITE_STRIP_ALPHA */
nuclear@2 659 # endif
nuclear@2 660 # ifndef PNG_NO_WRITE_SWAP_ALPHA
nuclear@2 661 # define PNG_WRITE_SWAP_ALPHA_SUPPORTED
nuclear@2 662 # endif
nuclear@2 663 # ifndef PNG_NO_WRITE_INVERT_ALPHA
nuclear@2 664 # define PNG_WRITE_INVERT_ALPHA_SUPPORTED
nuclear@2 665 # endif
nuclear@2 666 # ifndef PNG_NO_WRITE_USER_TRANSFORM
nuclear@2 667 # define PNG_WRITE_USER_TRANSFORM_SUPPORTED
nuclear@2 668 # endif
nuclear@2 669 #endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */
nuclear@2 670
nuclear@2 671 #if !defined(PNG_NO_WRITE_INTERLACING_SUPPORTED) && \
nuclear@2 672 !defined(PNG_WRITE_INTERLACING_SUPPORTED)
nuclear@2 673 #define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant
nuclear@2 674 encoders, but can cause trouble
nuclear@2 675 if left undefined */
nuclear@2 676 #endif
nuclear@2 677
nuclear@2 678 #if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \
nuclear@2 679 !defined(PNG_WRITE_WEIGHTED_FILTER) && \
nuclear@2 680 defined(PNG_FLOATING_POINT_SUPPORTED)
nuclear@2 681 # define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
nuclear@2 682 #endif
nuclear@2 683
nuclear@2 684 #ifndef PNG_NO_WRITE_FLUSH
nuclear@2 685 # define PNG_WRITE_FLUSH_SUPPORTED
nuclear@2 686 #endif
nuclear@2 687
nuclear@2 688 #if defined(PNG_1_0_X) || defined (PNG_1_2_X)
nuclear@2 689 /* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */
nuclear@2 690 #ifndef PNG_NO_WRITE_EMPTY_PLTE
nuclear@2 691 # define PNG_WRITE_EMPTY_PLTE_SUPPORTED
nuclear@2 692 #endif
nuclear@2 693 #endif
nuclear@2 694
nuclear@2 695 #endif /* PNG_WRITE_SUPPORTED */
nuclear@2 696
nuclear@2 697 #ifndef PNG_1_0_X
nuclear@2 698 # ifndef PNG_NO_ERROR_NUMBERS
nuclear@2 699 # define PNG_ERROR_NUMBERS_SUPPORTED
nuclear@2 700 # endif
nuclear@2 701 #endif /* PNG_1_0_X */
nuclear@2 702
nuclear@2 703 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
nuclear@2 704 defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
nuclear@2 705 # ifndef PNG_NO_USER_TRANSFORM_PTR
nuclear@2 706 # define PNG_USER_TRANSFORM_PTR_SUPPORTED
nuclear@2 707 # endif
nuclear@2 708 #endif
nuclear@2 709
nuclear@2 710 #ifndef PNG_NO_STDIO
nuclear@2 711 # define PNG_TIME_RFC1123_SUPPORTED
nuclear@2 712 #endif
nuclear@2 713
nuclear@2 714 /* This adds extra functions in pngget.c for accessing data from the
nuclear@2 715 * info pointer (added in version 0.99)
nuclear@2 716 * png_get_image_width()
nuclear@2 717 * png_get_image_height()
nuclear@2 718 * png_get_bit_depth()
nuclear@2 719 * png_get_color_type()
nuclear@2 720 * png_get_compression_type()
nuclear@2 721 * png_get_filter_type()
nuclear@2 722 * png_get_interlace_type()
nuclear@2 723 * png_get_pixel_aspect_ratio()
nuclear@2 724 * png_get_pixels_per_meter()
nuclear@2 725 * png_get_x_offset_pixels()
nuclear@2 726 * png_get_y_offset_pixels()
nuclear@2 727 * png_get_x_offset_microns()
nuclear@2 728 * png_get_y_offset_microns()
nuclear@2 729 */
nuclear@2 730 #if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED)
nuclear@2 731 # define PNG_EASY_ACCESS_SUPPORTED
nuclear@2 732 #endif
nuclear@2 733
nuclear@2 734 /* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0
nuclear@2 735 * and removed from version 1.2.20. The following will be removed
nuclear@2 736 * from libpng-1.4.0
nuclear@2 737 */
nuclear@2 738
nuclear@2 739 #if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_OPTIMIZED_CODE)
nuclear@2 740 # ifndef PNG_OPTIMIZED_CODE_SUPPORTED
nuclear@2 741 # define PNG_OPTIMIZED_CODE_SUPPORTED
nuclear@2 742 # endif
nuclear@2 743 #endif
nuclear@2 744
nuclear@2 745 #if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE)
nuclear@2 746 # ifndef PNG_ASSEMBLER_CODE_SUPPORTED
nuclear@2 747 # define PNG_ASSEMBLER_CODE_SUPPORTED
nuclear@2 748 # endif
nuclear@2 749
nuclear@2 750 # if defined(__GNUC__) && defined(__x86_64__) && (__GNUC__ < 4)
nuclear@2 751 /* work around 64-bit gcc compiler bugs in gcc-3.x */
nuclear@2 752 # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
nuclear@2 753 # define PNG_NO_MMX_CODE
nuclear@2 754 # endif
nuclear@2 755 # endif
nuclear@2 756
nuclear@2 757 # if defined(__APPLE__)
nuclear@2 758 # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
nuclear@2 759 # define PNG_NO_MMX_CODE
nuclear@2 760 # endif
nuclear@2 761 # endif
nuclear@2 762
nuclear@2 763 # if (defined(__MWERKS__) && ((__MWERKS__ < 0x0900) || macintosh))
nuclear@2 764 # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
nuclear@2 765 # define PNG_NO_MMX_CODE
nuclear@2 766 # endif
nuclear@2 767 # endif
nuclear@2 768
nuclear@2 769 # if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
nuclear@2 770 # define PNG_MMX_CODE_SUPPORTED
nuclear@2 771 # endif
nuclear@2 772
nuclear@2 773 #endif
nuclear@2 774 /* end of obsolete code to be removed from libpng-1.4.0 */
nuclear@2 775
nuclear@2 776 #if !defined(PNG_1_0_X)
nuclear@2 777 #if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED)
nuclear@2 778 # define PNG_USER_MEM_SUPPORTED
nuclear@2 779 #endif
nuclear@2 780 #endif /* PNG_1_0_X */
nuclear@2 781
nuclear@2 782 /* Added at libpng-1.2.6 */
nuclear@2 783 #if !defined(PNG_1_0_X)
nuclear@2 784 #ifndef PNG_SET_USER_LIMITS_SUPPORTED
nuclear@2 785 #if !defined(PNG_NO_SET_USER_LIMITS) && !defined(PNG_SET_USER_LIMITS_SUPPORTED)
nuclear@2 786 # define PNG_SET_USER_LIMITS_SUPPORTED
nuclear@2 787 #endif
nuclear@2 788 #endif
nuclear@2 789 #endif /* PNG_1_0_X */
nuclear@2 790
nuclear@2 791 /* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGS no matter
nuclear@2 792 * how large, set these limits to 0x7fffffffL
nuclear@2 793 */
nuclear@2 794 #ifndef PNG_USER_WIDTH_MAX
nuclear@2 795 # define PNG_USER_WIDTH_MAX 1000000L
nuclear@2 796 #endif
nuclear@2 797 #ifndef PNG_USER_HEIGHT_MAX
nuclear@2 798 # define PNG_USER_HEIGHT_MAX 1000000L
nuclear@2 799 #endif
nuclear@2 800
nuclear@2 801 /* These are currently experimental features, define them if you want */
nuclear@2 802
nuclear@2 803 /* very little testing */
nuclear@2 804 /*
nuclear@2 805 #ifdef PNG_READ_SUPPORTED
nuclear@2 806 # ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
nuclear@2 807 # define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
nuclear@2 808 # endif
nuclear@2 809 #endif
nuclear@2 810 */
nuclear@2 811
nuclear@2 812 /* This is only for PowerPC big-endian and 680x0 systems */
nuclear@2 813 /* some testing */
nuclear@2 814 /*
nuclear@2 815 #ifndef PNG_READ_BIG_ENDIAN_SUPPORTED
nuclear@2 816 # define PNG_READ_BIG_ENDIAN_SUPPORTED
nuclear@2 817 #endif
nuclear@2 818 */
nuclear@2 819
nuclear@2 820 /* Buggy compilers (e.g., gcc 2.7.2.2) need this */
nuclear@2 821 /*
nuclear@2 822 #define PNG_NO_POINTER_INDEXING
nuclear@2 823 */
nuclear@2 824
nuclear@2 825 /* These functions are turned off by default, as they will be phased out. */
nuclear@2 826 /*
nuclear@2 827 #define PNG_USELESS_TESTS_SUPPORTED
nuclear@2 828 #define PNG_CORRECT_PALETTE_SUPPORTED
nuclear@2 829 */
nuclear@2 830
nuclear@2 831 /* Any chunks you are not interested in, you can undef here. The
nuclear@2 832 * ones that allocate memory may be expecially important (hIST,
nuclear@2 833 * tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info
nuclear@2 834 * a bit smaller.
nuclear@2 835 */
nuclear@2 836
nuclear@2 837 #if defined(PNG_READ_SUPPORTED) && \
nuclear@2 838 !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
nuclear@2 839 !defined(PNG_NO_READ_ANCILLARY_CHUNKS)
nuclear@2 840 # define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
nuclear@2 841 #endif
nuclear@2 842
nuclear@2 843 #if defined(PNG_WRITE_SUPPORTED) && \
nuclear@2 844 !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
nuclear@2 845 !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS)
nuclear@2 846 # define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
nuclear@2 847 #endif
nuclear@2 848
nuclear@2 849 #ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
nuclear@2 850
nuclear@2 851 #ifdef PNG_NO_READ_TEXT
nuclear@2 852 # define PNG_NO_READ_iTXt
nuclear@2 853 # define PNG_NO_READ_tEXt
nuclear@2 854 # define PNG_NO_READ_zTXt
nuclear@2 855 #endif
nuclear@2 856 #ifndef PNG_NO_READ_bKGD
nuclear@2 857 # define PNG_READ_bKGD_SUPPORTED
nuclear@2 858 # define PNG_bKGD_SUPPORTED
nuclear@2 859 #endif
nuclear@2 860 #ifndef PNG_NO_READ_cHRM
nuclear@2 861 # define PNG_READ_cHRM_SUPPORTED
nuclear@2 862 # define PNG_cHRM_SUPPORTED
nuclear@2 863 #endif
nuclear@2 864 #ifndef PNG_NO_READ_gAMA
nuclear@2 865 # define PNG_READ_gAMA_SUPPORTED
nuclear@2 866 # define PNG_gAMA_SUPPORTED
nuclear@2 867 #endif
nuclear@2 868 #ifndef PNG_NO_READ_hIST
nuclear@2 869 # define PNG_READ_hIST_SUPPORTED
nuclear@2 870 # define PNG_hIST_SUPPORTED
nuclear@2 871 #endif
nuclear@2 872 #ifndef PNG_NO_READ_iCCP
nuclear@2 873 # define PNG_READ_iCCP_SUPPORTED
nuclear@2 874 # define PNG_iCCP_SUPPORTED
nuclear@2 875 #endif
nuclear@2 876 #ifndef PNG_NO_READ_iTXt
nuclear@2 877 # ifndef PNG_READ_iTXt_SUPPORTED
nuclear@2 878 # define PNG_READ_iTXt_SUPPORTED
nuclear@2 879 # endif
nuclear@2 880 # ifndef PNG_iTXt_SUPPORTED
nuclear@2 881 # define PNG_iTXt_SUPPORTED
nuclear@2 882 # endif
nuclear@2 883 #endif
nuclear@2 884 #ifndef PNG_NO_READ_oFFs
nuclear@2 885 # define PNG_READ_oFFs_SUPPORTED
nuclear@2 886 # define PNG_oFFs_SUPPORTED
nuclear@2 887 #endif
nuclear@2 888 #ifndef PNG_NO_READ_pCAL
nuclear@2 889 # define PNG_READ_pCAL_SUPPORTED
nuclear@2 890 # define PNG_pCAL_SUPPORTED
nuclear@2 891 #endif
nuclear@2 892 #ifndef PNG_NO_READ_sCAL
nuclear@2 893 # define PNG_READ_sCAL_SUPPORTED
nuclear@2 894 # define PNG_sCAL_SUPPORTED
nuclear@2 895 #endif
nuclear@2 896 #ifndef PNG_NO_READ_pHYs
nuclear@2 897 # define PNG_READ_pHYs_SUPPORTED
nuclear@2 898 # define PNG_pHYs_SUPPORTED
nuclear@2 899 #endif
nuclear@2 900 #ifndef PNG_NO_READ_sBIT
nuclear@2 901 # define PNG_READ_sBIT_SUPPORTED
nuclear@2 902 # define PNG_sBIT_SUPPORTED
nuclear@2 903 #endif
nuclear@2 904 #ifndef PNG_NO_READ_sPLT
nuclear@2 905 # define PNG_READ_sPLT_SUPPORTED
nuclear@2 906 # define PNG_sPLT_SUPPORTED
nuclear@2 907 #endif
nuclear@2 908 #ifndef PNG_NO_READ_sRGB
nuclear@2 909 # define PNG_READ_sRGB_SUPPORTED
nuclear@2 910 # define PNG_sRGB_SUPPORTED
nuclear@2 911 #endif
nuclear@2 912 #ifndef PNG_NO_READ_tEXt
nuclear@2 913 # define PNG_READ_tEXt_SUPPORTED
nuclear@2 914 # define PNG_tEXt_SUPPORTED
nuclear@2 915 #endif
nuclear@2 916 #ifndef PNG_NO_READ_tIME
nuclear@2 917 # define PNG_READ_tIME_SUPPORTED
nuclear@2 918 # define PNG_tIME_SUPPORTED
nuclear@2 919 #endif
nuclear@2 920 #ifndef PNG_NO_READ_tRNS
nuclear@2 921 # define PNG_READ_tRNS_SUPPORTED
nuclear@2 922 # define PNG_tRNS_SUPPORTED
nuclear@2 923 #endif
nuclear@2 924 #ifndef PNG_NO_READ_zTXt
nuclear@2 925 # define PNG_READ_zTXt_SUPPORTED
nuclear@2 926 # define PNG_zTXt_SUPPORTED
nuclear@2 927 #endif
nuclear@2 928 #ifndef PNG_NO_READ_UNKNOWN_CHUNKS
nuclear@2 929 # define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
nuclear@2 930 # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED
nuclear@2 931 # define PNG_UNKNOWN_CHUNKS_SUPPORTED
nuclear@2 932 # endif
nuclear@2 933 # ifndef PNG_NO_HANDLE_AS_UNKNOWN
nuclear@2 934 # define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
nuclear@2 935 # endif
nuclear@2 936 #endif
nuclear@2 937 #if !defined(PNG_NO_READ_USER_CHUNKS) && \
nuclear@2 938 defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
nuclear@2 939 # define PNG_READ_USER_CHUNKS_SUPPORTED
nuclear@2 940 # define PNG_USER_CHUNKS_SUPPORTED
nuclear@2 941 # ifdef PNG_NO_READ_UNKNOWN_CHUNKS
nuclear@2 942 # undef PNG_NO_READ_UNKNOWN_CHUNKS
nuclear@2 943 # endif
nuclear@2 944 # ifdef PNG_NO_HANDLE_AS_UNKNOWN
nuclear@2 945 # undef PNG_NO_HANDLE_AS_UNKNOWN
nuclear@2 946 # endif
nuclear@2 947 #endif
nuclear@2 948 #ifndef PNG_NO_READ_OPT_PLTE
nuclear@2 949 # define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */
nuclear@2 950 #endif /* optional PLTE chunk in RGB and RGBA images */
nuclear@2 951 #if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \
nuclear@2 952 defined(PNG_READ_zTXt_SUPPORTED)
nuclear@2 953 # define PNG_READ_TEXT_SUPPORTED
nuclear@2 954 # define PNG_TEXT_SUPPORTED
nuclear@2 955 #endif
nuclear@2 956
nuclear@2 957 #endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */
nuclear@2 958
nuclear@2 959 #ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
nuclear@2 960
nuclear@2 961 #ifdef PNG_NO_WRITE_TEXT
nuclear@2 962 # define PNG_NO_WRITE_iTXt
nuclear@2 963 # define PNG_NO_WRITE_tEXt
nuclear@2 964 # define PNG_NO_WRITE_zTXt
nuclear@2 965 #endif
nuclear@2 966 #ifndef PNG_NO_WRITE_bKGD
nuclear@2 967 # define PNG_WRITE_bKGD_SUPPORTED
nuclear@2 968 # ifndef PNG_bKGD_SUPPORTED
nuclear@2 969 # define PNG_bKGD_SUPPORTED
nuclear@2 970 # endif
nuclear@2 971 #endif
nuclear@2 972 #ifndef PNG_NO_WRITE_cHRM
nuclear@2 973 # define PNG_WRITE_cHRM_SUPPORTED
nuclear@2 974 # ifndef PNG_cHRM_SUPPORTED
nuclear@2 975 # define PNG_cHRM_SUPPORTED
nuclear@2 976 # endif
nuclear@2 977 #endif
nuclear@2 978 #ifndef PNG_NO_WRITE_gAMA
nuclear@2 979 # define PNG_WRITE_gAMA_SUPPORTED
nuclear@2 980 # ifndef PNG_gAMA_SUPPORTED
nuclear@2 981 # define PNG_gAMA_SUPPORTED
nuclear@2 982 # endif
nuclear@2 983 #endif
nuclear@2 984 #ifndef PNG_NO_WRITE_hIST
nuclear@2 985 # define PNG_WRITE_hIST_SUPPORTED
nuclear@2 986 # ifndef PNG_hIST_SUPPORTED
nuclear@2 987 # define PNG_hIST_SUPPORTED
nuclear@2 988 # endif
nuclear@2 989 #endif
nuclear@2 990 #ifndef PNG_NO_WRITE_iCCP
nuclear@2 991 # define PNG_WRITE_iCCP_SUPPORTED
nuclear@2 992 # ifndef PNG_iCCP_SUPPORTED
nuclear@2 993 # define PNG_iCCP_SUPPORTED
nuclear@2 994 # endif
nuclear@2 995 #endif
nuclear@2 996 #ifndef PNG_NO_WRITE_iTXt
nuclear@2 997 # ifndef PNG_WRITE_iTXt_SUPPORTED
nuclear@2 998 # define PNG_WRITE_iTXt_SUPPORTED
nuclear@2 999 # endif
nuclear@2 1000 # ifndef PNG_iTXt_SUPPORTED
nuclear@2 1001 # define PNG_iTXt_SUPPORTED
nuclear@2 1002 # endif
nuclear@2 1003 #endif
nuclear@2 1004 #ifndef PNG_NO_WRITE_oFFs
nuclear@2 1005 # define PNG_WRITE_oFFs_SUPPORTED
nuclear@2 1006 # ifndef PNG_oFFs_SUPPORTED
nuclear@2 1007 # define PNG_oFFs_SUPPORTED
nuclear@2 1008 # endif
nuclear@2 1009 #endif
nuclear@2 1010 #ifndef PNG_NO_WRITE_pCAL
nuclear@2 1011 # define PNG_WRITE_pCAL_SUPPORTED
nuclear@2 1012 # ifndef PNG_pCAL_SUPPORTED
nuclear@2 1013 # define PNG_pCAL_SUPPORTED
nuclear@2 1014 # endif
nuclear@2 1015 #endif
nuclear@2 1016 #ifndef PNG_NO_WRITE_sCAL
nuclear@2 1017 # define PNG_WRITE_sCAL_SUPPORTED
nuclear@2 1018 # ifndef PNG_sCAL_SUPPORTED
nuclear@2 1019 # define PNG_sCAL_SUPPORTED
nuclear@2 1020 # endif
nuclear@2 1021 #endif
nuclear@2 1022 #ifndef PNG_NO_WRITE_pHYs
nuclear@2 1023 # define PNG_WRITE_pHYs_SUPPORTED
nuclear@2 1024 # ifndef PNG_pHYs_SUPPORTED
nuclear@2 1025 # define PNG_pHYs_SUPPORTED
nuclear@2 1026 # endif
nuclear@2 1027 #endif
nuclear@2 1028 #ifndef PNG_NO_WRITE_sBIT
nuclear@2 1029 # define PNG_WRITE_sBIT_SUPPORTED
nuclear@2 1030 # ifndef PNG_sBIT_SUPPORTED
nuclear@2 1031 # define PNG_sBIT_SUPPORTED
nuclear@2 1032 # endif
nuclear@2 1033 #endif
nuclear@2 1034 #ifndef PNG_NO_WRITE_sPLT
nuclear@2 1035 # define PNG_WRITE_sPLT_SUPPORTED
nuclear@2 1036 # ifndef PNG_sPLT_SUPPORTED
nuclear@2 1037 # define PNG_sPLT_SUPPORTED
nuclear@2 1038 # endif
nuclear@2 1039 #endif
nuclear@2 1040 #ifndef PNG_NO_WRITE_sRGB
nuclear@2 1041 # define PNG_WRITE_sRGB_SUPPORTED
nuclear@2 1042 # ifndef PNG_sRGB_SUPPORTED
nuclear@2 1043 # define PNG_sRGB_SUPPORTED
nuclear@2 1044 # endif
nuclear@2 1045 #endif
nuclear@2 1046 #ifndef PNG_NO_WRITE_tEXt
nuclear@2 1047 # define PNG_WRITE_tEXt_SUPPORTED
nuclear@2 1048 # ifndef PNG_tEXt_SUPPORTED
nuclear@2 1049 # define PNG_tEXt_SUPPORTED
nuclear@2 1050 # endif
nuclear@2 1051 #endif
nuclear@2 1052 #ifndef PNG_NO_WRITE_tIME
nuclear@2 1053 # define PNG_WRITE_tIME_SUPPORTED
nuclear@2 1054 # ifndef PNG_tIME_SUPPORTED
nuclear@2 1055 # define PNG_tIME_SUPPORTED
nuclear@2 1056 # endif
nuclear@2 1057 #endif
nuclear@2 1058 #ifndef PNG_NO_WRITE_tRNS
nuclear@2 1059 # define PNG_WRITE_tRNS_SUPPORTED
nuclear@2 1060 # ifndef PNG_tRNS_SUPPORTED
nuclear@2 1061 # define PNG_tRNS_SUPPORTED
nuclear@2 1062 # endif
nuclear@2 1063 #endif
nuclear@2 1064 #ifndef PNG_NO_WRITE_zTXt
nuclear@2 1065 # define PNG_WRITE_zTXt_SUPPORTED
nuclear@2 1066 # ifndef PNG_zTXt_SUPPORTED
nuclear@2 1067 # define PNG_zTXt_SUPPORTED
nuclear@2 1068 # endif
nuclear@2 1069 #endif
nuclear@2 1070 #ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS
nuclear@2 1071 # define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
nuclear@2 1072 # ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED
nuclear@2 1073 # define PNG_UNKNOWN_CHUNKS_SUPPORTED
nuclear@2 1074 # endif
nuclear@2 1075 # ifndef PNG_NO_HANDLE_AS_UNKNOWN
nuclear@2 1076 # ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
nuclear@2 1077 # define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
nuclear@2 1078 # endif
nuclear@2 1079 # endif
nuclear@2 1080 #endif
nuclear@2 1081 #if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \
nuclear@2 1082 defined(PNG_WRITE_zTXt_SUPPORTED)
nuclear@2 1083 # define PNG_WRITE_TEXT_SUPPORTED
nuclear@2 1084 # ifndef PNG_TEXT_SUPPORTED
nuclear@2 1085 # define PNG_TEXT_SUPPORTED
nuclear@2 1086 # endif
nuclear@2 1087 #endif
nuclear@2 1088
nuclear@2 1089 #endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */
nuclear@2 1090
nuclear@2 1091 /* Turn this off to disable png_read_png() and
nuclear@2 1092 * png_write_png() and leave the row_pointers member
nuclear@2 1093 * out of the info structure.
nuclear@2 1094 */
nuclear@2 1095 #ifndef PNG_NO_INFO_IMAGE
nuclear@2 1096 # define PNG_INFO_IMAGE_SUPPORTED
nuclear@2 1097 #endif
nuclear@2 1098
nuclear@2 1099 /* need the time information for reading tIME chunks */
nuclear@2 1100 #if defined(PNG_tIME_SUPPORTED)
nuclear@2 1101 # if !defined(_WIN32_WCE)
nuclear@2 1102 /* "time.h" functions are not supported on WindowsCE */
nuclear@2 1103 # include <time.h>
nuclear@2 1104 # endif
nuclear@2 1105 #endif
nuclear@2 1106
nuclear@2 1107 /* Some typedefs to get us started. These should be safe on most of the
nuclear@2 1108 * common platforms. The typedefs should be at least as large as the
nuclear@2 1109 * numbers suggest (a png_uint_32 must be at least 32 bits long), but they
nuclear@2 1110 * don't have to be exactly that size. Some compilers dislike passing
nuclear@2 1111 * unsigned shorts as function parameters, so you may be better off using
nuclear@2 1112 * unsigned int for png_uint_16. Likewise, for 64-bit systems, you may
nuclear@2 1113 * want to have unsigned int for png_uint_32 instead of unsigned long.
nuclear@2 1114 */
nuclear@2 1115
nuclear@2 1116 typedef unsigned long png_uint_32;
nuclear@2 1117 typedef long png_int_32;
nuclear@2 1118 typedef unsigned short png_uint_16;
nuclear@2 1119 typedef short png_int_16;
nuclear@2 1120 typedef unsigned char png_byte;
nuclear@2 1121
nuclear@2 1122 /* This is usually size_t. It is typedef'ed just in case you need it to
nuclear@2 1123 change (I'm not sure if you will or not, so I thought I'd be safe) */
nuclear@2 1124 #ifdef PNG_SIZE_T
nuclear@2 1125 typedef PNG_SIZE_T png_size_t;
nuclear@2 1126 # define png_sizeof(x) png_convert_size(sizeof(x))
nuclear@2 1127 #else
nuclear@2 1128 typedef size_t png_size_t;
nuclear@2 1129 # define png_sizeof(x) sizeof(x)
nuclear@2 1130 #endif
nuclear@2 1131
nuclear@2 1132 /* The following is needed for medium model support. It cannot be in the
nuclear@2 1133 * PNG_INTERNAL section. Needs modification for other compilers besides
nuclear@2 1134 * MSC. Model independent support declares all arrays and pointers to be
nuclear@2 1135 * large using the far keyword. The zlib version used must also support
nuclear@2 1136 * model independent data. As of version zlib 1.0.4, the necessary changes
nuclear@2 1137 * have been made in zlib. The USE_FAR_KEYWORD define triggers other
nuclear@2 1138 * changes that are needed. (Tim Wegner)
nuclear@2 1139 */
nuclear@2 1140
nuclear@2 1141 /* Separate compiler dependencies (problem here is that zlib.h always
nuclear@2 1142 defines FAR. (SJT) */
nuclear@2 1143 #ifdef __BORLANDC__
nuclear@2 1144 # if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
nuclear@2 1145 # define LDATA 1
nuclear@2 1146 # else
nuclear@2 1147 # define LDATA 0
nuclear@2 1148 # endif
nuclear@2 1149 /* GRR: why is Cygwin in here? Cygwin is not Borland C... */
nuclear@2 1150 # if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__)
nuclear@2 1151 # define PNG_MAX_MALLOC_64K
nuclear@2 1152 # if (LDATA != 1)
nuclear@2 1153 # ifndef FAR
nuclear@2 1154 # define FAR __far
nuclear@2 1155 # endif
nuclear@2 1156 # define USE_FAR_KEYWORD
nuclear@2 1157 # endif /* LDATA != 1 */
nuclear@2 1158 /* Possibly useful for moving data out of default segment.
nuclear@2 1159 * Uncomment it if you want. Could also define FARDATA as
nuclear@2 1160 * const if your compiler supports it. (SJT)
nuclear@2 1161 # define FARDATA FAR
nuclear@2 1162 */
nuclear@2 1163 # endif /* __WIN32__, __FLAT__, __CYGWIN__ */
nuclear@2 1164 #endif /* __BORLANDC__ */
nuclear@2 1165
nuclear@2 1166
nuclear@2 1167 /* Suggest testing for specific compiler first before testing for
nuclear@2 1168 * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM,
nuclear@2 1169 * making reliance oncertain keywords suspect. (SJT)
nuclear@2 1170 */
nuclear@2 1171
nuclear@2 1172 /* MSC Medium model */
nuclear@2 1173 #if defined(FAR)
nuclear@2 1174 # if defined(M_I86MM)
nuclear@2 1175 # define USE_FAR_KEYWORD
nuclear@2 1176 # define FARDATA FAR
nuclear@2 1177 # include <dos.h>
nuclear@2 1178 # endif
nuclear@2 1179 #endif
nuclear@2 1180
nuclear@2 1181 /* SJT: default case */
nuclear@2 1182 #ifndef FAR
nuclear@2 1183 # define FAR
nuclear@2 1184 #endif
nuclear@2 1185
nuclear@2 1186 /* At this point FAR is always defined */
nuclear@2 1187 #ifndef FARDATA
nuclear@2 1188 # define FARDATA
nuclear@2 1189 #endif
nuclear@2 1190
nuclear@2 1191 /* Typedef for floating-point numbers that are converted
nuclear@2 1192 to fixed-point with a multiple of 100,000, e.g., int_gamma */
nuclear@2 1193 typedef png_int_32 png_fixed_point;
nuclear@2 1194
nuclear@2 1195 /* Add typedefs for pointers */
nuclear@2 1196 typedef void FAR * png_voidp;
nuclear@2 1197 typedef png_byte FAR * png_bytep;
nuclear@2 1198 typedef png_uint_32 FAR * png_uint_32p;
nuclear@2 1199 typedef png_int_32 FAR * png_int_32p;
nuclear@2 1200 typedef png_uint_16 FAR * png_uint_16p;
nuclear@2 1201 typedef png_int_16 FAR * png_int_16p;
nuclear@2 1202 typedef PNG_CONST char FAR * png_const_charp;
nuclear@2 1203 typedef char FAR * png_charp;
nuclear@2 1204 typedef png_fixed_point FAR * png_fixed_point_p;
nuclear@2 1205
nuclear@2 1206 #ifndef PNG_NO_STDIO
nuclear@2 1207 #if defined(_WIN32_WCE)
nuclear@2 1208 typedef HANDLE png_FILE_p;
nuclear@2 1209 #else
nuclear@2 1210 typedef FILE * png_FILE_p;
nuclear@2 1211 #endif
nuclear@2 1212 #endif
nuclear@2 1213
nuclear@2 1214 #ifdef PNG_FLOATING_POINT_SUPPORTED
nuclear@2 1215 typedef double FAR * png_doublep;
nuclear@2 1216 #endif
nuclear@2 1217
nuclear@2 1218 /* Pointers to pointers; i.e. arrays */
nuclear@2 1219 typedef png_byte FAR * FAR * png_bytepp;
nuclear@2 1220 typedef png_uint_32 FAR * FAR * png_uint_32pp;
nuclear@2 1221 typedef png_int_32 FAR * FAR * png_int_32pp;
nuclear@2 1222 typedef png_uint_16 FAR * FAR * png_uint_16pp;
nuclear@2 1223 typedef png_int_16 FAR * FAR * png_int_16pp;
nuclear@2 1224 typedef PNG_CONST char FAR * FAR * png_const_charpp;
nuclear@2 1225 typedef char FAR * FAR * png_charpp;
nuclear@2 1226 typedef png_fixed_point FAR * FAR * png_fixed_point_pp;
nuclear@2 1227 #ifdef PNG_FLOATING_POINT_SUPPORTED
nuclear@2 1228 typedef double FAR * FAR * png_doublepp;
nuclear@2 1229 #endif
nuclear@2 1230
nuclear@2 1231 /* Pointers to pointers to pointers; i.e., pointer to array */
nuclear@2 1232 typedef char FAR * FAR * FAR * png_charppp;
nuclear@2 1233
nuclear@2 1234 #if defined(PNG_1_0_X) || defined(PNG_1_2_X)
nuclear@2 1235 /* SPC - Is this stuff deprecated? */
nuclear@2 1236 /* It'll be removed as of libpng-1.3.0 - GR-P */
nuclear@2 1237 /* libpng typedefs for types in zlib. If zlib changes
nuclear@2 1238 * or another compression library is used, then change these.
nuclear@2 1239 * Eliminates need to change all the source files.
nuclear@2 1240 */
nuclear@2 1241 typedef charf * png_zcharp;
nuclear@2 1242 typedef charf * FAR * png_zcharpp;
nuclear@2 1243 typedef z_stream FAR * png_zstreamp;
nuclear@2 1244 #endif /* (PNG_1_0_X) || defined(PNG_1_2_X) */
nuclear@2 1245
nuclear@2 1246 /*
nuclear@2 1247 * Define PNG_BUILD_DLL if the module being built is a Windows
nuclear@2 1248 * LIBPNG DLL.
nuclear@2 1249 *
nuclear@2 1250 * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL.
nuclear@2 1251 * It is equivalent to Microsoft predefined macro _DLL that is
nuclear@2 1252 * automatically defined when you compile using the share
nuclear@2 1253 * version of the CRT (C Run-Time library)
nuclear@2 1254 *
nuclear@2 1255 * The cygwin mods make this behavior a little different:
nuclear@2 1256 * Define PNG_BUILD_DLL if you are building a dll for use with cygwin
nuclear@2 1257 * Define PNG_STATIC if you are building a static library for use with cygwin,
nuclear@2 1258 * -or- if you are building an application that you want to link to the
nuclear@2 1259 * static library.
nuclear@2 1260 * PNG_USE_DLL is defined by default (no user action needed) unless one of
nuclear@2 1261 * the other flags is defined.
nuclear@2 1262 */
nuclear@2 1263
nuclear@2 1264 #if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL))
nuclear@2 1265 # define PNG_DLL
nuclear@2 1266 #endif
nuclear@2 1267 /* If CYGWIN, then disallow GLOBAL ARRAYS unless building a static lib.
nuclear@2 1268 * When building a static lib, default to no GLOBAL ARRAYS, but allow
nuclear@2 1269 * command-line override
nuclear@2 1270 */
nuclear@2 1271 #if defined(__CYGWIN__)
nuclear@2 1272 # if !defined(PNG_STATIC)
nuclear@2 1273 # if defined(PNG_USE_GLOBAL_ARRAYS)
nuclear@2 1274 # undef PNG_USE_GLOBAL_ARRAYS
nuclear@2 1275 # endif
nuclear@2 1276 # if !defined(PNG_USE_LOCAL_ARRAYS)
nuclear@2 1277 # define PNG_USE_LOCAL_ARRAYS
nuclear@2 1278 # endif
nuclear@2 1279 # else
nuclear@2 1280 # if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS)
nuclear@2 1281 # if defined(PNG_USE_GLOBAL_ARRAYS)
nuclear@2 1282 # undef PNG_USE_GLOBAL_ARRAYS
nuclear@2 1283 # endif
nuclear@2 1284 # endif
nuclear@2 1285 # endif
nuclear@2 1286 # if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS)
nuclear@2 1287 # define PNG_USE_LOCAL_ARRAYS
nuclear@2 1288 # endif
nuclear@2 1289 #endif
nuclear@2 1290
nuclear@2 1291 /* Do not use global arrays (helps with building DLL's)
nuclear@2 1292 * They are no longer used in libpng itself, since version 1.0.5c,
nuclear@2 1293 * but might be required for some pre-1.0.5c applications.
nuclear@2 1294 */
nuclear@2 1295 #if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS)
nuclear@2 1296 # if defined(PNG_NO_GLOBAL_ARRAYS) || \
nuclear@2 1297 (defined(__GNUC__) && defined(PNG_DLL)) || defined(_MSC_VER)
nuclear@2 1298 # define PNG_USE_LOCAL_ARRAYS
nuclear@2 1299 # else
nuclear@2 1300 # define PNG_USE_GLOBAL_ARRAYS
nuclear@2 1301 # endif
nuclear@2 1302 #endif
nuclear@2 1303
nuclear@2 1304 #if defined(__CYGWIN__)
nuclear@2 1305 # undef PNGAPI
nuclear@2 1306 # define PNGAPI __cdecl
nuclear@2 1307 # undef PNG_IMPEXP
nuclear@2 1308 # define PNG_IMPEXP
nuclear@2 1309 #endif
nuclear@2 1310
nuclear@2 1311 /* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall",
nuclear@2 1312 * you may get warnings regarding the linkage of png_zalloc and png_zfree.
nuclear@2 1313 * Don't ignore those warnings; you must also reset the default calling
nuclear@2 1314 * convention in your compiler to match your PNGAPI, and you must build
nuclear@2 1315 * zlib and your applications the same way you build libpng.
nuclear@2 1316 */
nuclear@2 1317
nuclear@2 1318 #if defined(__MINGW32__) && !defined(PNG_MODULEDEF)
nuclear@2 1319 # ifndef PNG_NO_MODULEDEF
nuclear@2 1320 # define PNG_NO_MODULEDEF
nuclear@2 1321 # endif
nuclear@2 1322 #endif
nuclear@2 1323
nuclear@2 1324 #if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF)
nuclear@2 1325 # define PNG_IMPEXP
nuclear@2 1326 #endif
nuclear@2 1327
nuclear@2 1328 #if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \
nuclear@2 1329 (( defined(_Windows) || defined(_WINDOWS) || \
nuclear@2 1330 defined(WIN32) || defined(_WIN32) || defined(__WIN32__) ))
nuclear@2 1331
nuclear@2 1332 # ifndef PNGAPI
nuclear@2 1333 # if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
nuclear@2 1334 # define PNGAPI __cdecl
nuclear@2 1335 # else
nuclear@2 1336 # define PNGAPI _cdecl
nuclear@2 1337 # endif
nuclear@2 1338 # endif
nuclear@2 1339
nuclear@2 1340 # if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \
nuclear@2 1341 0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */)
nuclear@2 1342 # define PNG_IMPEXP
nuclear@2 1343 # endif
nuclear@2 1344
nuclear@2 1345 # if !defined(PNG_IMPEXP)
nuclear@2 1346
nuclear@2 1347 # define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol
nuclear@2 1348 # define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol
nuclear@2 1349
nuclear@2 1350 /* Borland/Microsoft */
nuclear@2 1351 # if defined(_MSC_VER) || defined(__BORLANDC__)
nuclear@2 1352 # if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500)
nuclear@2 1353 # define PNG_EXPORT PNG_EXPORT_TYPE1
nuclear@2 1354 # else
nuclear@2 1355 # define PNG_EXPORT PNG_EXPORT_TYPE2
nuclear@2 1356 # if defined(PNG_BUILD_DLL)
nuclear@2 1357 # define PNG_IMPEXP __export
nuclear@2 1358 # else
nuclear@2 1359 # define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in
nuclear@2 1360 VC++ */
nuclear@2 1361 # endif /* Exists in Borland C++ for
nuclear@2 1362 C++ classes (== huge) */
nuclear@2 1363 # endif
nuclear@2 1364 # endif
nuclear@2 1365
nuclear@2 1366 # if !defined(PNG_IMPEXP)
nuclear@2 1367 # if defined(PNG_BUILD_DLL)
nuclear@2 1368 # define PNG_IMPEXP __declspec(dllexport)
nuclear@2 1369 # else
nuclear@2 1370 # define PNG_IMPEXP __declspec(dllimport)
nuclear@2 1371 # endif
nuclear@2 1372 # endif
nuclear@2 1373 # endif /* PNG_IMPEXP */
nuclear@2 1374 #else /* !(DLL || non-cygwin WINDOWS) */
nuclear@2 1375 # if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
nuclear@2 1376 # ifndef PNGAPI
nuclear@2 1377 # define PNGAPI _System
nuclear@2 1378 # endif
nuclear@2 1379 # else
nuclear@2 1380 # if 0 /* ... other platforms, with other meanings */
nuclear@2 1381 # endif
nuclear@2 1382 # endif
nuclear@2 1383 #endif
nuclear@2 1384
nuclear@2 1385 #ifndef PNGAPI
nuclear@2 1386 # define PNGAPI
nuclear@2 1387 #endif
nuclear@2 1388 #ifndef PNG_IMPEXP
nuclear@2 1389 # define PNG_IMPEXP
nuclear@2 1390 #endif
nuclear@2 1391
nuclear@2 1392 #ifdef PNG_BUILDSYMS
nuclear@2 1393 # ifndef PNG_EXPORT
nuclear@2 1394 # define PNG_EXPORT(type,symbol) PNG_FUNCTION_EXPORT symbol END
nuclear@2 1395 # endif
nuclear@2 1396 # ifdef PNG_USE_GLOBAL_ARRAYS
nuclear@2 1397 # ifndef PNG_EXPORT_VAR
nuclear@2 1398 # define PNG_EXPORT_VAR(type) PNG_DATA_EXPORT
nuclear@2 1399 # endif
nuclear@2 1400 # endif
nuclear@2 1401 #endif
nuclear@2 1402
nuclear@2 1403 #ifndef PNG_EXPORT
nuclear@2 1404 # define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol
nuclear@2 1405 #endif
nuclear@2 1406
nuclear@2 1407 #ifdef PNG_USE_GLOBAL_ARRAYS
nuclear@2 1408 # ifndef PNG_EXPORT_VAR
nuclear@2 1409 # define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type
nuclear@2 1410 # endif
nuclear@2 1411 #endif
nuclear@2 1412
nuclear@2 1413 /* User may want to use these so they are not in PNG_INTERNAL. Any library
nuclear@2 1414 * functions that are passed far data must be model independent.
nuclear@2 1415 */
nuclear@2 1416
nuclear@2 1417 #ifndef PNG_ABORT
nuclear@2 1418 # define PNG_ABORT() abort()
nuclear@2 1419 #endif
nuclear@2 1420
nuclear@2 1421 #ifdef PNG_SETJMP_SUPPORTED
nuclear@2 1422 # define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
nuclear@2 1423 #else
nuclear@2 1424 # define png_jmpbuf(png_ptr) \
nuclear@2 1425 (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED)
nuclear@2 1426 #endif
nuclear@2 1427
nuclear@2 1428 #if defined(USE_FAR_KEYWORD) /* memory model independent fns */
nuclear@2 1429 /* use this to make far-to-near assignments */
nuclear@2 1430 # define CHECK 1
nuclear@2 1431 # define NOCHECK 0
nuclear@2 1432 # define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK))
nuclear@2 1433 # define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK))
nuclear@2 1434 # define png_snprintf _fsnprintf /* Added to v 1.2.19 */
nuclear@2 1435 # define png_strlen _fstrlen
nuclear@2 1436 # define png_memcmp _fmemcmp /* SJT: added */
nuclear@2 1437 # define png_memcpy _fmemcpy
nuclear@2 1438 # define png_memset _fmemset
nuclear@2 1439 #else /* use the usual functions */
nuclear@2 1440 # define CVT_PTR(ptr) (ptr)
nuclear@2 1441 # define CVT_PTR_NOCHECK(ptr) (ptr)
nuclear@2 1442 # ifndef PNG_NO_SNPRINTF
nuclear@2 1443 # ifdef _MSC_VER
nuclear@2 1444 # define png_snprintf _snprintf /* Added to v 1.2.19 */
nuclear@2 1445 # define png_snprintf2 _snprintf
nuclear@2 1446 # define png_snprintf6 _snprintf
nuclear@2 1447 # else
nuclear@2 1448 # define png_snprintf snprintf /* Added to v 1.2.19 */
nuclear@2 1449 # define png_snprintf2 snprintf
nuclear@2 1450 # define png_snprintf6 snprintf
nuclear@2 1451 # endif
nuclear@2 1452 # else
nuclear@2 1453 /* You don't have or don't want to use snprintf(). Caution: Using
nuclear@2 1454 * sprintf instead of snprintf exposes your application to accidental
nuclear@2 1455 * or malevolent buffer overflows. If you don't have snprintf()
nuclear@2 1456 * as a general rule you should provide one (you can get one from
nuclear@2 1457 * Portable OpenSSH). */
nuclear@2 1458 # define png_snprintf(s1,n,fmt,x1) sprintf(s1,fmt,x1)
nuclear@2 1459 # define png_snprintf2(s1,n,fmt,x1,x2) sprintf(s1,fmt,x1,x2)
nuclear@2 1460 # define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \
nuclear@2 1461 sprintf(s1,fmt,x1,x2,x3,x4,x5,x6)
nuclear@2 1462 # endif
nuclear@2 1463 # define png_strlen strlen
nuclear@2 1464 # define png_memcmp memcmp /* SJT: added */
nuclear@2 1465 # define png_memcpy memcpy
nuclear@2 1466 # define png_memset memset
nuclear@2 1467 #endif
nuclear@2 1468 /* End of memory model independent support */
nuclear@2 1469
nuclear@2 1470 /* Just a little check that someone hasn't tried to define something
nuclear@2 1471 * contradictory.
nuclear@2 1472 */
nuclear@2 1473 #if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K)
nuclear@2 1474 # undef PNG_ZBUF_SIZE
nuclear@2 1475 # define PNG_ZBUF_SIZE 65536L
nuclear@2 1476 #endif
nuclear@2 1477
nuclear@2 1478 /* Added at libpng-1.2.8 */
nuclear@2 1479 #endif /* PNG_VERSION_INFO_ONLY */
nuclear@2 1480
nuclear@2 1481 #endif /* PNGCONF_H */