pngconf.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  1. /* pngconf.h - machine configurable file for libpng
  2. *
  3. * libpng version 1.5.9 - February 18, 2012
  4. *
  5. * Copyright (c) 1998-2012 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. #ifndef PNG_BUILDING_SYMBOL_TABLE
  22. /* PNG_NO_LIMITS_H may be used to turn off the use of the standard C
  23. * definition file for machine specific limits, this may impact the
  24. * correctness of the definitons below (see uses of INT_MAX).
  25. */
  26. # ifndef PNG_NO_LIMITS_H
  27. # include <limits.h>
  28. # endif
  29. /* For the memory copy APIs (i.e. the standard definitions of these),
  30. * because this file defines png_memcpy and so on the base APIs must
  31. * be defined here.
  32. */
  33. # ifdef BSD
  34. # include <strings.h>
  35. # else
  36. # include <string.h>
  37. # endif
  38. /* For png_FILE_p - this provides the standard definition of a
  39. * FILE
  40. */
  41. # ifdef PNG_STDIO_SUPPORTED
  42. # include <stdio.h>
  43. # endif
  44. #endif
  45. /* This controls optimization of the reading of 16 and 32 bit values
  46. * from PNG files. It can be set on a per-app-file basis - it
  47. * just changes whether a macro is used to the function is called.
  48. * The library builder sets the default, if read functions are not
  49. * built into the library the macro implementation is forced on.
  50. */
  51. #ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED
  52. # define PNG_USE_READ_MACROS
  53. #endif
  54. #if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS)
  55. # if PNG_DEFAULT_READ_MACROS
  56. # define PNG_USE_READ_MACROS
  57. # endif
  58. #endif
  59. /* COMPILER SPECIFIC OPTIONS.
  60. *
  61. * These options are provided so that a variety of difficult compilers
  62. * can be used. Some are fixed at build time (e.g. PNG_API_RULE
  63. * below) but still have compiler specific implementations, others
  64. * may be changed on a per-file basis when compiling against libpng.
  65. */
  66. /* The PNGARG macro protects us against machines that don't have function
  67. * prototypes (ie K&R style headers). If your compiler does not handle
  68. * function prototypes, define this macro and use the included ansi2knr.
  69. * I've always been able to use _NO_PROTO as the indicator, but you may
  70. * need to drag the empty declaration out in front of here, or change the
  71. * ifdef to suit your own needs.
  72. */
  73. #ifndef PNGARG
  74. # ifdef OF /* zlib prototype munger */
  75. # define PNGARG(arglist) OF(arglist)
  76. # else
  77. # ifdef _NO_PROTO
  78. # define PNGARG(arglist) ()
  79. # else
  80. # define PNGARG(arglist) arglist
  81. # endif /* _NO_PROTO */
  82. # endif /* OF */
  83. #endif /* PNGARG */
  84. /* Function calling conventions.
  85. * =============================
  86. * Normally it is not necessary to specify to the compiler how to call
  87. * a function - it just does it - however on x86 systems derived from
  88. * Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems
  89. * and some others) there are multiple ways to call a function and the
  90. * default can be changed on the compiler command line. For this reason
  91. * libpng specifies the calling convention of every exported function and
  92. * every function called via a user supplied function pointer. This is
  93. * done in this file by defining the following macros:
  94. *
  95. * PNGAPI Calling convention for exported functions.
  96. * PNGCBAPI Calling convention for user provided (callback) functions.
  97. * PNGCAPI Calling convention used by the ANSI-C library (required
  98. * for longjmp callbacks and sometimes used internally to
  99. * specify the calling convention for zlib).
  100. *
  101. * These macros should never be overridden. If it is necessary to
  102. * change calling convention in a private build this can be done
  103. * by setting PNG_API_RULE (which defaults to 0) to one of the values
  104. * below to select the correct 'API' variants.
  105. *
  106. * PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout.
  107. * This is correct in every known environment.
  108. * PNG_API_RULE=1 Use the operating system convention for PNGAPI and
  109. * the 'C' calling convention (from PNGCAPI) for
  110. * callbacks (PNGCBAPI). This is no longer required
  111. * in any known environment - if it has to be used
  112. * please post an explanation of the problem to the
  113. * libpng mailing list.
  114. *
  115. * These cases only differ if the operating system does not use the C
  116. * calling convention, at present this just means the above cases
  117. * (x86 DOS/Windows sytems) and, even then, this does not apply to
  118. * Cygwin running on those systems.
  119. *
  120. * Note that the value must be defined in pnglibconf.h so that what
  121. * the application uses to call the library matches the conventions
  122. * set when building the library.
  123. */
  124. /* Symbol export
  125. * =============
  126. * When building a shared library it is almost always necessary to tell
  127. * the compiler which symbols to export. The png.h macro 'PNG_EXPORT'
  128. * is used to mark the symbols. On some systems these symbols can be
  129. * extracted at link time and need no special processing by the compiler,
  130. * on other systems the symbols are flagged by the compiler and just
  131. * the declaration requires a special tag applied (unfortunately) in a
  132. * compiler dependent way. Some systems can do either.
  133. *
  134. * A small number of older systems also require a symbol from a DLL to
  135. * be flagged to the program that calls it. This is a problem because
  136. * we do not know in the header file included by application code that
  137. * the symbol will come from a shared library, as opposed to a statically
  138. * linked one. For this reason the application must tell us by setting
  139. * the magic flag PNG_USE_DLL to turn on the special processing before
  140. * it includes png.h.
  141. *
  142. * Four additional macros are used to make this happen:
  143. *
  144. * PNG_IMPEXP The magic (if any) to cause a symbol to be exported from
  145. * the build or imported if PNG_USE_DLL is set - compiler
  146. * and system specific.
  147. *
  148. * PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to
  149. * 'type', compiler specific.
  150. *
  151. * PNG_DLL_EXPORT Set to the magic to use during a libpng build to
  152. * make a symbol exported from the DLL. Not used in the
  153. * public header files; see pngpriv.h for how it is used
  154. * in the libpng build.
  155. *
  156. * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come
  157. * from a DLL - used to define PNG_IMPEXP when
  158. * PNG_USE_DLL is set.
  159. */
  160. /* System specific discovery.
  161. * ==========================
  162. * This code is used at build time to find PNG_IMPEXP, the API settings
  163. * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL
  164. * import processing is possible. On Windows/x86 systems it also sets
  165. * compiler-specific macros to the values required to change the calling
  166. * conventions of the various functions.
  167. */
  168. #if ( defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\
  169. defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) ) &&\
  170. ( defined(_X86_) || defined(_X64_) || defined(_M_IX86) ||\
  171. defined(_M_X64) || defined(_M_IA64) )
  172. /* Windows system (DOS doesn't support DLLs) running on x86/x64. Includes
  173. * builds under Cygwin or MinGW. Also includes Watcom builds but these need
  174. * special treatment because they are not compatible with GCC or Visual C
  175. * because of different calling conventions.
  176. */
  177. # if PNG_API_RULE == 2
  178. /* If this line results in an error, either because __watcall is not
  179. * understood or because of a redefine just below you cannot use *this*
  180. * build of the library with the compiler you are using. *This* build was
  181. * build using Watcom and applications must also be built using Watcom!
  182. */
  183. # define PNGCAPI __watcall
  184. # endif
  185. # if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
  186. # define PNGCAPI __cdecl
  187. # if PNG_API_RULE == 1
  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/x86 */
  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. # ifndef PNG_ALLOCATED
  314. # define PNG_ALLOCATED __attribute__((__malloc__))
  315. # endif
  316. # ifndef PNG_DEPRECATED
  317. # define PNG_DEPRECATED __attribute__((__deprecated__))
  318. # endif
  319. # ifndef PNG_PRIVATE
  320. # if 0 /* Doesn't work so we use deprecated instead*/
  321. # define PNG_PRIVATE \
  322. __attribute__((warning("This function is not exported by libpng.")))
  323. # else
  324. # define PNG_PRIVATE \
  325. __attribute__((__deprecated__))
  326. # endif
  327. # endif
  328. # endif /* __GNUC__ */
  329. # if defined(_MSC_VER) && (_MSC_VER >= 1300)
  330. # ifndef PNG_USE_RESULT
  331. # define PNG_USE_RESULT /* not supported */
  332. # endif
  333. # ifndef PNG_NORETURN
  334. # define PNG_NORETURN __declspec(noreturn)
  335. # endif
  336. # ifndef PNG_ALLOCATED
  337. # if (_MSC_VER >= 1400)
  338. # define PNG_ALLOCATED __declspec(restrict)
  339. # endif
  340. # endif
  341. # ifndef PNG_DEPRECATED
  342. # define PNG_DEPRECATED __declspec(deprecated)
  343. # endif
  344. # ifndef PNG_PRIVATE
  345. # define PNG_PRIVATE __declspec(deprecated)
  346. # endif
  347. # endif /* _MSC_VER */
  348. #endif /* PNG_PEDANTIC_WARNINGS */
  349. #ifndef PNG_DEPRECATED
  350. # define PNG_DEPRECATED /* Use of this function is deprecated */
  351. #endif
  352. #ifndef PNG_USE_RESULT
  353. # define PNG_USE_RESULT /* The result of this function must be checked */
  354. #endif
  355. #ifndef PNG_NORETURN
  356. # define PNG_NORETURN /* This function does not return */
  357. #endif
  358. #ifndef PNG_ALLOCATED
  359. # define PNG_ALLOCATED /* The result of the function is new memory */
  360. #endif
  361. #ifndef PNG_PRIVATE
  362. # define PNG_PRIVATE /* This is a private libpng function */
  363. #endif
  364. #ifndef PNG_FP_EXPORT /* A floating point API. */
  365. # ifdef PNG_FLOATING_POINT_SUPPORTED
  366. # define PNG_FP_EXPORT(ordinal, type, name, args)\
  367. PNG_EXPORT(ordinal, type, name, args)
  368. # else /* No floating point APIs */
  369. # define PNG_FP_EXPORT(ordinal, type, name, args)
  370. # endif
  371. #endif
  372. #ifndef PNG_FIXED_EXPORT /* A fixed point API. */
  373. # ifdef PNG_FIXED_POINT_SUPPORTED
  374. # define PNG_FIXED_EXPORT(ordinal, type, name, args)\
  375. PNG_EXPORT(ordinal, type, name, args)
  376. # else /* No fixed point APIs */
  377. # define PNG_FIXED_EXPORT(ordinal, type, name, args)
  378. # endif
  379. #endif
  380. /* The following uses const char * instead of char * for error
  381. * and warning message functions, so some compilers won't complain.
  382. * If you do not want to use const, define PNG_NO_CONST here.
  383. *
  384. * This should not change how the APIs are called, so it can be done
  385. * on a per-file basis in the application.
  386. */
  387. #ifndef PNG_CONST
  388. # ifndef PNG_NO_CONST
  389. # define PNG_CONST const
  390. # else
  391. # define PNG_CONST
  392. # endif
  393. #endif
  394. /* Some typedefs to get us started. These should be safe on most of the
  395. * common platforms. The typedefs should be at least as large as the
  396. * numbers suggest (a png_uint_32 must be at least 32 bits long), but they
  397. * don't have to be exactly that size. Some compilers dislike passing
  398. * unsigned shorts as function parameters, so you may be better off using
  399. * unsigned int for png_uint_16.
  400. */
  401. #if defined(INT_MAX) && (INT_MAX > 0x7ffffffeL)
  402. typedef unsigned int png_uint_32;
  403. typedef int png_int_32;
  404. #else
  405. typedef unsigned long png_uint_32;
  406. typedef long png_int_32;
  407. #endif
  408. typedef unsigned short png_uint_16;
  409. typedef short png_int_16;
  410. typedef unsigned char png_byte;
  411. #ifdef PNG_NO_SIZE_T
  412. typedef unsigned int png_size_t;
  413. #else
  414. typedef size_t png_size_t;
  415. #endif
  416. #define png_sizeof(x) (sizeof (x))
  417. /* The following is needed for medium model support. It cannot be in the
  418. * pngpriv.h header. Needs modification for other compilers besides
  419. * MSC. Model independent support declares all arrays and pointers to be
  420. * large using the far keyword. The zlib version used must also support
  421. * model independent data. As of version zlib 1.0.4, the necessary changes
  422. * have been made in zlib. The USE_FAR_KEYWORD define triggers other
  423. * changes that are needed. (Tim Wegner)
  424. */
  425. /* Separate compiler dependencies (problem here is that zlib.h always
  426. * defines FAR. (SJT)
  427. */
  428. #ifdef __BORLANDC__
  429. # if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
  430. # define LDATA 1
  431. # else
  432. # define LDATA 0
  433. # endif
  434. /* GRR: why is Cygwin in here? Cygwin is not Borland C... */
  435. # if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__)
  436. # define PNG_MAX_MALLOC_64K /* only used in build */
  437. # if (LDATA != 1)
  438. # ifndef FAR
  439. # define FAR __far
  440. # endif
  441. # define USE_FAR_KEYWORD
  442. # endif /* LDATA != 1 */
  443. /* Possibly useful for moving data out of default segment.
  444. * Uncomment it if you want. Could also define FARDATA as
  445. * const if your compiler supports it. (SJT)
  446. # define FARDATA FAR
  447. */
  448. # endif /* __WIN32__, __FLAT__, __CYGWIN__ */
  449. #endif /* __BORLANDC__ */
  450. /* Suggest testing for specific compiler first before testing for
  451. * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM,
  452. * making reliance oncertain keywords suspect. (SJT)
  453. */
  454. /* MSC Medium model */
  455. #ifdef FAR
  456. # ifdef M_I86MM
  457. # define USE_FAR_KEYWORD
  458. # define FARDATA FAR
  459. # include <dos.h>
  460. # endif
  461. #endif
  462. /* SJT: default case */
  463. #ifndef FAR
  464. # define FAR
  465. #endif
  466. /* At this point FAR is always defined */
  467. #ifndef FARDATA
  468. # define FARDATA
  469. #endif
  470. /* Typedef for floating-point numbers that are converted
  471. * to fixed-point with a multiple of 100,000, e.g., gamma
  472. */
  473. typedef png_int_32 png_fixed_point;
  474. /* Add typedefs for pointers */
  475. typedef void FAR * png_voidp;
  476. typedef PNG_CONST void FAR * png_const_voidp;
  477. typedef png_byte FAR * png_bytep;
  478. typedef PNG_CONST png_byte FAR * png_const_bytep;
  479. typedef png_uint_32 FAR * png_uint_32p;
  480. typedef PNG_CONST png_uint_32 FAR * png_const_uint_32p;
  481. typedef png_int_32 FAR * png_int_32p;
  482. typedef PNG_CONST png_int_32 FAR * png_const_int_32p;
  483. typedef png_uint_16 FAR * png_uint_16p;
  484. typedef PNG_CONST png_uint_16 FAR * png_const_uint_16p;
  485. typedef png_int_16 FAR * png_int_16p;
  486. typedef PNG_CONST png_int_16 FAR * png_const_int_16p;
  487. typedef char FAR * png_charp;
  488. typedef PNG_CONST char FAR * png_const_charp;
  489. typedef png_fixed_point FAR * png_fixed_point_p;
  490. typedef PNG_CONST png_fixed_point FAR * png_const_fixed_point_p;
  491. typedef png_size_t FAR * png_size_tp;
  492. typedef PNG_CONST png_size_t FAR * png_const_size_tp;
  493. #ifdef PNG_STDIO_SUPPORTED
  494. typedef FILE * png_FILE_p;
  495. #endif
  496. #ifdef PNG_FLOATING_POINT_SUPPORTED
  497. typedef double FAR * png_doublep;
  498. typedef PNG_CONST double FAR * png_const_doublep;
  499. #endif
  500. /* Pointers to pointers; i.e. arrays */
  501. typedef png_byte FAR * FAR * png_bytepp;
  502. typedef png_uint_32 FAR * FAR * png_uint_32pp;
  503. typedef png_int_32 FAR * FAR * png_int_32pp;
  504. typedef png_uint_16 FAR * FAR * png_uint_16pp;
  505. typedef png_int_16 FAR * FAR * png_int_16pp;
  506. typedef PNG_CONST char FAR * FAR * png_const_charpp;
  507. typedef char FAR * FAR * png_charpp;
  508. typedef png_fixed_point FAR * FAR * png_fixed_point_pp;
  509. #ifdef PNG_FLOATING_POINT_SUPPORTED
  510. typedef double FAR * FAR * png_doublepp;
  511. #endif
  512. /* Pointers to pointers to pointers; i.e., pointer to array */
  513. typedef char FAR * FAR * FAR * png_charppp;
  514. /* png_alloc_size_t is guaranteed to be no smaller than png_size_t,
  515. * and no smaller than png_uint_32. Casts from png_size_t or png_uint_32
  516. * to png_alloc_size_t are not necessary; in fact, it is recommended
  517. * not to use them at all so that the compiler can complain when something
  518. * turns out to be problematic.
  519. * Casts in the other direction (from png_alloc_size_t to png_size_t or
  520. * png_uint_32) should be explicitly applied; however, we do not expect
  521. * to encounter practical situations that require such conversions.
  522. */
  523. #if defined(__TURBOC__) && !defined(__FLAT__)
  524. typedef unsigned long png_alloc_size_t;
  525. #else
  526. # if defined(_MSC_VER) && defined(MAXSEG_64K)
  527. typedef unsigned long png_alloc_size_t;
  528. # else
  529. /* This is an attempt to detect an old Windows system where (int) is
  530. * actually 16 bits, in that case png_malloc must have an argument with a
  531. * bigger size to accomodate the requirements of the library.
  532. */
  533. # if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_)) && \
  534. (!defined(INT_MAX) || INT_MAX <= 0x7ffffffeL)
  535. typedef DWORD png_alloc_size_t;
  536. # else
  537. typedef png_size_t png_alloc_size_t;
  538. # endif
  539. # endif
  540. #endif
  541. #endif /* PNGCONF_H */