]> git.saurik.com Git - wxWidgets.git/blob - src/png/pngconf.h
Add missing WXK constants for the control keys
[wxWidgets.git] / src / png / pngconf.h
1
2 /* pngconf.h - machine configurable file for libpng
3 *
4 * libpng version 1.5.7 - December 15, 2011
5 *
6 * Copyright (c) 1998-2011 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_BUILDING_SYMBOL_TABLE
30 /* PNG_NO_LIMITS_H may be used to turn off the use of the standard C
31 * definition file for machine specific limits, this may impact the
32 * correctness of the definitons below (see uses of INT_MAX).
33 */
34 # ifndef PNG_NO_LIMITS_H
35 # include <limits.h>
36 # endif
37
38 /* For the memory copy APIs (i.e. the standard definitions of these),
39 * because this file defines png_memcpy and so on the base APIs must
40 * be defined here.
41 */
42 # ifdef BSD
43 # include <strings.h>
44 # else
45 # include <string.h>
46 # endif
47
48 /* For png_FILE_p - this provides the standard definition of a
49 * FILE
50 */
51 # ifdef PNG_STDIO_SUPPORTED
52 # include <stdio.h>
53 # endif
54 #endif
55
56 /* This controls optimization of the reading of 16 and 32 bit values
57 * from PNG files. It can be set on a per-app-file basis - it
58 * just changes whether a macro is used to the function is called.
59 * The library builder sets the default, if read functions are not
60 * built into the library the macro implementation is forced on.
61 */
62 #ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED
63 # define PNG_USE_READ_MACROS
64 #endif
65 #if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS)
66 # if PNG_DEFAULT_READ_MACROS
67 # define PNG_USE_READ_MACROS
68 # endif
69 #endif
70
71 /* COMPILER SPECIFIC OPTIONS.
72 *
73 * These options are provided so that a variety of difficult compilers
74 * can be used. Some are fixed at build time (e.g. PNG_API_RULE
75 * below) but still have compiler specific implementations, others
76 * may be changed on a per-file basis when compiling against libpng.
77 */
78
79 /* The PNGARG macro protects us against machines that don't have function
80 * prototypes (ie K&R style headers). If your compiler does not handle
81 * function prototypes, define this macro and use the included ansi2knr.
82 * I've always been able to use _NO_PROTO as the indicator, but you may
83 * need to drag the empty declaration out in front of here, or change the
84 * ifdef to suit your own needs.
85 */
86 #ifndef PNGARG
87
88 # ifdef OF /* zlib prototype munger */
89 # define PNGARG(arglist) OF(arglist)
90 # else
91
92 # ifdef _NO_PROTO
93 # define PNGARG(arglist) ()
94 # else
95 # define PNGARG(arglist) arglist
96 # endif /* _NO_PROTO */
97
98 # endif /* OF */
99
100 #endif /* PNGARG */
101
102 /* Function calling conventions.
103 * =============================
104 * Normally it is not necessary to specify to the compiler how to call
105 * a function - it just does it - however on x86 systems derived from
106 * Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems
107 * and some others) there are multiple ways to call a function and the
108 * default can be changed on the compiler command line. For this reason
109 * libpng specifies the calling convention of every exported function and
110 * every function called via a user supplied function pointer. This is
111 * done in this file by defining the following macros:
112 *
113 * PNGAPI Calling convention for exported functions.
114 * PNGCBAPI Calling convention for user provided (callback) functions.
115 * PNGCAPI Calling convention used by the ANSI-C library (required
116 * for longjmp callbacks and sometimes used internally to
117 * specify the calling convention for zlib).
118 *
119 * These macros should never be overridden. If it is necessary to
120 * change calling convention in a private build this can be done
121 * by setting PNG_API_RULE (which defaults to 0) to one of the values
122 * below to select the correct 'API' variants.
123 *
124 * PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout.
125 * This is correct in every known environment.
126 * PNG_API_RULE=1 Use the operating system convention for PNGAPI and
127 * the 'C' calling convention (from PNGCAPI) for
128 * callbacks (PNGCBAPI). This is no longer required
129 * in any known environment - if it has to be used
130 * please post an explanation of the problem to the
131 * libpng mailing list.
132 *
133 * These cases only differ if the operating system does not use the C
134 * calling convention, at present this just means the above cases
135 * (x86 DOS/Windows sytems) and, even then, this does not apply to
136 * Cygwin running on those systems.
137 *
138 * Note that the value must be defined in pnglibconf.h so that what
139 * the application uses to call the library matches the conventions
140 * set when building the library.
141 */
142
143 /* Symbol export
144 * =============
145 * When building a shared library it is almost always necessary to tell
146 * the compiler which symbols to export. The png.h macro 'PNG_EXPORT'
147 * is used to mark the symbols. On some systems these symbols can be
148 * extracted at link time and need no special processing by the compiler,
149 * on other systems the symbols are flagged by the compiler and just
150 * the declaration requires a special tag applied (unfortunately) in a
151 * compiler dependent way. Some systems can do either.
152 *
153 * A small number of older systems also require a symbol from a DLL to
154 * be flagged to the program that calls it. This is a problem because
155 * we do not know in the header file included by application code that
156 * the symbol will come from a shared library, as opposed to a statically
157 * linked one. For this reason the application must tell us by setting
158 * the magic flag PNG_USE_DLL to turn on the special processing before
159 * it includes png.h.
160 *
161 * Four additional macros are used to make this happen:
162 *
163 * PNG_IMPEXP The magic (if any) to cause a symbol to be exported from
164 * the build or imported if PNG_USE_DLL is set - compiler
165 * and system specific.
166 *
167 * PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to
168 * 'type', compiler specific.
169 *
170 * PNG_DLL_EXPORT Set to the magic to use during a libpng build to
171 * make a symbol exported from the DLL. Not used in the
172 * public header files; see pngpriv.h for how it is used
173 * in the libpng build.
174 *
175 * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come
176 * from a DLL - used to define PNG_IMPEXP when
177 * PNG_USE_DLL is set.
178 */
179
180 /* System specific discovery.
181 * ==========================
182 * This code is used at build time to find PNG_IMPEXP, the API settings
183 * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL
184 * import processing is possible. On Windows/x86 systems it also sets
185 * compiler-specific macros to the values required to change the calling
186 * conventions of the various functions.
187 */
188 #if ( defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\
189 defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) ) &&\
190 ( defined(_X86_) || defined(_X64_) || defined(_M_IX86) ||\
191 defined(_M_X64) || defined(_M_IA64) )
192 /* Windows system (DOS doesn't support DLLs) running on x86/x64. Includes
193 * builds under Cygwin or MinGW. Also includes Watcom builds but these need
194 * special treatment because they are not compatible with GCC or Visual C
195 * because of different calling conventions.
196 */
197 # if PNG_API_RULE == 2
198 /* If this line results in an error, either because __watcall is not
199 * understood or because of a redefine just below you cannot use *this*
200 * build of the library with the compiler you are using. *This* build was
201 * build using Watcom and applications must also be built using Watcom!
202 */
203 # define PNGCAPI __watcall
204 # endif
205
206 # if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
207 # define PNGCAPI __cdecl
208 # if PNG_API_RULE == 1
209 # define PNGAPI __stdcall
210 # endif
211 # else
212 /* An older compiler, or one not detected (erroneously) above,
213 * if necessary override on the command line to get the correct
214 * variants for the compiler.
215 */
216 # ifndef PNGCAPI
217 # define PNGCAPI _cdecl
218 # endif
219 # if PNG_API_RULE == 1 && !defined(PNGAPI)
220 # define PNGAPI _stdcall
221 # endif
222 # endif /* compiler/api */
223 /* NOTE: PNGCBAPI always defaults to PNGCAPI. */
224
225 # if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)
226 ERROR: PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed
227 # endif
228
229 # if (defined(_MSC_VER) && _MSC_VER < 800) ||\
230 (defined(__BORLANDC__) && __BORLANDC__ < 0x500)
231 /* older Borland and MSC
232 * compilers used '__export' and required this to be after
233 * the type.
234 */
235 # ifndef PNG_EXPORT_TYPE
236 # define PNG_EXPORT_TYPE(type) type PNG_IMPEXP
237 # endif
238 # define PNG_DLL_EXPORT __export
239 # else /* newer compiler */
240 # define PNG_DLL_EXPORT __declspec(dllexport)
241 # ifndef PNG_DLL_IMPORT
242 # define PNG_DLL_IMPORT __declspec(dllimport)
243 # endif
244 # endif /* compiler */
245
246 #else /* !Windows/x86 */
247 # if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
248 # define PNGAPI _System
249 # else /* !Windows/x86 && !OS/2 */
250 /* Use the defaults, or define PNG*API on the command line (but
251 * this will have to be done for every compile!)
252 */
253 # endif /* other system, !OS/2 */
254 #endif /* !Windows/x86 */
255
256 /* Now do all the defaulting . */
257 #ifndef PNGCAPI
258 # define PNGCAPI
259 #endif
260 #ifndef PNGCBAPI
261 # define PNGCBAPI PNGCAPI
262 #endif
263 #ifndef PNGAPI
264 # define PNGAPI PNGCAPI
265 #endif
266
267 /* PNG_IMPEXP may be set on the compilation system command line or (if not set)
268 * then in an internal header file when building the library, otherwise (when
269 * using the library) it is set here.
270 */
271 #ifndef PNG_IMPEXP
272 # if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT)
273 /* This forces use of a DLL, disallowing static linking */
274 # define PNG_IMPEXP PNG_DLL_IMPORT
275 # endif
276
277 # ifndef PNG_IMPEXP
278 # define PNG_IMPEXP
279 # endif
280 #endif
281
282 /* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat
283 * 'attributes' as a storage class - the attributes go at the start of the
284 * function definition, and attributes are always appended regardless of the
285 * compiler. This considerably simplifies these macros but may cause problems
286 * if any compilers both need function attributes and fail to handle them as
287 * a storage class (this is unlikely.)
288 */
289 #ifndef PNG_FUNCTION
290 # define PNG_FUNCTION(type, name, args, attributes) attributes type name args
291 #endif
292
293 #ifndef PNG_EXPORT_TYPE
294 # define PNG_EXPORT_TYPE(type) PNG_IMPEXP type
295 #endif
296
297 /* The ordinal value is only relevant when preprocessing png.h for symbol
298 * table entries, so we discard it here. See the .dfn files in the
299 * scripts directory.
300 */
301 #ifndef PNG_EXPORTA
302
303 # define PNG_EXPORTA(ordinal, type, name, args, attributes)\
304 PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args), \
305 extern attributes)
306 #endif
307
308 /* ANSI-C (C90) does not permit a macro to be invoked with an empty argument,
309 * so make something non-empty to satisfy the requirement:
310 */
311 #define PNG_EMPTY /*empty list*/
312
313 #define PNG_EXPORT(ordinal, type, name, args)\
314 PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY)
315
316 /* Use PNG_REMOVED to comment out a removed interface. */
317 #ifndef PNG_REMOVED
318 # define PNG_REMOVED(ordinal, type, name, args, attributes)
319 #endif
320
321 #ifndef PNG_CALLBACK
322 # define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args)
323 #endif
324
325 /* Support for compiler specific function attributes. These are used
326 * so that where compiler support is available incorrect use of API
327 * functions in png.h will generate compiler warnings.
328 *
329 * Added at libpng-1.2.41.
330 */
331
332 #ifndef PNG_NO_PEDANTIC_WARNINGS
333 # ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED
334 # define PNG_PEDANTIC_WARNINGS_SUPPORTED
335 # endif
336 #endif
337
338 #ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED
339 /* Support for compiler specific function attributes. These are used
340 * so that where compiler support is available incorrect use of API
341 * functions in png.h will generate compiler warnings. Added at libpng
342 * version 1.2.41.
343 */
344 # if defined(__GNUC__)
345 # ifndef PNG_USE_RESULT
346 # define PNG_USE_RESULT __attribute__((__warn_unused_result__))
347 # endif
348 # ifndef PNG_NORETURN
349 # define PNG_NORETURN __attribute__((__noreturn__))
350 # endif
351 # ifndef PNG_ALLOCATED
352 # define PNG_ALLOCATED __attribute__((__malloc__))
353 # endif
354 # ifndef PNG_DEPRECATED
355 # define PNG_DEPRECATED __attribute__((__deprecated__))
356 # endif
357 # ifndef PNG_PRIVATE
358 # if 0 /* Doesn't work so we use deprecated instead*/
359 # define PNG_PRIVATE \
360 __attribute__((warning("This function is not exported by libpng.")))
361 # else
362 # define PNG_PRIVATE \
363 __attribute__((__deprecated__))
364 # endif
365 # endif
366 # endif /* __GNUC__ */
367
368 # if defined(_MSC_VER) && (_MSC_VER >= 1300)
369 # ifndef PNG_USE_RESULT
370 # define PNG_USE_RESULT /* not supported */
371 # endif
372 # ifndef PNG_NORETURN
373 # define PNG_NORETURN __declspec(noreturn)
374 # endif
375 # ifndef PNG_ALLOCATED
376 # if (_MSC_VER >= 1400)
377 # define PNG_ALLOCATED __declspec(restrict)
378 # endif
379 # endif
380 # ifndef PNG_DEPRECATED
381 # define PNG_DEPRECATED __declspec(deprecated)
382 # endif
383 # ifndef PNG_PRIVATE
384 # define PNG_PRIVATE __declspec(deprecated)
385 # endif
386 # endif /* _MSC_VER */
387 #endif /* PNG_PEDANTIC_WARNINGS */
388
389 #ifndef PNG_DEPRECATED
390 # define PNG_DEPRECATED /* Use of this function is deprecated */
391 #endif
392 #ifndef PNG_USE_RESULT
393 # define PNG_USE_RESULT /* The result of this function must be checked */
394 #endif
395 #ifndef PNG_NORETURN
396 # define PNG_NORETURN /* This function does not return */
397 #endif
398 #ifndef PNG_ALLOCATED
399 # define PNG_ALLOCATED /* The result of the function is new memory */
400 #endif
401 #ifndef PNG_PRIVATE
402 # define PNG_PRIVATE /* This is a private libpng function */
403 #endif
404 #ifndef PNG_FP_EXPORT /* A floating point API. */
405 # ifdef PNG_FLOATING_POINT_SUPPORTED
406 # define PNG_FP_EXPORT(ordinal, type, name, args)\
407 PNG_EXPORT(ordinal, type, name, args)
408 # else /* No floating point APIs */
409 # define PNG_FP_EXPORT(ordinal, type, name, args)
410 # endif
411 #endif
412 #ifndef PNG_FIXED_EXPORT /* A fixed point API. */
413 # ifdef PNG_FIXED_POINT_SUPPORTED
414 # define PNG_FIXED_EXPORT(ordinal, type, name, args)\
415 PNG_EXPORT(ordinal, type, name, args)
416 # else /* No fixed point APIs */
417 # define PNG_FIXED_EXPORT(ordinal, type, name, args)
418 # endif
419 #endif
420
421 /* The following uses const char * instead of char * for error
422 * and warning message functions, so some compilers won't complain.
423 * If you do not want to use const, define PNG_NO_CONST here.
424 *
425 * This should not change how the APIs are called, so it can be done
426 * on a per-file basis in the application.
427 */
428 #ifndef PNG_CONST
429 # ifndef PNG_NO_CONST
430 # define PNG_CONST const
431 # else
432 # define PNG_CONST
433 # endif
434 #endif
435
436 /* Some typedefs to get us started. These should be safe on most of the
437 * common platforms. The typedefs should be at least as large as the
438 * numbers suggest (a png_uint_32 must be at least 32 bits long), but they
439 * don't have to be exactly that size. Some compilers dislike passing
440 * unsigned shorts as function parameters, so you may be better off using
441 * unsigned int for png_uint_16.
442 */
443
444 #if defined(INT_MAX) && (INT_MAX > 0x7ffffffeL)
445 typedef unsigned int png_uint_32;
446 typedef int png_int_32;
447 #else
448 typedef unsigned long png_uint_32;
449 typedef long png_int_32;
450 #endif
451 typedef unsigned short png_uint_16;
452 typedef short png_int_16;
453 typedef unsigned char png_byte;
454
455 #ifdef PNG_NO_SIZE_T
456 typedef unsigned int png_size_t;
457 #else
458 typedef size_t png_size_t;
459 #endif
460 #define png_sizeof(x) (sizeof (x))
461
462 /* The following is needed for medium model support. It cannot be in the
463 * pngpriv.h header. Needs modification for other compilers besides
464 * MSC. Model independent support declares all arrays and pointers to be
465 * large using the far keyword. The zlib version used must also support
466 * model independent data. As of version zlib 1.0.4, the necessary changes
467 * have been made in zlib. The USE_FAR_KEYWORD define triggers other
468 * changes that are needed. (Tim Wegner)
469 */
470
471 /* Separate compiler dependencies (problem here is that zlib.h always
472 * defines FAR. (SJT)
473 */
474 #ifdef __BORLANDC__
475 # if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
476 # define LDATA 1
477 # else
478 # define LDATA 0
479 # endif
480 /* GRR: why is Cygwin in here? Cygwin is not Borland C... */
481 # if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__)
482 # define PNG_MAX_MALLOC_64K /* only used in build */
483 # if (LDATA != 1)
484 # ifndef FAR
485 # define FAR __far
486 # endif
487 # define USE_FAR_KEYWORD
488 # endif /* LDATA != 1 */
489 /* Possibly useful for moving data out of default segment.
490 * Uncomment it if you want. Could also define FARDATA as
491 * const if your compiler supports it. (SJT)
492 # define FARDATA FAR
493 */
494 # endif /* __WIN32__, __FLAT__, __CYGWIN__ */
495 #endif /* __BORLANDC__ */
496
497
498 /* Suggest testing for specific compiler first before testing for
499 * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM,
500 * making reliance oncertain keywords suspect. (SJT)
501 */
502
503 /* MSC Medium model */
504 #ifdef FAR
505 # ifdef M_I86MM
506 # define USE_FAR_KEYWORD
507 # define FARDATA FAR
508 # include <dos.h>
509 # endif
510 #endif
511
512 /* SJT: default case */
513 #ifndef FAR
514 # define FAR
515 #endif
516
517 /* At this point FAR is always defined */
518 #ifndef FARDATA
519 # define FARDATA
520 #endif
521
522 /* Typedef for floating-point numbers that are converted
523 * to fixed-point with a multiple of 100,000, e.g., gamma
524 */
525 typedef png_int_32 png_fixed_point;
526
527 /* Add typedefs for pointers */
528 typedef void FAR * png_voidp;
529 typedef PNG_CONST void FAR * png_const_voidp;
530 typedef png_byte FAR * png_bytep;
531 typedef PNG_CONST png_byte FAR * png_const_bytep;
532 typedef png_uint_32 FAR * png_uint_32p;
533 typedef PNG_CONST png_uint_32 FAR * png_const_uint_32p;
534 typedef png_int_32 FAR * png_int_32p;
535 typedef PNG_CONST png_int_32 FAR * png_const_int_32p;
536 typedef png_uint_16 FAR * png_uint_16p;
537 typedef PNG_CONST png_uint_16 FAR * png_const_uint_16p;
538 typedef png_int_16 FAR * png_int_16p;
539 typedef PNG_CONST png_int_16 FAR * png_const_int_16p;
540 typedef char FAR * png_charp;
541 typedef PNG_CONST char FAR * png_const_charp;
542 typedef png_fixed_point FAR * png_fixed_point_p;
543 typedef PNG_CONST png_fixed_point FAR * png_const_fixed_point_p;
544 typedef png_size_t FAR * png_size_tp;
545 typedef PNG_CONST png_size_t FAR * png_const_size_tp;
546
547 #ifdef PNG_STDIO_SUPPORTED
548 typedef FILE * png_FILE_p;
549 #endif
550
551 #ifdef PNG_FLOATING_POINT_SUPPORTED
552 typedef double FAR * png_doublep;
553 typedef PNG_CONST double FAR * png_const_doublep;
554 #endif
555
556 /* Pointers to pointers; i.e. arrays */
557 typedef png_byte FAR * FAR * png_bytepp;
558 typedef png_uint_32 FAR * FAR * png_uint_32pp;
559 typedef png_int_32 FAR * FAR * png_int_32pp;
560 typedef png_uint_16 FAR * FAR * png_uint_16pp;
561 typedef png_int_16 FAR * FAR * png_int_16pp;
562 typedef PNG_CONST char FAR * FAR * png_const_charpp;
563 typedef char FAR * FAR * png_charpp;
564 typedef png_fixed_point FAR * FAR * png_fixed_point_pp;
565 #ifdef PNG_FLOATING_POINT_SUPPORTED
566 typedef double FAR * FAR * png_doublepp;
567 #endif
568
569 /* Pointers to pointers to pointers; i.e., pointer to array */
570 typedef char FAR * FAR * FAR * png_charppp;
571
572 /* png_alloc_size_t is guaranteed to be no smaller than png_size_t,
573 * and no smaller than png_uint_32. Casts from png_size_t or png_uint_32
574 * to png_alloc_size_t are not necessary; in fact, it is recommended
575 * not to use them at all so that the compiler can complain when something
576 * turns out to be problematic.
577 * Casts in the other direction (from png_alloc_size_t to png_size_t or
578 * png_uint_32) should be explicitly applied; however, we do not expect
579 * to encounter practical situations that require such conversions.
580 */
581 #if defined(__TURBOC__) && !defined(__FLAT__)
582 typedef unsigned long png_alloc_size_t;
583 #else
584 # if defined(_MSC_VER) && defined(MAXSEG_64K)
585 typedef unsigned long png_alloc_size_t;
586 # else
587 /* This is an attempt to detect an old Windows system where (int) is
588 * actually 16 bits, in that case png_malloc must have an argument with a
589 * bigger size to accomodate the requirements of the library.
590 */
591 # if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_)) && \
592 (!defined(INT_MAX) || INT_MAX <= 0x7ffffffeL)
593 typedef DWORD png_alloc_size_t;
594 # else
595 typedef png_size_t png_alloc_size_t;
596 # endif
597 # endif
598 #endif
599
600 #endif /* PNGCONF_H */