ftconfig.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. /* ftconfig.h. Generated from ftconfig.in by configure. */
  2. /***************************************************************************/
  3. /* */
  4. /* ftconfig.in */
  5. /* */
  6. /* UNIX-specific configuration file (specification only). */
  7. /* */
  8. /* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007 by */
  9. /* David Turner, Robert Wilhelm, and Werner Lemberg. */
  10. /* */
  11. /* This file is part of the FreeType project, and may only be used, */
  12. /* modified, and distributed under the terms of the FreeType project */
  13. /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
  14. /* this file you indicate that you have read the license and */
  15. /* understand and accept it fully. */
  16. /* */
  17. /***************************************************************************/
  18. /*************************************************************************/
  19. /* */
  20. /* This header file contains a number of macro definitions that are used */
  21. /* by the rest of the engine. Most of the macros here are automatically */
  22. /* determined at compile time, and you should not need to change it to */
  23. /* port FreeType, except to compile the library with a non-ANSI */
  24. /* compiler. */
  25. /* */
  26. /* Note however that if some specific modifications are needed, we */
  27. /* advise you to place a modified copy in your build directory. */
  28. /* */
  29. /* The build directory is usually `freetype/builds/<system>', and */
  30. /* contains system-specific files that are always included first when */
  31. /* building the library. */
  32. /* */
  33. /*************************************************************************/
  34. #ifndef __FTCONFIG_H__
  35. #define __FTCONFIG_H__
  36. #include <ft2build.h>
  37. #include FT_CONFIG_OPTIONS_H
  38. #include FT_CONFIG_STANDARD_LIBRARY_H
  39. FT_BEGIN_HEADER
  40. /*************************************************************************/
  41. /* */
  42. /* PLATFORM-SPECIFIC CONFIGURATION MACROS */
  43. /* */
  44. /* These macros can be toggled to suit a specific system. The current */
  45. /* ones are defaults used to compile FreeType in an ANSI C environment */
  46. /* (16bit compilers are also supported). Copy this file to your own */
  47. /* `freetype/builds/<system>' directory, and edit it to port the engine. */
  48. /* */
  49. /*************************************************************************/
  50. #define HAVE_UNISTD_H 1
  51. #define HAVE_FCNTL_H 1
  52. #define SIZEOF_INT 4
  53. #define SIZEOF_LONG 4
  54. #define FT_SIZEOF_INT SIZEOF_INT
  55. #define FT_SIZEOF_LONG SIZEOF_LONG
  56. #define FT_CHAR_BIT CHAR_BIT
  57. /* Preferred alignment of data */
  58. #define FT_ALIGNMENT 8
  59. /* FT_UNUSED is a macro used to indicate that a given parameter is not */
  60. /* used -- this is only used to get rid of unpleasant compiler warnings */
  61. #ifndef FT_UNUSED
  62. #define FT_UNUSED( arg ) ( (arg) = (arg) )
  63. #endif
  64. /*************************************************************************/
  65. /* */
  66. /* AUTOMATIC CONFIGURATION MACROS */
  67. /* */
  68. /* These macros are computed from the ones defined above. Don't touch */
  69. /* their definition, unless you know precisely what you are doing. No */
  70. /* porter should need to mess with them. */
  71. /* */
  72. /*************************************************************************/
  73. /*************************************************************************/
  74. /* */
  75. /* Mac support */
  76. /* */
  77. /* This is the only necessary change, so it is defined here instead */
  78. /* providing a new configuration file. */
  79. /* */
  80. #if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \
  81. ( defined( __MWERKS__ ) && defined( macintosh ) )
  82. /* no Carbon frameworks for 64bit 10.4.x */
  83. #include "AvailabilityMacros.h"
  84. #if defined( __LP64__ ) && \
  85. ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
  86. #define DARWIN_NO_CARBON 1
  87. #else
  88. #define FT_MACINTOSH 1
  89. #endif
  90. #endif
  91. /* Fix compiler warning with sgi compiler */
  92. #if defined( __sgi ) && !defined( __GNUC__ )
  93. #if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )
  94. #pragma set woff 3505
  95. #endif
  96. #endif
  97. /*************************************************************************/
  98. /* */
  99. /* IntN types */
  100. /* */
  101. /* Used to guarantee the size of some specific integers. */
  102. /* */
  103. typedef signed short FT_Int16;
  104. typedef unsigned short FT_UInt16;
  105. #if FT_SIZEOF_INT == 4
  106. typedef signed int FT_Int32;
  107. typedef unsigned int FT_UInt32;
  108. #elif FT_SIZEOF_LONG == 4
  109. typedef signed long FT_Int32;
  110. typedef unsigned long FT_UInt32;
  111. #else
  112. #error "no 32bit type found -- please check your configuration files"
  113. #endif
  114. /* look up an integer type that is at least 32 bits */
  115. #if FT_SIZEOF_INT >= 4
  116. typedef int FT_Fast;
  117. typedef unsigned int FT_UFast;
  118. #elif FT_SIZEOF_LONG >= 4
  119. typedef long FT_Fast;
  120. typedef unsigned long FT_UFast;
  121. #endif
  122. /* determine whether we have a 64-bit int type for platforms without */
  123. /* Autoconf */
  124. #if FT_SIZEOF_LONG == 8
  125. /* FT_LONG64 must be defined if a 64-bit type is available */
  126. #define FT_LONG64
  127. #define FT_INT64 long
  128. #elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
  129. /* this compiler provides the __int64 type */
  130. #define FT_LONG64
  131. #define FT_INT64 __int64
  132. #elif defined( __BORLANDC__ ) /* Borland C++ */
  133. /* XXXX: We should probably check the value of __BORLANDC__ in order */
  134. /* to test the compiler version. */
  135. /* this compiler provides the __int64 type */
  136. #define FT_LONG64
  137. #define FT_INT64 __int64
  138. #elif defined( __WATCOMC__ ) /* Watcom C++ */
  139. /* Watcom doesn't provide 64-bit data types */
  140. #elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
  141. #define FT_LONG64
  142. #define FT_INT64 long long int
  143. #elif defined( __GNUC__ )
  144. /* GCC provides the `long long' type */
  145. #define FT_LONG64
  146. #define FT_INT64 long long int
  147. #endif /* FT_SIZEOF_LONG == 8 */
  148. #define FT_BEGIN_STMNT do {
  149. #define FT_END_STMNT } while ( 0 )
  150. #define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
  151. /*************************************************************************/
  152. /* */
  153. /* A 64-bit data type will create compilation problems if you compile */
  154. /* in strict ANSI mode. To avoid them, we disable their use if */
  155. /* __STDC__ is defined. You can however ignore this rule by */
  156. /* defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */
  157. /* */
  158. #if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
  159. #ifdef __STDC__
  160. /* Undefine the 64-bit macros in strict ANSI compilation mode. */
  161. /* Since `#undef' doesn't survive in configuration header files */
  162. /* we use the postprocessing facility of AC_CONFIG_HEADERS to */
  163. /* replace the leading `/' with `#'. */
  164. #undef FT_LONG64
  165. #undef FT_INT64
  166. #endif /* __STDC__ */
  167. #endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
  168. #ifdef FT_MAKE_OPTION_SINGLE_OBJECT
  169. #define FT_LOCAL( x ) static x
  170. #define FT_LOCAL_DEF( x ) static x
  171. #else
  172. #ifdef __cplusplus
  173. #define FT_LOCAL( x ) extern "C" x
  174. #define FT_LOCAL_DEF( x ) extern "C" x
  175. #else
  176. #define FT_LOCAL( x ) extern x
  177. #define FT_LOCAL_DEF( x ) x
  178. #endif
  179. #endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
  180. #ifndef FT_BASE
  181. #ifdef __cplusplus
  182. #define FT_BASE( x ) extern "C" x
  183. #else
  184. #define FT_BASE( x ) extern x
  185. #endif
  186. #endif /* !FT_BASE */
  187. #ifndef FT_BASE_DEF
  188. #ifdef __cplusplus
  189. #define FT_BASE_DEF( x ) x
  190. #else
  191. #define FT_BASE_DEF( x ) x
  192. #endif
  193. #endif /* !FT_BASE_DEF */
  194. #ifndef FT_EXPORT
  195. #ifdef __cplusplus
  196. #define FT_EXPORT( x ) extern "C" x
  197. #else
  198. #define FT_EXPORT( x ) extern x
  199. #endif
  200. #endif /* !FT_EXPORT */
  201. #ifndef FT_EXPORT_DEF
  202. #ifdef __cplusplus
  203. #define FT_EXPORT_DEF( x ) extern "C" x
  204. #else
  205. #define FT_EXPORT_DEF( x ) extern x
  206. #endif
  207. #endif /* !FT_EXPORT_DEF */
  208. #ifndef FT_EXPORT_VAR
  209. #ifdef __cplusplus
  210. #define FT_EXPORT_VAR( x ) extern "C" x
  211. #else
  212. #define FT_EXPORT_VAR( x ) extern x
  213. #endif
  214. #endif /* !FT_EXPORT_VAR */
  215. /* The following macros are needed to compile the library with a */
  216. /* C++ compiler and with 16bit compilers. */
  217. /* */
  218. /* This is special. Within C++, you must specify `extern "C"' for */
  219. /* functions which are used via function pointers, and you also */
  220. /* must do that for structures which contain function pointers to */
  221. /* assure C linkage -- it's not possible to have (local) anonymous */
  222. /* functions which are accessed by (global) function pointers. */
  223. /* */
  224. /* */
  225. /* FT_CALLBACK_DEF is used to _define_ a callback function. */
  226. /* */
  227. /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
  228. /* contains pointers to callback functions. */
  229. /* */
  230. /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
  231. /* that contains pointers to callback functions. */
  232. /* */
  233. /* */
  234. /* Some 16bit compilers have to redefine these macros to insert */
  235. /* the infamous `_cdecl' or `__fastcall' declarations. */
  236. /* */
  237. #ifndef FT_CALLBACK_DEF
  238. #ifdef __cplusplus
  239. #define FT_CALLBACK_DEF( x ) extern "C" x
  240. #else
  241. #define FT_CALLBACK_DEF( x ) static x
  242. #endif
  243. #endif /* FT_CALLBACK_DEF */
  244. #ifndef FT_CALLBACK_TABLE
  245. #ifdef __cplusplus
  246. #define FT_CALLBACK_TABLE extern "C"
  247. #define FT_CALLBACK_TABLE_DEF extern "C"
  248. #else
  249. #define FT_CALLBACK_TABLE extern
  250. #define FT_CALLBACK_TABLE_DEF /* nothing */
  251. #endif
  252. #endif /* FT_CALLBACK_TABLE */
  253. FT_END_HEADER
  254. #endif /* __FTCONFIG_H__ */
  255. /* END */