pngconf.h 22 KB

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