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