pngconf.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  1. /* pngconf.h - machine configurable file for libpng
  2. *
  3. * libpng version 1.5.26, December 17, 2015
  4. *
  5. * Copyright (c) 1998-2002,2004,2006-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. * Any machine specific code is near the front of this file, so if you
  14. * are configuring libpng for a machine, you may want to read the section
  15. * starting here down to where it starts to typedef png_color, png_text,
  16. * and png_info.
  17. */
  18. #ifndef PNGCONF_H
  19. #define PNGCONF_H
  20. #ifndef PNG_BUILDING_SYMBOL_TABLE
  21. /* PNG_NO_LIMITS_H may be used to turn off the use of the standard C
  22. * definition file for machine specific limits, this may impact the
  23. * correctness of the definitions below (see uses of INT_MAX).
  24. */
  25. # ifndef PNG_NO_LIMITS_H
  26. # include <limits.h>
  27. # endif
  28. /* For the memory copy APIs (i.e. the standard definitions of these),
  29. * because this file defines png_memcpy and so on the base APIs must
  30. * be defined here.
  31. */
  32. # ifdef BSD
  33. # include <strings.h>
  34. # else
  35. # include <string.h>
  36. # endif
  37. /* For png_FILE_p - this provides the standard definition of a
  38. * FILE
  39. */
  40. # ifdef PNG_STDIO_SUPPORTED
  41. # include <stdio.h>
  42. # endif
  43. #endif
  44. /* This controls optimization of the reading of 16 and 32 bit values
  45. * from PNG files. It can be set on a per-app-file basis - it
  46. * just changes whether a macro is used when the function is called.
  47. * The library builder sets the default; if read functions are not
  48. * built into the library the macro implementation is forced on.
  49. */
  50. #ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED
  51. # define PNG_USE_READ_MACROS
  52. #endif
  53. #if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS)
  54. # if PNG_DEFAULT_READ_MACROS
  55. # define PNG_USE_READ_MACROS
  56. # endif
  57. #endif
  58. /* COMPILER SPECIFIC OPTIONS.
  59. *
  60. * These options are provided so that a variety of difficult compilers
  61. * can be used. Some are fixed at build time (e.g. PNG_API_RULE
  62. * below) but still have compiler specific implementations, others
  63. * may be changed on a per-file basis when compiling against libpng.
  64. */
  65. /* The PNGARG macro protects us against machines that don't have function
  66. * prototypes (ie K&R style headers). If your compiler does not handle
  67. * function prototypes, define this macro and use the included ansi2knr.
  68. * I've always been able to use _NO_PROTO as the indicator, but you may
  69. * need to drag the empty declaration out in front of here, or change the
  70. * ifdef to suit your own needs.
  71. */
  72. #ifndef PNGARG
  73. # ifdef OF /* zlib prototype munger */
  74. # define PNGARG(arglist) OF(arglist)
  75. # else
  76. # ifdef _NO_PROTO
  77. # define PNGARG(arglist) ()
  78. # else
  79. # define PNGARG(arglist) arglist
  80. # endif /* _NO_PROTO */
  81. # endif /* OF */
  82. #endif /* PNGARG */
  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 sytems) 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. extern 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.
  305. */
  306. # if defined(__GNUC__)
  307. # ifndef PNG_USE_RESULT
  308. # define PNG_USE_RESULT __attribute__((__warn_unused_result__))
  309. # endif
  310. # ifndef PNG_NORETURN
  311. # define PNG_NORETURN __attribute__((__noreturn__))
  312. # endif
  313. # if __GNUC__ >= 3
  314. # ifndef PNG_ALLOCATED
  315. # define PNG_ALLOCATED __attribute__((__malloc__))
  316. # endif
  317. # ifndef PNG_DEPRECATED
  318. # define PNG_DEPRECATED __attribute__((__deprecated__))
  319. # endif
  320. # ifndef PNG_PRIVATE
  321. # if 0 /* Doesn't work so we use deprecated instead*/
  322. # define PNG_PRIVATE \
  323. __attribute__((warning("This function is not exported by libpng.")))
  324. # else
  325. # define PNG_PRIVATE \
  326. __attribute__((__deprecated__))
  327. # endif
  328. # endif
  329. # endif /* __GNUC__ >= 3 */
  330. # endif /* __GNUC__ */
  331. # if defined(_MSC_VER) && (_MSC_VER >= 1300)
  332. # ifndef PNG_USE_RESULT
  333. # define PNG_USE_RESULT /* not supported */
  334. # endif
  335. # ifndef PNG_NORETURN
  336. # define PNG_NORETURN __declspec(noreturn)
  337. # endif
  338. # ifndef PNG_ALLOCATED
  339. # if (_MSC_VER >= 1400)
  340. # define PNG_ALLOCATED __declspec(restrict)
  341. # endif
  342. # endif
  343. # ifndef PNG_DEPRECATED
  344. # define PNG_DEPRECATED __declspec(deprecated)
  345. # endif
  346. # ifndef PNG_PRIVATE
  347. # define PNG_PRIVATE __declspec(deprecated)
  348. # endif
  349. # endif /* _MSC_VER */
  350. #endif /* PNG_PEDANTIC_WARNINGS */
  351. #ifndef PNG_DEPRECATED
  352. # define PNG_DEPRECATED /* Use of this function is deprecated */
  353. #endif
  354. #ifndef PNG_USE_RESULT
  355. # define PNG_USE_RESULT /* The result of this function must be checked */
  356. #endif
  357. #ifndef PNG_NORETURN
  358. # define PNG_NORETURN /* This function does not return */
  359. #endif
  360. #ifndef PNG_ALLOCATED
  361. # define PNG_ALLOCATED /* The result of the function is new memory */
  362. #endif
  363. #ifndef PNG_PRIVATE
  364. # define PNG_PRIVATE /* This is a private libpng function */
  365. #endif
  366. #ifndef PNG_FP_EXPORT /* A floating point API. */
  367. # ifdef PNG_FLOATING_POINT_SUPPORTED
  368. # define PNG_FP_EXPORT(ordinal, type, name, args)\
  369. PNG_EXPORT(ordinal, type, name, args);
  370. # else /* No floating point APIs */
  371. # define PNG_FP_EXPORT(ordinal, type, name, args)
  372. # endif
  373. #endif
  374. #ifndef PNG_FIXED_EXPORT /* A fixed point API. */
  375. # ifdef PNG_FIXED_POINT_SUPPORTED
  376. # define PNG_FIXED_EXPORT(ordinal, type, name, args)\
  377. PNG_EXPORT(ordinal, type, name, args);
  378. # else /* No fixed point APIs */
  379. # define PNG_FIXED_EXPORT(ordinal, type, name, args)
  380. # endif
  381. #endif
  382. /* The following uses const char * instead of char * for error
  383. * and warning message functions, so some compilers won't complain.
  384. * If you do not want to use const, define PNG_NO_CONST here.
  385. *
  386. * This should not change how the APIs are called, so it can be done
  387. * on a per-file basis in the application.
  388. */
  389. #ifndef PNG_CONST
  390. # ifndef PNG_NO_CONST
  391. # define PNG_CONST const
  392. # else
  393. # define PNG_CONST
  394. # endif
  395. #endif
  396. /* Some typedefs to get us started. These should be safe on most of the
  397. * common platforms. The typedefs should be at least as large as the
  398. * numbers suggest (a png_uint_32 must be at least 32 bits long), but they
  399. * don't have to be exactly that size. Some compilers dislike passing
  400. * unsigned shorts as function parameters, so you may be better off using
  401. * unsigned int for png_uint_16.
  402. */
  403. #if defined(INT_MAX) && (INT_MAX > 0x7ffffffeL)
  404. typedef unsigned int png_uint_32;
  405. typedef int png_int_32;
  406. #else
  407. typedef unsigned long png_uint_32;
  408. typedef long png_int_32;
  409. #endif
  410. typedef unsigned short png_uint_16;
  411. typedef short png_int_16;
  412. typedef unsigned char png_byte;
  413. #ifdef PNG_NO_SIZE_T
  414. typedef unsigned int png_size_t;
  415. #else
  416. typedef size_t png_size_t;
  417. #endif
  418. #define png_sizeof(x) (sizeof (x))
  419. /* The following is needed for medium model support. It cannot be in the
  420. * pngpriv.h header. Needs modification for other compilers besides
  421. * MSC. Model independent support declares all arrays and pointers to be
  422. * large using the far keyword. The zlib version used must also support
  423. * model independent data. As of version zlib 1.0.4, the necessary changes
  424. * have been made in zlib. The USE_FAR_KEYWORD define triggers other
  425. * changes that are needed. (Tim Wegner)
  426. */
  427. /* Separate compiler dependencies (problem here is that zlib.h always
  428. * defines FAR. (SJT)
  429. */
  430. #ifdef __BORLANDC__
  431. # if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
  432. # define LDATA 1
  433. # else
  434. # define LDATA 0
  435. # endif
  436. /* GRR: why is Cygwin in here? Cygwin is not Borland C... */
  437. # if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__)
  438. # define PNG_MAX_MALLOC_64K /* only used in build */
  439. # if (LDATA != 1)
  440. # ifndef FAR
  441. # define FAR __far
  442. # endif
  443. # define USE_FAR_KEYWORD
  444. # endif /* LDATA != 1 */
  445. /* Possibly useful for moving data out of default segment.
  446. * Uncomment it if you want. Could also define FARDATA as
  447. * const if your compiler supports it. (SJT)
  448. # define FARDATA FAR
  449. */
  450. # endif /* __WIN32__, __FLAT__, __CYGWIN__ */
  451. #endif /* __BORLANDC__ */
  452. /* Suggest testing for specific compiler first before testing for
  453. * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM,
  454. * making reliance oncertain keywords suspect. (SJT)
  455. */
  456. /* MSC Medium model */
  457. #ifdef FAR
  458. # ifdef M_I86MM
  459. # define USE_FAR_KEYWORD
  460. # define FARDATA FAR
  461. # include <dos.h>
  462. # endif
  463. #endif
  464. /* SJT: default case */
  465. #ifndef FAR
  466. # define FAR
  467. #endif
  468. /* At this point FAR is always defined */
  469. #ifndef FARDATA
  470. # define FARDATA
  471. #endif
  472. /* Typedef for floating-point numbers that are converted
  473. * to fixed-point with a multiple of 100,000, e.g., gamma
  474. */
  475. typedef png_int_32 png_fixed_point;
  476. /* Add typedefs for pointers */
  477. typedef void FAR * png_voidp;
  478. typedef PNG_CONST void FAR * png_const_voidp;
  479. typedef png_byte FAR * png_bytep;
  480. typedef PNG_CONST png_byte FAR * png_const_bytep;
  481. typedef png_uint_32 FAR * png_uint_32p;
  482. typedef PNG_CONST png_uint_32 FAR * png_const_uint_32p;
  483. typedef png_int_32 FAR * png_int_32p;
  484. typedef PNG_CONST png_int_32 FAR * png_const_int_32p;
  485. typedef png_uint_16 FAR * png_uint_16p;
  486. typedef PNG_CONST png_uint_16 FAR * png_const_uint_16p;
  487. typedef png_int_16 FAR * png_int_16p;
  488. typedef PNG_CONST png_int_16 FAR * png_const_int_16p;
  489. typedef char FAR * png_charp;
  490. typedef PNG_CONST char FAR * png_const_charp;
  491. typedef png_fixed_point FAR * png_fixed_point_p;
  492. typedef PNG_CONST png_fixed_point FAR * png_const_fixed_point_p;
  493. typedef png_size_t FAR * png_size_tp;
  494. typedef PNG_CONST png_size_t FAR * png_const_size_tp;
  495. #ifdef PNG_STDIO_SUPPORTED
  496. typedef FILE * png_FILE_p;
  497. #endif
  498. #ifdef PNG_FLOATING_POINT_SUPPORTED
  499. typedef double FAR * png_doublep;
  500. typedef PNG_CONST double FAR * png_const_doublep;
  501. #endif
  502. /* Pointers to pointers; i.e. arrays */
  503. typedef png_byte FAR * FAR * png_bytepp;
  504. typedef png_uint_32 FAR * FAR * png_uint_32pp;
  505. typedef png_int_32 FAR * FAR * png_int_32pp;
  506. typedef png_uint_16 FAR * FAR * png_uint_16pp;
  507. typedef png_int_16 FAR * FAR * png_int_16pp;
  508. typedef PNG_CONST char FAR * FAR * png_const_charpp;
  509. typedef char FAR * FAR * png_charpp;
  510. typedef png_fixed_point FAR * FAR * png_fixed_point_pp;
  511. #ifdef PNG_FLOATING_POINT_SUPPORTED
  512. typedef double FAR * FAR * png_doublepp;
  513. #endif
  514. /* Pointers to pointers to pointers; i.e., pointer to array */
  515. typedef char FAR * FAR * FAR * png_charppp;
  516. /* png_alloc_size_t is guaranteed to be no smaller than png_size_t,
  517. * and no smaller than png_uint_32. Casts from png_size_t or png_uint_32
  518. * to png_alloc_size_t are not necessary; in fact, it is recommended
  519. * not to use them at all so that the compiler can complain when something
  520. * turns out to be problematic.
  521. * Casts in the other direction (from png_alloc_size_t to png_size_t or
  522. * png_uint_32) should be explicitly applied; however, we do not expect
  523. * to encounter practical situations that require such conversions.
  524. */
  525. #if defined(__TURBOC__) && !defined(__FLAT__)
  526. typedef unsigned long png_alloc_size_t;
  527. #else
  528. # if defined(_MSC_VER) && defined(MAXSEG_64K)
  529. typedef unsigned long png_alloc_size_t;
  530. # else
  531. /* This is an attempt to detect an old Windows system where (int) is
  532. * actually 16 bits, in that case png_malloc must have an argument with a
  533. * bigger size to accomodate the requirements of the library.
  534. */
  535. # if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_)) && \
  536. (!defined(INT_MAX) || INT_MAX <= 0x7ffffffeL)
  537. typedef DWORD png_alloc_size_t;
  538. # else
  539. typedef png_size_t png_alloc_size_t;
  540. # endif
  541. # endif
  542. #endif
  543. #endif /* PNGCONF_H */