config.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /* $XConsortium: config.h /main/1 1996/07/29 17:08:30 cde-hp $ */
  24. // Copyright (c) 1994 James Clark
  25. // See the file COPYING for copying permission.
  26. #ifndef config_INCLUDED
  27. #define config_INCLUDED 1
  28. #define SP_INCLUDE_UNISTD_H
  29. #define SP_POSIX_FILENAMES
  30. #if defined(__GNUG__) || defined(__SunOS)
  31. // It's not missing, but it pulls in libg++
  32. #if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
  33. #define SP_NEW_H_MISSING
  34. // set_new_handler() has to be declared extern "C"
  35. #define SP_SET_NEW_HANDLER_EXTERN_C
  36. #endif
  37. #ifndef SP_MANUAL_INST
  38. #define SP_MANUAL_INST
  39. #endif
  40. #ifndef SP_ANSI_CLASS_INST
  41. #define SP_ANSI_CLASS_INST
  42. #endif
  43. #ifndef SP_HAVE_BOOL
  44. #define SP_HAVE_BOOL
  45. #endif
  46. #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
  47. #define SP_ANSI_FOR_SCOPE
  48. #endif
  49. #endif /* __GNUG__ */
  50. #if defined(sun) || defined(__sun)
  51. // struct stat has st_blksize member
  52. #define SP_STAT_BLKSIZE
  53. #endif
  54. #ifdef __EMX__
  55. // EMX 0.9a for OS/2
  56. #undef SP_POSIX_FILENAMES
  57. #define SP_MSDOS_FILENAMES
  58. #endif
  59. #ifdef _MSC_VER
  60. // Microsoft Visual C++ 4.0
  61. #undef SP_INCLUDE_UNISTD_H
  62. #define SP_INCLUDE_IO_H
  63. #ifndef SP_ANSI_CLASS_INST
  64. #define SP_ANSI_CLASS_INST
  65. #endif
  66. #undef SP_POSIX_FILENAMES
  67. #define SP_MSDOS_FILENAMES
  68. #define SP_SHORT_HEADERS
  69. #pragma warning ( disable : 4660 ) // already instantiated
  70. #pragma warning ( disable : 4661 ) // missing def for decl member
  71. #pragma warning ( disable : 4786 ) // debug symbol truncated (>255 chars)
  72. #pragma warning ( disable : 4018 ) // signed/unsigned mismatch
  73. #pragma warning ( disable : 4251 ) // __declspec(dllexport)
  74. #pragma warning ( disable : 4275 )
  75. #pragma warning ( disable : 4237 ) // future reserved keyword
  76. #define huge verybig
  77. #if _MSC_VER == 900
  78. #define SP_DECLARE_PLACEMENT_OPERATOR_NEW
  79. #endif
  80. #define set_new_handler _set_new_handler
  81. // Function passed to set_new_handler() returns int and takes size_t argument.
  82. #define SP_FANCY_NEW_HANDLER
  83. #define SP_HAVE_SETMODE
  84. #define SP_DLLEXPORT __declspec(dllexport)
  85. #define SP_DLLIMPORT __declspec(dllimport)
  86. #ifdef _DLL
  87. #define SP_USE_DLL
  88. #endif
  89. #ifdef SP_USE_DLL
  90. #ifndef BUILD_LIBSP
  91. // It's not possible to export templates using __declspec(dllexport),
  92. // so instead we include the template definitions in the headers,
  93. // which allows Visual C++ to instantiate any needed templates
  94. // in the client.
  95. #define SP_DEFINE_TEMPLATES
  96. #endif
  97. #endif /* SP_USE_DLL */
  98. #ifndef SP_MANUAL_INST
  99. #ifndef SP_DEFINE_TEMPLATES
  100. #define SP_MANUAL_INST
  101. #endif
  102. #endif /* not SP_MANUAL_INST */
  103. // Make sure both _UNICODE and UNICODE are defined if either is.
  104. #ifdef _UNICODE
  105. #ifndef UNICODE
  106. #define UNICODE
  107. #endif /* not UNICODE */
  108. #endif /* _UNICODE */
  109. #ifdef UNICODE
  110. #ifndef _UNICODE
  111. #define _UNICODE
  112. #endif /* not _UNICODE */
  113. #endif /* UNICODE */
  114. #ifdef _UNICODE
  115. #define SP_WIDE_SYSTEM
  116. #endif
  117. // wchar_t's base type is an unsigned short
  118. #define SP_WCHAR_T_USHORT
  119. // Enable precompiled header support.
  120. #define SP_PCH
  121. // Don't compile in message text.
  122. #define SP_NO_MESSAGE_TEXT
  123. #endif /* _MSC_VER */
  124. #ifdef __WATCOMC__
  125. // Watcom C++ 10.0a
  126. #define SP_MANUAL_INST
  127. #undef SP_POSIX_FILENAMES
  128. #define SP_MSDOS_FILENAMES
  129. #undef SP_INCLUDE_UNISTD_H
  130. #define SP_INCLUDE_IO_H
  131. #pragma warning 004 9
  132. #undef huge
  133. // Cannot handle T::~T in template.
  134. #define SP_QUAL_TEMPLATE_DTOR_BROKEN
  135. #define SP_HAVE_SETMODE
  136. #define _setmode setmode
  137. #if __WATCOMC__ < 1050
  138. #define _O_BINARY O_BINARY
  139. #endif
  140. #define SP_WCHAR_T_USHORT
  141. #endif /* __WATCOMC__ */
  142. #ifdef __BORLANDC__
  143. // Borland C++ 5.0
  144. #define SP_ANSI_FOR_SCOPE
  145. #define SP_HAVE_RTTI
  146. #define SP_HAVE_SETMODE
  147. #undef SP_INCLUDE_UNISTD_H
  148. #define SP_INCLUDE_IO_H
  149. #undef SP_POSIX_FILENAMES
  150. #define SP_MSDOS_FILENAMES
  151. #define SP_HAVE_BOOL
  152. #define SP_SHORT_HEADERS
  153. #define _O_BINARY O_BINARY
  154. #define _setmode setmode
  155. #define SP_ANSI_CLASS_INST
  156. #define SP_MANUAL_INST
  157. // Building as a DLL doesn't work with Borland C++ yet.
  158. #define SP_DLLEXPORT __declspec(dllexport)
  159. #define SP_DLLIMPORT __declspec(dllimport)
  160. #ifdef SP_USE_DLL
  161. #ifndef BUILD_LIBSP
  162. #define SP_DEFINE_TEMPLATES
  163. #endif
  164. #endif /* SP_USE_DLL */
  165. #define SP_WCHAR_T_USHORT
  166. #endif /* __BORLANDC__ */
  167. #ifdef __IBMCPP__
  168. // IBM CSet++ 2.1 from Horst Szillat <szillat@berlin.snafu.de>.
  169. #undef SP_POSIX_FILENAMES
  170. #define SP_MANUAL_INST
  171. #define SP_SHORT_HEADERS
  172. #define SP_MSDOS_FILENAMES
  173. #undef SP_INCLUDE_UNISTD_H
  174. #define SP_INCLUDE_IO_H
  175. #define S_IFMT (S_IFDIR|S_IFCHR|S_IFREG)
  176. #endif
  177. #ifndef SP_ANSI_FOR_SCOPE
  178. // This simulates the new ANSI "for" scope rules
  179. #define for if (0); else for
  180. #endif
  181. #ifndef SP_DLLEXPORT
  182. #define SP_DLLEXPORT /* as nothing */
  183. #endif
  184. #ifndef SP_DLLIMPORT
  185. #define SP_DLLIMPORT /* as nothing */
  186. #endif
  187. #ifdef SP_USE_DLL
  188. #ifdef BUILD_LIBSP
  189. #define SP_API SP_DLLEXPORT
  190. #else
  191. #define SP_API SP_DLLIMPORT
  192. #endif
  193. #else /* not SP_USE_DLL */
  194. #define SP_API /* as nothing */
  195. #endif /* not SP_USE_DLL */
  196. // SP_WIDE_SYSTEM says that your OS provides wide character interfaces
  197. // SP_WIDE_SYSTEM currently works only with Visual C++ and Windows NT
  198. // SP_WIDE_SYSTEM implies SP_MULTI_BYTE
  199. #ifdef SP_WIDE_SYSTEM
  200. #define SP_MULTI_BYTE
  201. #endif
  202. #ifdef SP_NAMESPACE
  203. #define SP_NAMESPACE_SCOPE SP_NAMESPACE::
  204. #else
  205. #define SP_NAMESPACE_SCOPE
  206. #endif
  207. #endif /* not config_INCLUDED */