Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pngconf.h 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. /* pngconf.h - machine configurable file for libpng
  2. *
  3. * libpng version 1.6.1 - March 28, 2013
  4. *
  5. * Copyright (c) 1998-2013 Glenn Randers-Pehrson
  6. * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  7. * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  8. *
  9. * This code is released under the libpng license.
  10. * For conditions of distribution and use, see the disclaimer
  11. * and license in png.h
  12. *
  13. */
  14. /* Any machine specific code is near the front of this file, so if you
  15. * are configuring libpng for a machine, you may want to read the section
  16. * starting here down to where it starts to typedef png_color, png_text,
  17. * and png_info.
  18. */
  19. #ifndef PNGCONF_H
  20. #define PNGCONF_H
  21. /* To do: Do all of this in scripts/pnglibconf.dfa */
  22. #ifdef PNG_SAFE_LIMITS_SUPPORTED
  23. # ifdef PNG_USER_WIDTH_MAX
  24. # undef PNG_USER_WIDTH_MAX
  25. # define PNG_USER_WIDTH_MAX 1000000L
  26. # endif
  27. # ifdef PNG_USER_HEIGHT_MAX
  28. # undef PNG_USER_HEIGHT_MAX
  29. # define PNG_USER_HEIGHT_MAX 1000000L
  30. # endif
  31. # ifdef PNG_USER_CHUNK_MALLOC_MAX
  32. # undef PNG_USER_CHUNK_MALLOC_MAX
  33. # define PNG_USER_CHUNK_MALLOC_MAX 4000000L
  34. # endif
  35. # ifdef PNG_USER_CHUNK_CACHE_MAX
  36. # undef PNG_USER_CHUNK_CACHE_MAX
  37. # define PNG_USER_CHUNK_CACHE_MAX 128
  38. # endif
  39. #endif
  40. #ifndef PNG_BUILDING_SYMBOL_TABLE /* else includes may cause problems */
  41. /* From libpng 1.6.0 libpng requires an ANSI X3.159-1989 ("ISOC90") compliant C
  42. * compiler for correct compilation. The following header files are required by
  43. * the standard. If your compiler doesn't provide these header files, or they
  44. * do not match the standard, you will need to provide/improve them.
  45. */
  46. #include <limits.h>
  47. #include <stddef.h>
  48. /* Library header files. These header files are all defined by ISOC90; libpng
  49. * expects conformant implementations, however, an ISOC90 conformant system need
  50. * not provide these header files if the functionality cannot be implemented.
  51. * In this case it will be necessary to disable the relevant parts of libpng in
  52. * the build of pnglibconf.h.
  53. *
  54. * Prior to 1.6.0 string.h was included here; the API changes in 1.6.0 to not
  55. * include this unnecessary header file.
  56. */
  57. #ifdef PNG_STDIO_SUPPORTED
  58. /* Required for the definition of FILE: */
  59. # include <stdio.h>
  60. #endif
  61. #ifdef PNG_SETJMP_SUPPORTED
  62. /* Required for the definition of jmp_buf and the declaration of longjmp: */
  63. # include <setjmp.h>
  64. #endif
  65. #ifdef PNG_CONVERT_tIME_SUPPORTED
  66. /* Required for struct tm: */
  67. # include <time.h>
  68. #endif
  69. #endif /* PNG_BUILDING_SYMBOL_TABLE */
  70. /* Prior to 1.6.0 it was possible to turn off 'const' in declarations using
  71. * PNG_NO_CONST; this is no longer supported except for data declarations which
  72. * apparently still cause problems in 2011 on some compilers.
  73. */
  74. #define PNG_CONST const /* backward compatibility only */
  75. /* This controls optimization of the reading of 16 and 32 bit values
  76. * from PNG files. It can be set on a per-app-file basis - it
  77. * just changes whether a macro is used when the function is called.
  78. * The library builder sets the default; if read functions are not
  79. * built into the library the macro implementation is forced on.
  80. */
  81. #ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED
  82. # define PNG_USE_READ_MACROS
  83. #endif
  84. #if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS)
  85. # if PNG_DEFAULT_READ_MACROS
  86. # define PNG_USE_READ_MACROS
  87. # endif
  88. #endif
  89. /* COMPILER SPECIFIC OPTIONS.
  90. *
  91. * These options are provided so that a variety of difficult compilers
  92. * can be used. Some are fixed at build time (e.g. PNG_API_RULE
  93. * below) but still have compiler specific implementations, others
  94. * may be changed on a per-file basis when compiling against libpng.
  95. */
  96. /* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect
  97. * against legacy (pre ISOC90) compilers that did not understand function
  98. * prototypes. It is not required for modern C compilers.
  99. */
  100. #ifndef PNGARG
  101. # define PNGARG(arglist) arglist
  102. #endif
  103. /* Function calling conventions.
  104. * =============================
  105. * Normally it is not necessary to specify to the compiler how to call
  106. * a function - it just does it - however on x86 systems derived from
  107. * Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems
  108. * and some others) there are multiple ways to call a function and the
  109. * default can be changed on the compiler command line. For this reason
  110. * libpng specifies the calling convention of every exported function and
  111. * every function called via a user supplied function pointer. This is
  112. * done in this file by defining the following macros:
  113. *
  114. * PNGAPI Calling convention for exported functions.
  115. * PNGCBAPI Calling convention for user provided (callback) functions.
  116. * PNGCAPI Calling convention used by the ANSI-C library (required
  117. * for longjmp callbacks and sometimes used internally to
  118. * specify the calling convention for zlib).
  119. *
  120. * These macros should never be overridden. If it is necessary to
  121. * change calling convention in a private build this can be done
  122. * by setting PNG_API_RULE (which defaults to 0) to one of the values
  123. * below to select the correct 'API' variants.
  124. *
  125. * PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout.
  126. * This is correct in every known environment.
  127. * PNG_API_RULE=1 Use the operating system convention for PNGAPI and
  128. * the 'C' calling convention (from PNGCAPI) for
  129. * callbacks (PNGCBAPI). This is no longer required
  130. * in any known environment - if it has to be used
  131. * please post an explanation of the problem to the
  132. * libpng mailing list.
  133. *
  134. * These cases only differ if the operating system does not use the C
  135. * calling convention, at present this just means the above cases
  136. * (x86 DOS/Windows sytems) and, even then, this does not apply to
  137. * Cygwin running on those systems.
  138. *
  139. * Note that the value must be defined in pnglibconf.h so that what
  140. * the application uses to call the library matches the conventions
  141. * set when building the library.
  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. /* System specific discovery.
  180. * ==========================
  181. * This code is used at build time to find PNG_IMPEXP, the API settings
  182. * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL
  183. * import processing is possible. On Windows systems it also sets
  184. * compiler-specific macros to the values required to change the calling
  185. * conventions of the various functions.
  186. */
  187. #if defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\
  188. defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
  189. /* Windows system (DOS doesn't support DLLs). Includes builds under Cygwin or
  190. * MinGW on any architecture currently supported by Windows. Also includes
  191. * Watcom builds but these need special treatment because they are not
  192. * compatible with GCC or Visual C because of different calling conventions.
  193. */
  194. # if PNG_API_RULE == 2
  195. /* If this line results in an error, either because __watcall is not
  196. * understood or because of a redefine just below you cannot use *this*
  197. * build of the library with the compiler you are using. *This* build was
  198. * build using Watcom and applications must also be built using Watcom!
  199. */
  200. # define PNGCAPI __watcall
  201. # endif
  202. # if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800))
  203. # define PNGCAPI __cdecl
  204. # if PNG_API_RULE == 1
  205. /* If this line results in an error __stdcall is not understood and
  206. * PNG_API_RULE should not have been set to '1'.
  207. */
  208. # define PNGAPI __stdcall
  209. # endif
  210. # else
  211. /* An older compiler, or one not detected (erroneously) above,
  212. * if necessary override on the command line to get the correct
  213. * variants for the compiler.
  214. */
  215. # ifndef PNGCAPI
  216. # define PNGCAPI _cdecl
  217. # endif
  218. # if PNG_API_RULE == 1 && !defined(PNGAPI)
  219. # define PNGAPI _stdcall
  220. # endif
  221. # endif /* compiler/api */
  222. /* NOTE: PNGCBAPI always defaults to PNGCAPI. */
  223. # if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)
  224. # error "PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed"
  225. # endif
  226. # if (defined(_MSC_VER) && _MSC_VER < 800) ||\
  227. (defined(__BORLANDC__) && __BORLANDC__ < 0x500)
  228. /* older Borland and MSC
  229. * compilers used '__export' and required this to be after
  230. * the type.
  231. */
  232. # ifndef PNG_EXPORT_TYPE
  233. # define PNG_EXPORT_TYPE(type) type PNG_IMPEXP
  234. # endif
  235. # define PNG_DLL_EXPORT __export
  236. # else /* newer compiler */
  237. # define PNG_DLL_EXPORT __declspec(dllexport)
  238. # ifndef PNG_DLL_IMPORT
  239. # define PNG_DLL_IMPORT __declspec(dllimport)
  240. # endif
  241. # endif /* compiler */
  242. #else /* !Windows */
  243. # if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
  244. # define PNGAPI _System
  245. # else /* !Windows/x86 && !OS/2 */
  246. /* Use the defaults, or define PNG*API on the command line (but
  247. * this will have to be done for every compile!)
  248. */
  249. # endif /* other system, !OS/2 */
  250. #endif /* !Windows/x86 */
  251. /* Now do all the defaulting . */
  252. #ifndef PNGCAPI
  253. # define PNGCAPI
  254. #endif
  255. #ifndef PNGCBAPI
  256. # define PNGCBAPI PNGCAPI
  257. #endif
  258. #ifndef PNGAPI
  259. # define PNGAPI PNGCAPI
  260. #endif
  261. /* PNG_IMPEXP may be set on the compilation system command line or (if not set)
  262. * then in an internal header file when building the library, otherwise (when
  263. * using the library) it is set here.
  264. */
  265. #ifndef PNG_IMPEXP
  266. # if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT)
  267. /* This forces use of a DLL, disallowing static linking */
  268. # define PNG_IMPEXP PNG_DLL_IMPORT
  269. # endif
  270. # ifndef PNG_IMPEXP
  271. # define PNG_IMPEXP
  272. # endif
  273. #endif
  274. /* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat
  275. * 'attributes' as a storage class - the attributes go at the start of the
  276. * function definition, and attributes are always appended regardless of the
  277. * compiler. This considerably simplifies these macros but may cause problems
  278. * if any compilers both need function attributes and fail to handle them as
  279. * a storage class (this is unlikely.)
  280. */
  281. #ifndef PNG_FUNCTION
  282. # define PNG_FUNCTION(type, name, args, attributes) attributes type name args
  283. #endif
  284. #ifndef PNG_EXPORT_TYPE
  285. # define PNG_EXPORT_TYPE(type) PNG_IMPEXP type
  286. #endif
  287. /* The ordinal value is only relevant when preprocessing png.h for symbol
  288. * table entries, so we discard it here. See the .dfn files in the
  289. * scripts directory.
  290. */
  291. #ifndef PNG_EXPORTA
  292. # define PNG_EXPORTA(ordinal, type, name, args, attributes)\
  293. PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args), \
  294. extern attributes)
  295. #endif
  296. /* ANSI-C (C90) does not permit a macro to be invoked with an empty argument,
  297. * so make something non-empty to satisfy the requirement:
  298. */
  299. #define PNG_EMPTY /*empty list*/
  300. #define PNG_EXPORT(ordinal, type, name, args)\
  301. PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY)
  302. /* Use PNG_REMOVED to comment out a removed interface. */
  303. #ifndef PNG_REMOVED
  304. # define PNG_REMOVED(ordinal, type, name, args, attributes)
  305. #endif
  306. #ifndef PNG_CALLBACK
  307. # define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args)
  308. #endif
  309. /* Support for compiler specific function attributes. These are used
  310. * so that where compiler support is available incorrect use of API
  311. * functions in png.h will generate compiler warnings.
  312. *
  313. * Added at libpng-1.2.41.
  314. */
  315. #ifndef PNG_NO_PEDANTIC_WARNINGS
  316. # ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED
  317. # define PNG_PEDANTIC_WARNINGS_SUPPORTED
  318. # endif
  319. #endif
  320. #ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED
  321. /* Support for compiler specific function attributes. These are used
  322. * so that where compiler support is available, incorrect use of API
  323. * functions in png.h will generate compiler warnings. Added at libpng
  324. * version 1.2.41. Disabling these removes the warnings but may also produce
  325. * less efficient code.
  326. */
  327. # if defined(__GNUC__)
  328. # ifndef PNG_USE_RESULT
  329. # define PNG_USE_RESULT __attribute__((__warn_unused_result__))
  330. # endif
  331. # ifndef PNG_NORETURN
  332. # define PNG_NORETURN __attribute__((__noreturn__))
  333. # endif
  334. # if __GNUC__ >= 3
  335. # ifndef PNG_ALLOCATED
  336. # define PNG_ALLOCATED __attribute__((__malloc__))
  337. # endif
  338. # ifndef PNG_DEPRECATED
  339. # define PNG_DEPRECATED __attribute__((__deprecated__))
  340. # endif
  341. # ifndef PNG_PRIVATE
  342. # if 0 /* Doesn't work so we use deprecated instead*/
  343. # define PNG_PRIVATE \
  344. __attribute__((warning("This function is not exported by libpng.")))
  345. # else
  346. # define PNG_PRIVATE \
  347. __attribute__((__deprecated__))
  348. # endif
  349. # endif
  350. # if ((__GNUC__ != 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1))
  351. # ifndef PNG_RESTRICT
  352. # define PNG_RESTRICT __restrict
  353. # endif
  354. # endif /* __GNUC__ == 3.0 */
  355. # endif /* __GNUC__ >= 3 */
  356. # elif defined(_MSC_VER) && (_MSC_VER >= 1300)
  357. # ifndef PNG_USE_RESULT
  358. # define PNG_USE_RESULT /* not supported */
  359. # endif
  360. # ifndef PNG_NORETURN
  361. # define PNG_NORETURN __declspec(noreturn)
  362. # endif
  363. # ifndef PNG_ALLOCATED
  364. # if (_MSC_VER >= 1400)
  365. # define PNG_ALLOCATED __declspec(restrict)
  366. # endif
  367. # endif
  368. # ifndef PNG_DEPRECATED
  369. # define PNG_DEPRECATED __declspec(deprecated)
  370. # endif
  371. # ifndef PNG_PRIVATE
  372. # define PNG_PRIVATE __declspec(deprecated)
  373. # endif
  374. # ifndef PNG_RESTRICT
  375. # if (_MSC_VER >= 1400)
  376. # define PNG_RESTRICT __restrict
  377. # endif
  378. # endif
  379. # elif defined(__WATCOMC__)
  380. # ifndef PNG_RESTRICT
  381. # define PNG_RESTRICT __restrict
  382. # endif
  383. # endif /* _MSC_VER */
  384. #endif /* PNG_PEDANTIC_WARNINGS */
  385. #ifndef PNG_DEPRECATED
  386. # define PNG_DEPRECATED /* Use of this function is deprecated */
  387. #endif
  388. #ifndef PNG_USE_RESULT
  389. # define PNG_USE_RESULT /* The result of this function must be checked */
  390. #endif
  391. #ifndef PNG_NORETURN
  392. # define PNG_NORETURN /* This function does not return */
  393. #endif
  394. #ifndef PNG_ALLOCATED
  395. # define PNG_ALLOCATED /* The result of the function is new memory */
  396. #endif
  397. #ifndef PNG_PRIVATE
  398. # define PNG_PRIVATE /* This is a private libpng function */
  399. #endif
  400. #ifndef PNG_RESTRICT
  401. # define PNG_RESTRICT /* The C99 "restrict" feature */
  402. #endif
  403. #ifndef PNG_FP_EXPORT /* A floating point API. */
  404. # ifdef PNG_FLOATING_POINT_SUPPORTED
  405. # define PNG_FP_EXPORT(ordinal, type, name, args)\
  406. PNG_EXPORT(ordinal, type, name, args);
  407. # else /* No floating point APIs */
  408. # define PNG_FP_EXPORT(ordinal, type, name, args)
  409. # endif
  410. #endif
  411. #ifndef PNG_FIXED_EXPORT /* A fixed point API. */
  412. # ifdef PNG_FIXED_POINT_SUPPORTED
  413. # define PNG_FIXED_EXPORT(ordinal, type, name, args)\
  414. PNG_EXPORT(ordinal, type, name, args);
  415. # else /* No fixed point APIs */
  416. # define PNG_FIXED_EXPORT(ordinal, type, name, args)
  417. # endif
  418. #endif
  419. #ifndef PNG_BUILDING_SYMBOL_TABLE
  420. /* Some typedefs to get us started. These should be safe on most of the common
  421. * platforms.
  422. *
  423. * png_uint_32 and png_int_32 may, currently, be larger than required to hold a
  424. * 32-bit value however this is not normally advisable.
  425. *
  426. * png_uint_16 and png_int_16 should always be two bytes in size - this is
  427. * verified at library build time.
  428. *
  429. * png_byte must always be one byte in size.
  430. *
  431. * The checks below use constants from limits.h, as defined by the ISOC90
  432. * standard.
  433. */
  434. #if CHAR_BIT == 8 && UCHAR_MAX == 255
  435. typedef unsigned char png_byte;
  436. #else
  437. # error "libpng requires 8 bit bytes"
  438. #endif
  439. #if INT_MIN == -32768 && INT_MAX == 32767
  440. typedef int png_int_16;
  441. #elif SHRT_MIN == -32768 && SHRT_MAX == 32767
  442. typedef short png_int_16;
  443. #else
  444. # error "libpng requires a signed 16 bit type"
  445. #endif
  446. #if UINT_MAX == 65535
  447. typedef unsigned int png_uint_16;
  448. #elif USHRT_MAX == 65535
  449. typedef unsigned short png_uint_16;
  450. #else
  451. # error "libpng requires an unsigned 16 bit type"
  452. #endif
  453. #if INT_MIN < -2147483646 && INT_MAX > 2147483646
  454. typedef int png_int_32;
  455. #elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646
  456. typedef long int png_int_32;
  457. #else
  458. # error "libpng requires a signed 32 bit (or more) type"
  459. #endif
  460. #if UINT_MAX > 4294967294
  461. typedef unsigned int png_uint_32;
  462. #elif ULONG_MAX > 4294967294
  463. typedef unsigned long int png_uint_32;
  464. #else
  465. # error "libpng requires an unsigned 32 bit (or more) type"
  466. #endif
  467. /* Prior to 1.6.0 it was possible to disable the use of size_t, 1.6.0, however,
  468. * requires an ISOC90 compiler and relies on consistent behavior of sizeof.
  469. */
  470. typedef size_t png_size_t;
  471. typedef ptrdiff_t png_ptrdiff_t;
  472. /* libpng needs to know the maximum value of 'size_t' and this controls the
  473. * definition of png_alloc_size_t, below. This maximum value of size_t limits
  474. * but does not control the maximum allocations the library makes - there is
  475. * direct application control of this through png_set_user_limits().
  476. */
  477. #ifndef PNG_SMALL_SIZE_T
  478. /* Compiler specific tests for systems where size_t is known to be less than
  479. * 32 bits (some of these systems may no longer work because of the lack of
  480. * 'far' support; see above.)
  481. */
  482. # if (defined(__TURBOC__) && !defined(__FLAT__)) ||\
  483. (defined(_MSC_VER) && defined(MAXSEG_64K))
  484. # define PNG_SMALL_SIZE_T
  485. # endif
  486. #endif
  487. /* png_alloc_size_t is guaranteed to be no smaller than png_size_t, and no
  488. * smaller than png_uint_32. Casts from png_size_t or png_uint_32 to
  489. * png_alloc_size_t are not necessary; in fact, it is recommended not to use
  490. * them at all so that the compiler can complain when something turns out to be
  491. * problematic.
  492. *
  493. * Casts in the other direction (from png_alloc_size_t to png_size_t or
  494. * png_uint_32) should be explicitly applied; however, we do not expect to
  495. * encounter practical situations that require such conversions.
  496. *
  497. * PNG_SMALL_SIZE_T must be defined if the maximum value of size_t is less than
  498. * 4294967295 - i.e. less than the maximum value of png_uint_32.
  499. */
  500. #ifdef PNG_SMALL_SIZE_T
  501. typedef png_uint_32 png_alloc_size_t;
  502. #else
  503. typedef png_size_t png_alloc_size_t;
  504. #endif
  505. /* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler
  506. * implementations of Intel CPU specific support of user-mode segmented address
  507. * spaces, where 16-bit pointers address more than 65536 bytes of memory using
  508. * separate 'segment' registers. The implementation requires two different
  509. * types of pointer (only one of which includes the segment value.)
  510. *
  511. * If required this support is available in version 1.2 of libpng and may be
  512. * available in versions through 1.5, although the correctness of the code has
  513. * not been verified recently.
  514. */
  515. /* Typedef for floating-point numbers that are converted to fixed-point with a
  516. * multiple of 100,000, e.g., gamma
  517. */
  518. typedef png_int_32 png_fixed_point;
  519. /* Add typedefs for pointers */
  520. typedef void * png_voidp;
  521. typedef const void * png_const_voidp;
  522. typedef png_byte * png_bytep;
  523. typedef const png_byte * png_const_bytep;
  524. typedef png_uint_32 * png_uint_32p;
  525. typedef const png_uint_32 * png_const_uint_32p;
  526. typedef png_int_32 * png_int_32p;
  527. typedef const png_int_32 * png_const_int_32p;
  528. typedef png_uint_16 * png_uint_16p;
  529. typedef const png_uint_16 * png_const_uint_16p;
  530. typedef png_int_16 * png_int_16p;
  531. typedef const png_int_16 * png_const_int_16p;
  532. typedef char * png_charp;
  533. typedef const char * png_const_charp;
  534. typedef png_fixed_point * png_fixed_point_p;
  535. typedef const png_fixed_point * png_const_fixed_point_p;
  536. typedef png_size_t * png_size_tp;
  537. typedef const png_size_t * png_const_size_tp;
  538. #ifdef PNG_STDIO_SUPPORTED
  539. typedef FILE * png_FILE_p;
  540. #endif
  541. #ifdef PNG_FLOATING_POINT_SUPPORTED
  542. typedef double * png_doublep;
  543. typedef const double * png_const_doublep;
  544. #endif
  545. /* Pointers to pointers; i.e. arrays */
  546. typedef png_byte * * png_bytepp;
  547. typedef png_uint_32 * * png_uint_32pp;
  548. typedef png_int_32 * * png_int_32pp;
  549. typedef png_uint_16 * * png_uint_16pp;
  550. typedef png_int_16 * * png_int_16pp;
  551. typedef const char * * png_const_charpp;
  552. typedef char * * png_charpp;
  553. typedef png_fixed_point * * png_fixed_point_pp;
  554. #ifdef PNG_FLOATING_POINT_SUPPORTED
  555. typedef double * * png_doublepp;
  556. #endif
  557. /* Pointers to pointers to pointers; i.e., pointer to array */
  558. typedef char * * * png_charppp;
  559. #endif /* PNG_BUILDING_SYMBOL_TABLE */
  560. #endif /* PNGCONF_H */