PageRenderTime 22ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/jade_0_5/jade/include/config.h

#
C Header | 261 lines | 189 code | 37 blank | 35 comment | 11 complexity | 22e327ebbe251204877482fde9a77853 MD5 | raw file
Possible License(s): LGPL-2.1, LGPL-2.0
  1. // Copyright (c) 1994, 1995, 1996 James Clark
  2. // See the file COPYING for copying permission.
  3. #ifndef config_INCLUDED
  4. #define config_INCLUDED 1
  5. #define SP_INCLUDE_UNISTD_H
  6. #define SP_POSIX_FILENAMES
  7. #ifdef __GNUG__
  8. // It's not missing, but it pulls in libg++
  9. #define SP_NEW_H_MISSING
  10. // set_new_handler() has to be declared extern "C"
  11. #define SP_SET_NEW_HANDLER_EXTERN_C
  12. #ifndef SP_MANUAL_INST
  13. #define SP_MANUAL_INST
  14. #endif
  15. #ifndef SP_ANSI_CLASS_INST
  16. #define SP_ANSI_CLASS_INST
  17. #endif
  18. #ifndef SP_HAVE_BOOL
  19. #define SP_HAVE_BOOL
  20. #endif
  21. #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
  22. #define SP_ANSI_FOR_SCOPE
  23. #endif
  24. #endif /* __GNUG__ */
  25. #if defined(sun) || defined(__sun)
  26. // struct stat has st_blksize member
  27. #define SP_STAT_BLKSIZE
  28. #endif
  29. #ifdef __EMX__
  30. // EMX 0.9a for OS/2
  31. #undef SP_POSIX_FILENAMES
  32. #define SP_MSDOS_FILENAMES
  33. #endif
  34. #ifdef _MSC_VER
  35. // Microsoft Visual C++ 4.0
  36. #undef SP_INCLUDE_UNISTD_H
  37. #define SP_INCLUDE_IO_H
  38. #ifndef SP_ANSI_CLASS_INST
  39. #define SP_ANSI_CLASS_INST
  40. #endif
  41. #undef SP_POSIX_FILENAMES
  42. #define SP_MSDOS_FILENAMES
  43. #define SP_SHORT_HEADERS
  44. #pragma warning ( disable : 4660 ) // already instantiated
  45. #pragma warning ( disable : 4661 ) // missing def for decl member
  46. #pragma warning ( disable : 4786 ) // debug symbol truncated (>255 chars)
  47. #pragma warning ( disable : 4018 ) // signed/unsigned mismatch
  48. #pragma warning ( disable : 4251 ) // __declspec(dllexport)
  49. #pragma warning ( disable : 4275 )
  50. #pragma warning ( disable : 4237 ) // future reserved keyword
  51. #define huge verybig
  52. #if _MSC_VER == 900
  53. #define SP_DECLARE_PLACEMENT_OPERATOR_NEW
  54. #endif
  55. #define set_new_handler _set_new_handler
  56. // Function passed to set_new_handler() returns int and takes size_t argument.
  57. #define SP_FANCY_NEW_HANDLER
  58. #define SP_HAVE_SETMODE
  59. #define SP_HAVE_IOS_BINARY
  60. #define SP_DLLEXPORT __declspec(dllexport)
  61. #define SP_DLLIMPORT __declspec(dllimport)
  62. #ifdef _DLL
  63. #define SP_USE_DLL
  64. #endif
  65. #ifdef SP_USE_DLL
  66. #ifndef BUILD_LIBSP
  67. // It's not possible to export templates using __declspec(dllexport),
  68. // so instead we include the template definitions in the headers,
  69. // which allows Visual C++ to instantiate any needed templates
  70. // in the client.
  71. #define SP_DEFINE_TEMPLATES
  72. #endif
  73. #endif /* SP_USE_DLL */
  74. #ifndef SP_MANUAL_INST
  75. #ifndef SP_DEFINE_TEMPLATES
  76. #define SP_MANUAL_INST
  77. #endif
  78. #endif /* not SP_MANUAL_INST */
  79. #ifdef SP_MULTI_BYTE
  80. #define SP_WIDE_SYSTEM
  81. #endif
  82. // wchar_t's base type is an unsigned short
  83. #define SP_WCHAR_T_USHORT
  84. // Enable precompiled header support.
  85. #define SP_PCH
  86. // Don't compile in message text.
  87. #define SP_NO_MESSAGE_TEXT
  88. #endif /* _MSC_VER */
  89. #ifdef __WATCOMC__
  90. // Watcom C++ 10.0a
  91. #define SP_MANUAL_INST
  92. #undef SP_POSIX_FILENAMES
  93. #define SP_MSDOS_FILENAMES
  94. #undef SP_INCLUDE_UNISTD_H
  95. #define SP_INCLUDE_IO_H
  96. #pragma warning 004 9
  97. #undef huge
  98. // Cannot handle T::~T in template.
  99. #define SP_QUAL_TEMPLATE_DTOR_BROKEN
  100. #define SP_HAVE_SETMODE
  101. #define SP_HAVE_IOS_BINARY
  102. #define _setmode setmode
  103. #if __WATCOMC__ < 1050
  104. #define _O_BINARY O_BINARY
  105. #endif
  106. #define SP_WCHAR_T_USHORT
  107. #endif /* __WATCOMC__ */
  108. #ifdef __BORLANDC__
  109. // Borland C++ 5.0
  110. #define SP_ANSI_FOR_SCOPE
  111. #define SP_HAVE_RTTI
  112. #define SP_HAVE_SETMODE
  113. #define SP_HAVE_IOS_BINARY
  114. #undef SP_INCLUDE_UNISTD_H
  115. #define SP_INCLUDE_IO_H
  116. #undef SP_POSIX_FILENAMES
  117. #define SP_MSDOS_FILENAMES
  118. #define SP_HAVE_BOOL
  119. #define SP_SHORT_HEADERS
  120. #define _O_BINARY O_BINARY
  121. #define _setmode setmode
  122. #define SP_ANSI_CLASS_INST
  123. #define SP_MANUAL_INST
  124. // Building as a DLL doesn't work with Borland C++ yet.
  125. #define SP_DLLEXPORT __declspec(dllexport)
  126. #define SP_DLLIMPORT __declspec(dllimport)
  127. #ifdef SP_USE_DLL
  128. #ifndef BUILD_LIBSP
  129. #define SP_DEFINE_TEMPLATES
  130. #endif
  131. #endif /* SP_USE_DLL */
  132. #define SP_WCHAR_T_USHORT
  133. #endif /* __BORLANDC__ */
  134. #ifdef __IBMCPP__
  135. // IBM CSet++ 2.1 from Horst Szillat <szillat@berlin.snafu.de>.
  136. #undef SP_POSIX_FILENAMES
  137. #define SP_MANUAL_INST
  138. #define SP_SHORT_HEADERS
  139. #define SP_MSDOS_FILENAMES
  140. #undef SP_INCLUDE_UNISTD_H
  141. #define SP_INCLUDE_IO_H
  142. #define S_IFMT (S_IFDIR|S_IFCHR|S_IFREG)
  143. #endif
  144. #ifdef __xlC__
  145. // IBM CSet++ 3.1 on AIX 4.1.
  146. // Use CXX=xlC and CC=xlC in the Makefile.
  147. // Note that -g creates massive executables and that -O
  148. // takes ages to compile and creates core dumping executables!
  149. // I havn't tried the socket stuff.
  150. // <Chris_Paulson-Ellis@3mail.3com.com>
  151. #define SP_MANUAL_INST
  152. #define SP_HAVE_LOCALE
  153. #define SP_STAT_BLKSIZE
  154. #endif /* __xlC__ */
  155. #ifdef macintosh
  156. // Apple MacOS. Tested only with Metrowerks CW10.
  157. // From Ashley Colin Yakeley <AshleyB@halcyon.com>
  158. #undef SP_POSIX_FILENAMES
  159. #define SP_MAC_FILENAMES
  160. #define SP_LINE_TERM1 '\r'
  161. #ifdef __MWERKS__
  162. // Metrowerks for some platform (MacOS in this case)
  163. #pragma mpwc_newline off
  164. #define SP_HAVE_IOS_BINARY
  165. #define SP_ANSI_IOSTREAMS
  166. #define SP_DEFINE_TEMPLATES
  167. // #define SP_USE_DLL -- __declspec doesn't work with classes (yet)
  168. #ifdef SP_USE_DLL
  169. #define SP_DLLEXPORT __declspec(export)
  170. #define SP_DLLIMPORT __declspec(import)
  171. #endif // SP_USE_DLL
  172. #if __MWERKS__ >= 0x1000
  173. // bool option only defined for CW10 and later (note __MWERKS__ is BCD)
  174. #if __option(bool)
  175. #define SP_HAVE_BOOL
  176. #endif // __option(bool)
  177. #endif // __MWERKS__ >= 0x1000
  178. #endif // __MWERKS__
  179. #if ('\n' != 10) || ('\r' != 13)
  180. #error "newlines incorrect"
  181. #endif
  182. #endif /* macintosh */
  183. #ifdef SP_HAVE_SETMODE
  184. #ifndef SP_LINE_TERM1
  185. #define SP_LINE_TERM1 '\r'
  186. #define SP_LINE_TERM2 '\n'
  187. #endif
  188. #endif /* not SP_HAVE_SETMODE */
  189. #ifndef SP_LINE_TERM1
  190. #define SP_LINE_TERM1 '\n'
  191. #endif
  192. #ifndef SP_ANSI_FOR_SCOPE
  193. // This simulates the new ANSI "for" scope rules
  194. #define for if (0); else for
  195. #endif
  196. #ifndef SP_DLLEXPORT
  197. #define SP_DLLEXPORT /* as nothing */
  198. #endif
  199. #ifndef SP_DLLIMPORT
  200. #define SP_DLLIMPORT /* as nothing */
  201. #endif
  202. #ifdef SP_USE_DLL
  203. #ifdef BUILD_LIBSP
  204. #define SP_API SP_DLLEXPORT
  205. #else
  206. #define SP_API SP_DLLIMPORT
  207. #endif
  208. #else /* not SP_USE_DLL */
  209. #define SP_API /* as nothing */
  210. #endif /* not SP_USE_DLL */
  211. // SP_WIDE_SYSTEM says that your OS provides wide character interfaces
  212. // SP_WIDE_SYSTEM currently works only with Visual C++ and Windows NT/95
  213. // SP_WIDE_SYSTEM implies SP_MULTI_BYTE
  214. #ifdef SP_WIDE_SYSTEM
  215. #ifndef SP_MULTI_BYTE
  216. #define SP_MULTI_BYTE
  217. #endif
  218. #endif
  219. #ifdef SP_NAMESPACE
  220. #define SP_NAMESPACE_SCOPE SP_NAMESPACE::
  221. #else
  222. #define SP_NAMESPACE_SCOPE
  223. #endif
  224. #endif /* not config_INCLUDED */