dbf-halloween2015

annotate libs/libpng/pngconf.h @ 1:c3f5c32cb210

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