source: trunk/src/3rdparty/libpng/pngconf.h@ 5

Last change on this file since 5 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

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