pngconf.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  1. /* pngconf.h - machine-configurable file for libpng
  2. *
  3. * libpng version 1.6.48
  4. *
  5. * Copyright (c) 2018-2025 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. [Deprecated.]
  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(_WIN32) || defined(__WIN32__) || defined(__NT__) || \
  168. 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. # define PNG_DLL_EXPORT __declspec(dllexport)
  207. # ifndef PNG_DLL_IMPORT
  208. # define PNG_DLL_IMPORT __declspec(dllimport)
  209. # endif
  210. #else /* !Windows */
  211. # if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
  212. # define PNGAPI _System
  213. # else /* !Windows/x86 && !OS/2 */
  214. /* Use the defaults, or define PNG*API on the command line (but
  215. * this will have to be done for every compile!)
  216. */
  217. # endif /* other system, !OS/2 */
  218. #endif /* !Windows/x86 */
  219. /* Now do all the defaulting . */
  220. #ifndef PNGCAPI
  221. # define PNGCAPI
  222. #endif
  223. #ifndef PNGCBAPI
  224. # define PNGCBAPI PNGCAPI
  225. #endif
  226. #ifndef PNGAPI
  227. # define PNGAPI PNGCAPI
  228. #endif
  229. /* PNG_IMPEXP may be set on the compilation system command line or (if not set)
  230. * then in an internal header file when building the library, otherwise (when
  231. * using the library) it is set here.
  232. */
  233. #ifndef PNG_IMPEXP
  234. # if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT)
  235. /* This forces use of a DLL, disallowing static linking */
  236. # define PNG_IMPEXP PNG_DLL_IMPORT
  237. # endif
  238. # ifndef PNG_IMPEXP
  239. # define PNG_IMPEXP
  240. # endif
  241. #endif
  242. /* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat
  243. * 'attributes' as a storage class - the attributes go at the start of the
  244. * function definition, and attributes are always appended regardless of the
  245. * compiler. This considerably simplifies these macros but may cause problems
  246. * if any compilers both need function attributes and fail to handle them as
  247. * a storage class (this is unlikely.)
  248. */
  249. #ifndef PNG_FUNCTION
  250. # define PNG_FUNCTION(type, name, args, attributes) attributes type name args
  251. #endif
  252. #ifndef PNG_EXPORT_TYPE
  253. # define PNG_EXPORT_TYPE(type) PNG_IMPEXP type
  254. #endif
  255. /* The ordinal value is only relevant when preprocessing png.h for symbol
  256. * table entries, so we discard it here. See the .dfn files in the
  257. * scripts directory.
  258. */
  259. #ifndef PNG_EXPORTA
  260. # define PNG_EXPORTA(ordinal, type, name, args, attributes) \
  261. PNG_FUNCTION(PNG_EXPORT_TYPE(type), (PNGAPI name), args, \
  262. PNG_LINKAGE_API attributes)
  263. #endif
  264. /* ANSI-C (C90) does not permit a macro to be invoked with an empty argument,
  265. * so make something non-empty to satisfy the requirement:
  266. */
  267. #define PNG_EMPTY /*empty list*/
  268. #define PNG_EXPORT(ordinal, type, name, args) \
  269. PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY)
  270. /* Use PNG_REMOVED to comment out a removed interface. */
  271. #ifndef PNG_REMOVED
  272. # define PNG_REMOVED(ordinal, type, name, args, attributes)
  273. #endif
  274. #ifndef PNG_CALLBACK
  275. # define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) args
  276. #endif
  277. /* Support for compiler specific function attributes. These are used
  278. * so that where compiler support is available incorrect use of API
  279. * functions in png.h will generate compiler warnings.
  280. *
  281. * Added at libpng-1.2.41.
  282. */
  283. #ifndef PNG_NO_PEDANTIC_WARNINGS
  284. # ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED
  285. # define PNG_PEDANTIC_WARNINGS_SUPPORTED
  286. # endif
  287. #endif
  288. #ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED
  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. Added at libpng
  292. * version 1.2.41. Disabling these removes the warnings but may also produce
  293. * less efficient code.
  294. */
  295. # if defined(__clang__) && defined(__has_attribute)
  296. /* Clang defines both __clang__ and __GNUC__. Check __clang__ first. */
  297. # if !defined(PNG_USE_RESULT) && __has_attribute(__warn_unused_result__)
  298. # define PNG_USE_RESULT __attribute__((__warn_unused_result__))
  299. # endif
  300. # if !defined(PNG_NORETURN) && __has_attribute(__noreturn__)
  301. # define PNG_NORETURN __attribute__((__noreturn__))
  302. # endif
  303. # if !defined(PNG_ALLOCATED) && __has_attribute(__malloc__)
  304. # define PNG_ALLOCATED __attribute__((__malloc__))
  305. # endif
  306. # if !defined(PNG_DEPRECATED) && __has_attribute(__deprecated__)
  307. # define PNG_DEPRECATED __attribute__((__deprecated__))
  308. # endif
  309. # if !defined(PNG_PRIVATE)
  310. # ifdef __has_extension
  311. # if __has_extension(attribute_unavailable_with_message)
  312. # define PNG_PRIVATE __attribute__((__unavailable__(\
  313. "This function is not exported by libpng.")))
  314. # endif
  315. # endif
  316. # endif
  317. # ifndef PNG_RESTRICT
  318. # define PNG_RESTRICT __restrict
  319. # endif
  320. # elif defined(__GNUC__)
  321. # ifndef PNG_USE_RESULT
  322. # define PNG_USE_RESULT __attribute__((__warn_unused_result__))
  323. # endif
  324. # ifndef PNG_NORETURN
  325. # define PNG_NORETURN __attribute__((__noreturn__))
  326. # endif
  327. # if __GNUC__ >= 3
  328. # ifndef PNG_ALLOCATED
  329. # define PNG_ALLOCATED __attribute__((__malloc__))
  330. # endif
  331. # ifndef PNG_DEPRECATED
  332. # define PNG_DEPRECATED __attribute__((__deprecated__))
  333. # endif
  334. # ifndef PNG_PRIVATE
  335. # if 0 /* Doesn't work so we use deprecated instead*/
  336. # define PNG_PRIVATE \
  337. __attribute__((warning("This function is not exported by libpng.")))
  338. # else
  339. # define PNG_PRIVATE \
  340. __attribute__((__deprecated__))
  341. # endif
  342. # endif
  343. # if ((__GNUC__ > 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1))
  344. # ifndef PNG_RESTRICT
  345. # define PNG_RESTRICT __restrict
  346. # endif
  347. # endif /* __GNUC__.__GNUC_MINOR__ > 3.0 */
  348. # endif /* __GNUC__ >= 3 */
  349. # elif defined(_MSC_VER) && (_MSC_VER >= 1300)
  350. # ifndef PNG_USE_RESULT
  351. # define PNG_USE_RESULT /* not supported */
  352. # endif
  353. # ifndef PNG_NORETURN
  354. # define PNG_NORETURN __declspec(noreturn)
  355. # endif
  356. # ifndef PNG_ALLOCATED
  357. # if (_MSC_VER >= 1400)
  358. # define PNG_ALLOCATED __declspec(restrict)
  359. # endif
  360. # endif
  361. # ifndef PNG_DEPRECATED
  362. # define PNG_DEPRECATED __declspec(deprecated)
  363. # endif
  364. # ifndef PNG_PRIVATE
  365. # define PNG_PRIVATE __declspec(deprecated)
  366. # endif
  367. # ifndef PNG_RESTRICT
  368. # if (_MSC_VER >= 1400)
  369. # define PNG_RESTRICT __restrict
  370. # endif
  371. # endif
  372. # elif defined(__WATCOMC__)
  373. # ifndef PNG_RESTRICT
  374. # define PNG_RESTRICT __restrict
  375. # endif
  376. # endif
  377. #endif /* PNG_PEDANTIC_WARNINGS */
  378. #ifndef PNG_DEPRECATED
  379. # define PNG_DEPRECATED /* Use of this function is deprecated */
  380. #endif
  381. #ifndef PNG_USE_RESULT
  382. # define PNG_USE_RESULT /* The result of this function must be checked */
  383. #endif
  384. #ifndef PNG_NORETURN
  385. # define PNG_NORETURN /* This function does not return */
  386. #endif
  387. #ifndef PNG_ALLOCATED
  388. # define PNG_ALLOCATED /* The result of the function is new memory */
  389. #endif
  390. #ifndef PNG_PRIVATE
  391. # define PNG_PRIVATE /* This is a private libpng function */
  392. #endif
  393. #ifndef PNG_RESTRICT
  394. # define PNG_RESTRICT /* The C99 "restrict" feature */
  395. #endif
  396. #ifndef PNG_FP_EXPORT /* A floating point API. */
  397. # ifdef PNG_FLOATING_POINT_SUPPORTED
  398. # define PNG_FP_EXPORT(ordinal, type, name, args)\
  399. PNG_EXPORT(ordinal, type, name, args);
  400. # else /* No floating point APIs */
  401. # define PNG_FP_EXPORT(ordinal, type, name, args)
  402. # endif
  403. #endif
  404. #ifndef PNG_FIXED_EXPORT /* A fixed point API. */
  405. # ifdef PNG_FIXED_POINT_SUPPORTED
  406. # define PNG_FIXED_EXPORT(ordinal, type, name, args)\
  407. PNG_EXPORT(ordinal, type, name, args);
  408. # else /* No fixed point APIs */
  409. # define PNG_FIXED_EXPORT(ordinal, type, name, args)
  410. # endif
  411. #endif
  412. #ifndef PNG_BUILDING_SYMBOL_TABLE
  413. /* Some typedefs to get us started. These should be safe on most of the common
  414. * platforms.
  415. *
  416. * png_uint_32 and png_int_32 may, currently, be larger than required to hold a
  417. * 32-bit value however this is not normally advisable.
  418. *
  419. * png_uint_16 and png_int_16 should always be two bytes in size - this is
  420. * verified at library build time.
  421. *
  422. * png_byte must always be one byte in size.
  423. *
  424. * The checks below use constants from limits.h, as defined by the ISOC90
  425. * standard.
  426. */
  427. #if CHAR_BIT == 8 && UCHAR_MAX == 255
  428. typedef unsigned char png_byte;
  429. #else
  430. # error libpng requires 8-bit bytes
  431. #endif
  432. #if INT_MIN == -32768 && INT_MAX == 32767
  433. typedef int png_int_16;
  434. #elif SHRT_MIN == -32768 && SHRT_MAX == 32767
  435. typedef short png_int_16;
  436. #else
  437. # error libpng requires a signed 16-bit integer type
  438. #endif
  439. #if UINT_MAX == 65535
  440. typedef unsigned int png_uint_16;
  441. #elif USHRT_MAX == 65535
  442. typedef unsigned short png_uint_16;
  443. #else
  444. # error libpng requires an unsigned 16-bit integer type
  445. #endif
  446. #if INT_MIN < -2147483646 && INT_MAX > 2147483646
  447. typedef int png_int_32;
  448. #elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646
  449. typedef long int png_int_32;
  450. #else
  451. # error libpng requires a signed 32-bit (or longer) integer type
  452. #endif
  453. #if UINT_MAX > 4294967294U
  454. typedef unsigned int png_uint_32;
  455. #elif ULONG_MAX > 4294967294U
  456. typedef unsigned long int png_uint_32;
  457. #else
  458. # error libpng requires an unsigned 32-bit (or longer) integer type
  459. #endif
  460. /* Prior to 1.6.0, it was possible to disable the use of size_t and ptrdiff_t.
  461. * From 1.6.0 onwards, an ISO C90 compiler, as well as a standard-compliant
  462. * behavior of sizeof and ptrdiff_t are required.
  463. * The legacy typedefs are provided here for backwards compatibility.
  464. */
  465. typedef size_t png_size_t;
  466. typedef ptrdiff_t png_ptrdiff_t;
  467. /* libpng needs to know the maximum value of 'size_t' and this controls the
  468. * definition of png_alloc_size_t, below. This maximum value of size_t limits
  469. * but does not control the maximum allocations the library makes - there is
  470. * direct application control of this through png_set_user_limits().
  471. */
  472. #ifndef PNG_SMALL_SIZE_T
  473. /* Compiler specific tests for systems where size_t is known to be less than
  474. * 32 bits (some of these systems may no longer work because of the lack of
  475. * 'far' support; see above.)
  476. */
  477. # if (defined(__TURBOC__) && !defined(__FLAT__)) ||\
  478. (defined(_MSC_VER) && defined(MAXSEG_64K))
  479. # define PNG_SMALL_SIZE_T
  480. # endif
  481. #endif
  482. /* png_alloc_size_t is guaranteed to be no smaller than size_t, and no smaller
  483. * than png_uint_32. Casts from size_t or png_uint_32 to png_alloc_size_t are
  484. * not necessary; in fact, it is recommended not to use them at all, so that
  485. * the compiler can complain when something turns out to be problematic.
  486. *
  487. * Casts in the other direction (from png_alloc_size_t to size_t or
  488. * png_uint_32) should be explicitly applied; however, we do not expect to
  489. * encounter practical situations that require such conversions.
  490. *
  491. * PNG_SMALL_SIZE_T must be defined if the maximum value of size_t is less than
  492. * 4294967295 - i.e. less than the maximum value of png_uint_32.
  493. */
  494. #ifdef PNG_SMALL_SIZE_T
  495. typedef png_uint_32 png_alloc_size_t;
  496. #else
  497. typedef size_t png_alloc_size_t;
  498. #endif
  499. /* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler
  500. * implementations of Intel CPU specific support of user-mode segmented address
  501. * spaces, where 16-bit pointers address more than 65536 bytes of memory using
  502. * separate 'segment' registers. The implementation requires two different
  503. * types of pointer (only one of which includes the segment value.)
  504. *
  505. * If required this support is available in version 1.2 of libpng and may be
  506. * available in versions through 1.5, although the correctness of the code has
  507. * not been verified recently.
  508. */
  509. /* Typedef for floating-point numbers that are converted to fixed-point with a
  510. * multiple of 100,000, e.g., gamma
  511. */
  512. typedef png_int_32 png_fixed_point;
  513. /* Add typedefs for pointers */
  514. typedef void * png_voidp;
  515. typedef const void * png_const_voidp;
  516. typedef png_byte * png_bytep;
  517. typedef const png_byte * png_const_bytep;
  518. typedef png_uint_32 * png_uint_32p;
  519. typedef const png_uint_32 * png_const_uint_32p;
  520. typedef png_int_32 * png_int_32p;
  521. typedef const png_int_32 * png_const_int_32p;
  522. typedef png_uint_16 * png_uint_16p;
  523. typedef const png_uint_16 * png_const_uint_16p;
  524. typedef png_int_16 * png_int_16p;
  525. typedef const png_int_16 * png_const_int_16p;
  526. typedef char * png_charp;
  527. typedef const char * png_const_charp;
  528. typedef png_fixed_point * png_fixed_point_p;
  529. typedef const png_fixed_point * png_const_fixed_point_p;
  530. typedef size_t * png_size_tp;
  531. typedef const size_t * png_const_size_tp;
  532. #ifdef PNG_FLOATING_POINT_SUPPORTED
  533. typedef double * png_doublep;
  534. typedef const double * png_const_doublep;
  535. #endif
  536. /* Pointers to pointers; i.e. arrays */
  537. typedef png_byte * * png_bytepp;
  538. typedef png_uint_32 * * png_uint_32pp;
  539. typedef png_int_32 * * png_int_32pp;
  540. typedef png_uint_16 * * png_uint_16pp;
  541. typedef png_int_16 * * png_int_16pp;
  542. typedef const char * * png_const_charpp;
  543. typedef char * * png_charpp;
  544. typedef png_fixed_point * * png_fixed_point_pp;
  545. #ifdef PNG_FLOATING_POINT_SUPPORTED
  546. typedef double * * png_doublepp;
  547. #endif
  548. /* Pointers to pointers to pointers; i.e., pointer to array */
  549. typedef char * * * png_charppp;
  550. #ifdef PNG_STDIO_SUPPORTED
  551. /* With PNG_STDIO_SUPPORTED it was possible to use I/O streams that were
  552. * not necessarily stdio FILE streams, to allow building Windows applications
  553. * before Win32 and Windows CE applications before WinCE 3.0, but that kind
  554. * of support has long been discontinued.
  555. */
  556. typedef FILE * png_FILE_p; /* [Deprecated] */
  557. #endif
  558. #endif /* PNG_BUILDING_SYMBOL_TABLE */
  559. #endif /* PNGCONF_H */