Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

649 lines
23 KiB

  1. /* pngconf.h - machine configurable file for libpng
  2. *
  3. * libpng version 1.5.2 - March 31, 2011
  4. *
  5. * Copyright (c) 1998-2011 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.
  153. *
  154. * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come
  155. * from a DLL - used to define PNG_IMPEXP when
  156. * PNG_USE_DLL is set.
  157. */
  158. /* System specific discovery.
  159. * ==========================
  160. * This code is used at build time to find PNG_IMPEXP, the API settings
  161. * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL
  162. * import processing is possible. On Windows/x86 systems it also sets
  163. * compiler-specific macros to the values required to change the calling
  164. * conventions of the various functions.
  165. */
  166. #if ( defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\
  167. defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) ) &&\
  168. ( defined(_X86_) || defined(_X64_) || defined(_M_IX86) ||\
  169. defined(_M_X64) || defined(_M_IA64) )
  170. /* Windows system (DOS doesn't support DLLs) running on x86/x64. Includes
  171. * builds under Cygwin or MinGW. Also includes Watcom builds but these need
  172. * special treatment because they are not compatible with GCC or Visual C
  173. * because of different calling conventions.
  174. */
  175. # if PNG_API_RULE == 2
  176. /* If this line results in an error, either because __watcall is not
  177. * understood or because of a redefine just below you cannot use *this*
  178. * build of the library with the compiler you are using. *This* build was
  179. * build using Watcom and applications must also be built using Watcom!
  180. */
  181. # define PNGCAPI __watcall
  182. # endif
  183. # if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
  184. # define PNGCAPI __cdecl
  185. # if PNG_API_RULE == 1
  186. # define PNGAPI __stdcall
  187. # endif
  188. # else
  189. /* An older compiler, or one not detected (erroneously) above,
  190. * if necessary override on the command line to get the correct
  191. * variants for the compiler.
  192. */
  193. # ifndef PNGCAPI
  194. # define PNGCAPI _cdecl
  195. # endif
  196. # if PNG_API_RULE == 1 && !defined(PNGAPI)
  197. # define PNGAPI _stdcall
  198. # endif
  199. # endif /* compiler/api */
  200. /* NOTE: PNGCBAPI always defaults to PNGCAPI. */
  201. # if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)
  202. ERROR: PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed
  203. # endif
  204. # if (defined(_MSC_VER) && _MSC_VER < 800) ||\
  205. (defined(__BORLANDC__) && __BORLANDC__ < 0x500)
  206. /* older Borland and MSC
  207. * compilers used '__export' and required this to be after
  208. * the type.
  209. */
  210. # ifndef PNG_EXPORT_TYPE
  211. # define PNG_EXPORT_TYPE(type) type PNG_IMPEXP
  212. # endif
  213. # define PNG_DLL_EXPORT __export
  214. # else /* newer compiler */
  215. # define PNG_DLL_EXPORT __declspec(dllexport)
  216. # ifndef PNG_DLL_IMPORT
  217. # define PNG_DLL_IMPORT __declspec(dllimport)
  218. # endif
  219. # endif /* compiler */
  220. #else /* !Windows/x86 */
  221. # if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
  222. # define PNGAPI _System
  223. # else /* !Windows/x86 && !OS/2 */
  224. /* Use the defaults, or define PNG*API on the command line (but
  225. * this will have to be done for every compile!)
  226. */
  227. # endif /* other system, !OS/2 */
  228. #endif /* !Windows/x86 */
  229. /* Now do all the defaulting . */
  230. #ifndef PNGCAPI
  231. # define PNGCAPI
  232. #endif
  233. #ifndef PNGCBAPI
  234. # define PNGCBAPI PNGCAPI
  235. #endif
  236. #ifndef PNGAPI
  237. # define PNGAPI PNGCAPI
  238. #endif
  239. /* The default for PNG_IMPEXP depends on whether the library is
  240. * being built or used.
  241. */
  242. #ifndef PNG_IMPEXP
  243. # ifdef PNGLIB_BUILD
  244. /* Building the library */
  245. # if (defined(DLL_EXPORT)/*from libtool*/ ||\
  246. defined(_WINDLL) || defined(_DLL) || defined(__DLL__) ||\
  247. defined(_USRDLL) ||\
  248. defined(PNG_BUILD_DLL)) && defined(PNG_DLL_EXPORT)
  249. /* Building a DLL. */
  250. # define PNG_IMPEXP PNG_DLL_EXPORT
  251. # endif /* DLL */
  252. # else
  253. /* Using the library */
  254. # if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT)
  255. /* This forces use of a DLL, disallowing static linking */
  256. # define PNG_IMPEXP PNG_DLL_IMPORT
  257. # endif
  258. # endif
  259. # ifndef PNG_IMPEXP
  260. # define PNG_IMPEXP
  261. # endif
  262. #endif
  263. /* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat
  264. * 'attributes' as a storage class - the attributes go at the start of the
  265. * function definition, and attributes are always appended regardless of the
  266. * compiler. This considerably simplifies these macros but may cause problems
  267. * if any compilers both need function attributes and fail to handle them as
  268. * a storage class (this is unlikely.)
  269. */
  270. #ifndef PNG_FUNCTION
  271. # define PNG_FUNCTION(type, name, args, attributes) attributes type name args
  272. #endif
  273. #ifndef PNG_EXPORT_TYPE
  274. # define PNG_EXPORT_TYPE(type) PNG_IMPEXP type
  275. #endif
  276. /* The ordinal value is only relevant when preprocessing png.h for symbol
  277. * table entries, so we discard it here. See the .dfn files in the
  278. * scripts directory.
  279. */
  280. #ifndef PNG_EXPORTA
  281. # define PNG_EXPORTA(ordinal, type, name, args, attributes)\
  282. PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args), \
  283. extern attributes)
  284. #endif
  285. /* ANSI-C (C90) does not permit a macro to be invoked with an empty argument,
  286. * so make something non-empty to satisfy the requirement:
  287. */
  288. #define PNG_EMPTY /*empty list*/
  289. #define PNG_EXPORT(ordinal, type, name, args)\
  290. PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY)
  291. /* Use PNG_REMOVED to comment out a removed interface. */
  292. #ifndef PNG_REMOVED
  293. # define PNG_REMOVED(ordinal, type, name, args, attributes)
  294. #endif
  295. #ifndef PNG_CALLBACK
  296. # define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args)
  297. #endif
  298. /* Support for compiler specific function attributes. These are used
  299. * so that where compiler support is available incorrect use of API
  300. * functions in png.h will generate compiler warnings.
  301. *
  302. * Added at libpng-1.2.41.
  303. */
  304. #ifndef PNG_NO_PEDANTIC_WARNINGS
  305. # ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED
  306. # define PNG_PEDANTIC_WARNINGS_SUPPORTED
  307. # endif
  308. #endif
  309. #ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED
  310. /* Support for compiler specific function attributes. These are used
  311. * so that where compiler support is available incorrect use of API
  312. * functions in png.h will generate compiler warnings. Added at libpng
  313. * version 1.2.41.
  314. */
  315. # if defined(__GNUC__)
  316. # ifndef PNG_USE_RESULT
  317. # define PNG_USE_RESULT __attribute__((__warn_unused_result__))
  318. # endif
  319. # ifndef PNG_NORETURN
  320. # define PNG_NORETURN __attribute__((__noreturn__))
  321. # endif
  322. # ifndef PNG_PTR_NORETURN
  323. /* It's not enough to have the compiler be the correct compiler at
  324. * this point - it's necessary for the library (which defines
  325. * the type of the library longjmp) to also be the GNU library.
  326. * This is because many systems use the GNU compiler with a
  327. * non-GNU libc implementation. Min/GW headers are also compatible
  328. * with GCC as well as uclibc, so it seems best to exclude known
  329. * problem libcs here rather than just including known libcs.
  330. *
  331. * NOTE: this relies on the only use of PNG_PTR_NORETURN being with
  332. * the system longjmp. If the same type is used elsewhere then this
  333. * will need to be changed.
  334. */
  335. # if !defined(__CYGWIN__)
  336. # define PNG_PTR_NORETURN __attribute__((__noreturn__))
  337. # endif
  338. # endif
  339. # ifndef PNG_ALLOCATED
  340. # define PNG_ALLOCATED __attribute__((__malloc__))
  341. # endif
  342. /* This specifically protects structure members that should only be
  343. * accessed from within the library, therefore should be empty during
  344. * a library build.
  345. */
  346. # ifndef PNGLIB_BUILD
  347. # ifndef PNG_DEPRECATED
  348. # define PNG_DEPRECATED __attribute__((__deprecated__))
  349. # endif
  350. # ifndef PNG_DEPSTRUCT
  351. # define PNG_DEPSTRUCT __attribute__((__deprecated__))
  352. # endif
  353. # ifndef PNG_PRIVATE
  354. # if 0 /* Doesn't work so we use deprecated instead*/
  355. # define PNG_PRIVATE \
  356. __attribute__((warning("This function is not exported by libpng.")))
  357. # else
  358. # define PNG_PRIVATE \
  359. __attribute__((__deprecated__))
  360. # endif
  361. # endif
  362. # endif /* PNGLIB_BUILD */
  363. # endif /* __GNUC__ */
  364. # if defined(_MSC_VER) && (_MSC_VER >= 1300)
  365. # ifndef PNG_USE_RESULT
  366. # define PNG_USE_RESULT /* not supported */
  367. # endif
  368. # ifndef PNG_NORETURN
  369. # define PNG_NORETURN __declspec(noreturn)
  370. # endif
  371. # ifndef PNG_PTR_NORETURN
  372. # define PNG_PTR_NORETURN /* not supported */
  373. # endif
  374. # ifndef PNG_ALLOCATED
  375. # define PNG_ALLOCATED __declspec(restrict)
  376. # endif
  377. /* This specifically protects structure members that should only be
  378. * accessed from within the library, therefore should be empty during
  379. * a library build.
  380. */
  381. # ifndef PNGLIB_BUILD
  382. # ifndef PNG_DEPRECATED
  383. # define PNG_DEPRECATED __declspec(deprecated)
  384. # endif
  385. # ifndef PNG_DEPSTRUCT
  386. # define PNG_DEPSTRUCT __declspec(deprecated)
  387. # endif
  388. # ifndef PNG_PRIVATE
  389. # define PNG_PRIVATE __declspec(deprecated)
  390. # endif
  391. # endif /* PNGLIB_BUILD */
  392. # endif /* _MSC_VER */
  393. #endif /* PNG_PEDANTIC_WARNINGS */
  394. #ifndef PNG_DEPRECATED
  395. # define PNG_DEPRECATED /* Use of this function is deprecated */
  396. #endif
  397. #ifndef PNG_USE_RESULT
  398. # define PNG_USE_RESULT /* The result of this function must be checked */
  399. #endif
  400. #ifndef PNG_NORETURN
  401. # define PNG_NORETURN /* This function does not return */
  402. #endif
  403. #ifndef PNG_PTR_NORETURN
  404. # define PNG_PTR_NORETURN /* This function does not return */
  405. #endif
  406. #ifndef PNG_ALLOCATED
  407. # define PNG_ALLOCATED /* The result of the function is new memory */
  408. #endif
  409. #ifndef PNG_DEPSTRUCT
  410. # define PNG_DEPSTRUCT /* Access to this struct member is deprecated */
  411. #endif
  412. #ifndef PNG_PRIVATE
  413. # define PNG_PRIVATE /* This is a private libpng function */
  414. #endif
  415. #ifndef PNG_FP_EXPORT /* A floating point API. */
  416. # ifdef PNG_FLOATING_POINT_SUPPORTED
  417. # define PNG_FP_EXPORT(ordinal, type, name, args)\
  418. PNG_EXPORT(ordinal, type, name, args)
  419. # else /* No floating point APIs */
  420. # define PNG_FP_EXPORT(ordinal, type, name, args)
  421. # endif
  422. #endif
  423. #ifndef PNG_FIXED_EXPORT /* A fixed point API. */
  424. # ifdef PNG_FIXED_POINT_SUPPORTED
  425. # define PNG_FIXED_EXPORT(ordinal, type, name, args)\
  426. PNG_EXPORT(ordinal, type, name, args)
  427. # else /* No fixed point APIs */
  428. # define PNG_FIXED_EXPORT(ordinal, type, name, args)
  429. # endif
  430. #endif
  431. /* The following uses const char * instead of char * for error
  432. * and warning message functions, so some compilers won't complain.
  433. * If you do not want to use const, define PNG_NO_CONST here.
  434. *
  435. * This should not change how the APIs are called, so it can be done
  436. * on a per-file basis in the application.
  437. */
  438. #ifndef PNG_CONST
  439. # ifndef PNG_NO_CONST
  440. # define PNG_CONST const
  441. # else
  442. # define PNG_CONST
  443. # endif
  444. #endif
  445. /* Some typedefs to get us started. These should be safe on most of the
  446. * common platforms. The typedefs should be at least as large as the
  447. * numbers suggest (a png_uint_32 must be at least 32 bits long), but they
  448. * don't have to be exactly that size. Some compilers dislike passing
  449. * unsigned shorts as function parameters, so you may be better off using
  450. * unsigned int for png_uint_16.
  451. */
  452. #if defined(INT_MAX) && (INT_MAX > 0x7ffffffeL)
  453. typedef unsigned int png_uint_32;
  454. typedef int png_int_32;
  455. #else
  456. typedef unsigned long png_uint_32;
  457. typedef long png_int_32;
  458. #endif
  459. typedef unsigned short png_uint_16;
  460. typedef short png_int_16;
  461. typedef unsigned char png_byte;
  462. #ifdef PNG_NO_SIZE_T
  463. typedef unsigned int png_size_t;
  464. #else
  465. typedef size_t png_size_t;
  466. #endif
  467. #define png_sizeof(x) (sizeof (x))
  468. /* The following is needed for medium model support. It cannot be in the
  469. * pngpriv.h header. Needs modification for other compilers besides
  470. * MSC. Model independent support declares all arrays and pointers to be
  471. * large using the far keyword. The zlib version used must also support
  472. * model independent data. As of version zlib 1.0.4, the necessary changes
  473. * have been made in zlib. The USE_FAR_KEYWORD define triggers other
  474. * changes that are needed. (Tim Wegner)
  475. */
  476. /* Separate compiler dependencies (problem here is that zlib.h always
  477. * defines FAR. (SJT)
  478. */
  479. #ifdef __BORLANDC__
  480. # if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
  481. # define LDATA 1
  482. # else
  483. # define LDATA 0
  484. # endif
  485. /* GRR: why is Cygwin in here? Cygwin is not Borland C... */
  486. # if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__)
  487. # define PNG_MAX_MALLOC_64K /* only used in build */
  488. # if (LDATA != 1)
  489. # ifndef FAR
  490. # define FAR __far
  491. # endif
  492. # define USE_FAR_KEYWORD
  493. # endif /* LDATA != 1 */
  494. /* Possibly useful for moving data out of default segment.
  495. * Uncomment it if you want. Could also define FARDATA as
  496. * const if your compiler supports it. (SJT)
  497. # define FARDATA FAR
  498. */
  499. # endif /* __WIN32__, __FLAT__, __CYGWIN__ */
  500. #endif /* __BORLANDC__ */
  501. /* Suggest testing for specific compiler first before testing for
  502. * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM,
  503. * making reliance oncertain keywords suspect. (SJT)
  504. */
  505. /* MSC Medium model */
  506. #ifdef FAR
  507. # ifdef M_I86MM
  508. # define USE_FAR_KEYWORD
  509. # define FARDATA FAR
  510. # include <dos.h>
  511. # endif
  512. #endif
  513. /* SJT: default case */
  514. #ifndef FAR
  515. # define FAR
  516. #endif
  517. /* At this point FAR is always defined */
  518. #ifndef FARDATA
  519. # define FARDATA
  520. #endif
  521. /* Typedef for floating-point numbers that are converted
  522. * to fixed-point with a multiple of 100,000, e.g., gamma
  523. */
  524. typedef png_int_32 png_fixed_point;
  525. /* Add typedefs for pointers */
  526. typedef void FAR * png_voidp;
  527. typedef PNG_CONST void FAR * png_const_voidp;
  528. typedef png_byte FAR * png_bytep;
  529. typedef PNG_CONST png_byte FAR * png_const_bytep;
  530. typedef png_uint_32 FAR * png_uint_32p;
  531. typedef PNG_CONST png_uint_32 FAR * png_const_uint_32p;
  532. typedef png_int_32 FAR * png_int_32p;
  533. typedef PNG_CONST png_int_32 FAR * png_const_int_32p;
  534. typedef png_uint_16 FAR * png_uint_16p;
  535. typedef PNG_CONST png_uint_16 FAR * png_const_uint_16p;
  536. typedef png_int_16 FAR * png_int_16p;
  537. typedef PNG_CONST png_int_16 FAR * png_const_int_16p;
  538. typedef char FAR * png_charp;
  539. typedef PNG_CONST char FAR * png_const_charp;
  540. typedef png_fixed_point FAR * png_fixed_point_p;
  541. typedef PNG_CONST png_fixed_point FAR * png_const_fixed_point_p;
  542. typedef png_size_t FAR * png_size_tp;
  543. typedef PNG_CONST png_size_t FAR * 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 FAR * png_doublep;
  549. typedef PNG_CONST double FAR * png_const_doublep;
  550. #endif
  551. /* Pointers to pointers; i.e. arrays */
  552. typedef png_byte FAR * FAR * png_bytepp;
  553. typedef png_uint_32 FAR * FAR * png_uint_32pp;
  554. typedef png_int_32 FAR * FAR * png_int_32pp;
  555. typedef png_uint_16 FAR * FAR * png_uint_16pp;
  556. typedef png_int_16 FAR * FAR * png_int_16pp;
  557. typedef PNG_CONST char FAR * FAR * png_const_charpp;
  558. typedef char FAR * FAR * png_charpp;
  559. typedef png_fixed_point FAR * FAR * png_fixed_point_pp;
  560. #ifdef PNG_FLOATING_POINT_SUPPORTED
  561. typedef double FAR * FAR * png_doublepp;
  562. #endif
  563. /* Pointers to pointers to pointers; i.e., pointer to array */
  564. typedef char FAR * FAR * FAR * png_charppp;
  565. /* png_alloc_size_t is guaranteed to be no smaller than png_size_t,
  566. * and no smaller than png_uint_32. Casts from png_size_t or png_uint_32
  567. * to png_alloc_size_t are not necessary; in fact, it is recommended
  568. * not to use them at all so that the compiler can complain when something
  569. * turns out to be problematic.
  570. * Casts in the other direction (from png_alloc_size_t to png_size_t or
  571. * png_uint_32) should be explicitly applied; however, we do not expect
  572. * to encounter practical situations that require such conversions.
  573. */
  574. #if defined(__TURBOC__) && !defined(__FLAT__)
  575. typedef unsigned long png_alloc_size_t;
  576. #else
  577. # if defined(_MSC_VER) && defined(MAXSEG_64K)
  578. typedef unsigned long png_alloc_size_t;
  579. # else
  580. /* This is an attempt to detect an old Windows system where (int) is
  581. * actually 16 bits, in that case png_malloc must have an argument with a
  582. * bigger size to accomodate the requirements of the library.
  583. */
  584. # if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_)) && \
  585. (!defined(INT_MAX) || INT_MAX <= 0x7ffffffeL)
  586. typedef DWORD png_alloc_size_t;
  587. # else
  588. typedef png_size_t png_alloc_size_t;
  589. # endif
  590. # endif
  591. #endif
  592. #endif /* PNGCONF_H */