vrshoot

annotate libs/libpng/pngconf.h @ 0:b2f14e535253

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