home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stlpt453.zip / STLport-4.5.3 / stlport / config / stl_gcc.h < prev    next >
C/C++ Source or Header  |  2002-01-10  |  12KB  |  354 lines

  1. /* STLport configuration file
  2.  * It is internal STLport header - DO NOT include it directly
  3.  */
  4.  
  5. /* Systems having GLIBC installed have different traits */
  6. #if ! defined (_STLP_USE_GLIBC) && ( defined (__linux__) || defined (__CYGWIN__) )
  7. # define _STLP_USE_GLIBC
  8. #endif
  9.  
  10. #   define _STLP_NO_MEMBER_TEMPLATE_KEYWORD
  11.  
  12. # if defined(__FreeBSD__) || defined (__hpux) || defined(__amigaos__)
  13. #  define _STLP_NO_WCHAR_T
  14. # endif
  15.  
  16. # if defined (__sun)
  17.  
  18. // gcc does not support ELF64 yet ; however; it supports ultrasparc + v8plus.
  19. // limits.h contains invalid values for this combination
  20. # if (defined  (__sparc_v9__) || defined (__sparcv9)) && ! defined ( __WORD64 )
  21. #  define __LONG_MAX__ 2147483647L
  22. # endif
  23.  
  24. #  include <config/stl_solaris.h>
  25. # endif
  26.  
  27. // no thread support on AmigaOS
  28. #if defined (__amigaos__)
  29. # define _NOTHREADS
  30. # define _STLP_NO_THREADS
  31. #endif
  32.  
  33. // azov: gcc on lynx have a bug that causes internal
  34. // compiler errors when compiling STLport with namespaces turned on. 
  35. // When the compiler gets better - comment out _STLP_HAS_NO_NAMESPACES
  36. # if defined (__Lynx__) && (__GNUC__ < 3)
  37. #   define _STLP_HAS_NO_NAMESPACES 1
  38. #   define _STLP_NO_STATIC_TEMPLATE_DATA 1
  39. //  turn off useless warning about including system headers
  40. #   define __NO_INCLUDE_WARN__ 1
  41. # endif
  42.  
  43.  
  44. /* Tru64 Unix, AIX, HP : gcc there by default uses uses native ld and hence cannot auto-instantiate 
  45.    static template data. If you are using GNU ld, please say so in stl_user_config.h header */    
  46. # if (__GNUC__ < 3) && ! (_STLP_GCC_USES_GNU_LD) && \
  47.    ((defined (__osf__) && defined (__alpha__)) || defined (_AIX) || defined (__hpux) || defined(__amigaos__) )
  48. #   define _STLP_NO_STATIC_TEMPLATE_DATA
  49. # endif
  50.  
  51. # if defined(__DJGPP)
  52. #   define _STLP_RAND48        1
  53. #   define _NOTHREADS        1
  54. #   undef  _PTHREADS
  55. #   define _STLP_LITTLE_ENDIAN
  56. # endif 
  57.  
  58. # if defined(__MINGW32__)
  59. /* Mingw32, egcs compiler using the Microsoft C runtime */
  60. #   undef  _STLP_NO_DRAND48
  61. #   define _STLP_NO_DRAND48
  62. #   ifdef _MT
  63. #     define _REENTRANT
  64. #   endif
  65. #  define _STLP_IMPORT_DECLSPEC __attribute__((dllimport))
  66. #  define _STLP_EXPORT_DECLSPEC __attribute__((dllexport))
  67. #  define _STLP_CLASS_IMPORT_DECLSPEC __attribute__((dllimport))
  68. #  define _STLP_CLASS_EXPORT_DECLSPEC __attribute__((dllexport))
  69. #  define _STLP_CALL
  70.  
  71. #  if defined (_STLP_USE_DYNAMIC_LIB)
  72. #   define _STLP_USE_DECLSPEC 1
  73. // #   define _STLP_USE_TEMPLATE_EXPORT 1
  74. /* Using dynamic library in MinGW requires _STLP_NO_CUSTOM_IO */
  75. # define _STLP_NO_CUSTOM_IO
  76. #  endif
  77.  
  78. # endif
  79.  
  80. #if defined (__CYGWIN__) || defined (__MINGW32__) || !(defined (_STLP_USE_GLIBC) || defined (__sun)) 
  81. #ifndef __MINGW32__
  82. #   define _STLP_NO_NATIVE_MBSTATE_T      1
  83. #endif
  84. #   define _STLP_NO_NATIVE_WIDE_FUNCTIONS 1
  85. #   define _STLP_NO_NATIVE_WIDE_STREAMS   1
  86. # elif defined(__linux__)
  87. #   define _STLP_NO_NATIVE_WIDE_FUNCTIONS 1
  88. #   define _STLP_NO_NATIVE_WIDE_STREAMS   1
  89. # elif defined (__sun)
  90. #   define _STLP_WCHAR_BORLAND_EXCLUDE
  91. #   define _STLP_NO_NATIVE_WIDE_FUNCTIONS 1
  92. #endif
  93.  
  94. /* Mac OS X is a little different with namespaces and cannot instantiate
  95.  * static data members in template classes */
  96. # if defined (__APPLE__)
  97. /* Mac OS X is missing a required typedef and standard macro */
  98. typedef unsigned int wint_t;
  99.  
  100. #  define __unix
  101.  
  102.  /* Mac OS X needs one and only one source file to initialize all static data
  103.   * members in template classes. Only one source file in an executable or
  104.   * library can declare instances for such data members, otherwise duplicate
  105.   * symbols will be generated. */
  106.  
  107. #   define _STLP_NO_STATIC_TEMPLATE_DATA
  108. #   define _STLP_STATIC_CONST_INIT_BUG 1
  109. #   define _STLP_STATIC_TEMPLATE_DATA 0
  110. #   define _STLP_WEAK_ATTRIBUTE 0
  111. #   define _STLP_NO_LONG_DOUBLE
  112.  
  113. /* Mac OS X needs all "::" scope references to be "std::" */
  114. #  undef _STLP_VENDOR_GLOBAL_STD
  115. #  undef _STLP_VENDOR_GLOBAL_CSTD
  116. #  define _STLP_NO_CSTD_FUNCTION_IMPORTS
  117.  /* Workaround for the broken Mac OS X C++ preprocessor which cannot handle
  118.   * parameterized macros in #include statements */
  119. #  define _STLP_NATIVE_HEADER(header) <../g++/##header##>
  120. #  define _STLP_NATIVE_C_HEADER(header) <../include/##header##>
  121. #  define _STLP_NATIVE_CPP_C_HEADER(header) <../g++/##header##>
  122. #  define _STLP_NATIVE_OLD_STREAMS_HEADER(header) <../g++/##header##>
  123. #  define _STLP_NATIVE_CPP_RUNTIME_HEADER(header) <../g++/##header##>
  124. # endif
  125.  
  126.  
  127. # if defined(__BEOS__) && defined(__INTEL__)
  128. #  define _STLP_NATIVE_HEADER(header) <../stlport/beos/##header##>
  129. #  define _STLP_NATIVE_C_HEADER(header) <../stlport/beos/##header##>
  130. #  define _STLP_NATIVE_CPP_C_HEADER(header) <../stlport/beos/##header##>
  131. #  define _STLP_NATIVE_OLD_STREAMS_HEADER(header) <../stlport/beos/##header##>
  132. #  define _STLP_NATIVE_CPP_RUNTIME_HEADER(header) <../stlport/beos/##header##>
  133. #  define _STLP_NO_NATIVE_WIDE_FUNCTIONS 1
  134. #  define _STLP_NO_NATIVE_WIDE_STREAMS   1
  135. //#  define _NOTHREADS 1
  136. #  ifdef _PTHREADS
  137. #    undef  _PTHREADS
  138. #  endif
  139. #  ifdef _STLP_PTHREADS
  140. #    undef _STLP_PTHREADS
  141. #  endif
  142. #  define _STLP_USE_STDIO_IO 1
  143. #  define _STLP_USE_GLIBC 1
  144. # endif
  145.  
  146.  
  147. /* g++ 2.7.x and above */
  148. #   define _STLP_LONG_LONG long long 
  149.  
  150. #   if (__GNUC__ >= 3)
  151. #    define _STLP_HAS_NATIVE_FLOAT_ABS
  152. #   endif
  153.  
  154. #   if (__GNUC__ < 3)
  155. #    define _STLP_HAS_NO_NEW_C_HEADERS     1
  156. #    define _STLP_VENDOR_GLOBAL_CSTD       1
  157. #    define _STLP_HAS_NO_NEW_IOSTREAMS     1
  158. #    ifndef __HONOR_STD
  159. #     define _STLP_VENDOR_GLOBAL_EXCEPT_STD 1
  160. #    endif
  161. #   endif
  162.  
  163. #   if (__GNUC_MINOR__ < 95)  && (__GNUC__ < 3)
  164. /* egcs fails to initialize builtin types in expr. like this : new(p) char();  */
  165. #     define _STLP_DEFAULT_CONSTRUCTOR_BUG 1
  166. #     define _STLP_INCOMPLETE_EXCEPTION_HEADER
  167. #   endif
  168.  
  169. #   if (__GNUC_MINOR__ < 9)  && (__GNUC__ < 3) /* gcc 2.8 */
  170. #     define _STLP_NO_TEMPLATE_CONVERSIONS
  171. #     define _STLP_NO_MEMBER_TEMPLATE_CLASSES 1
  172. #     define _STLP_NO_FUNCTION_TMPL_PARTIAL_ORDER 1
  173. #     define _STLP_NO_FRIEND_TEMPLATES 1
  174. #     define _STLP_HAS_NO_NAMESPACES 1
  175. #     define _STLP_NO_METHOD_SPECIALIZATION 1
  176. #     define _STLP_NO_MEMBER_TEMPLATES 1
  177. #     define _STLP_NO_CLASS_PARTIAL_SPECIALIZATION 1
  178. #     define _STLP_DONT_SIMULATE_PARTIAL_SPEC_FOR_TYPE_TRAITS
  179. /*  DJGPP doesn't seem to implement it in 2.8.x */
  180. #     ifdef DJGPP
  181. #      define  _STLP_NO_STATIC_TEMPLATE_DATA 1
  182. #     endif
  183. #   endif
  184.  
  185. #  if __GNUC__ <= 2 && __GNUC_MINOR__ <= 7 && ! defined (__CYGWIN32__)
  186. /* Will it work with 2.6 ? I doubt it. */
  187. #   if ( __GNUC_MINOR__ < 6 )
  188.     __GIVE_UP_WITH_STL(GCC_272);
  189. #   endif
  190.  
  191. # define  _STLP_NO_RELOPS_NAMESPACE
  192. # define  _STLP_NON_TYPE_TMPL_PARAM_BUG
  193. # define  _STLP_LIMITED_DEFAULT_TEMPLATES 1
  194. # define  _STLP_DEFAULT_TYPE_PARAM 1
  195. # define  _STLP_NO_BAD_ALLOC
  196. # define  _STLP_NO_ARROW_OPERATOR 1
  197. # ifndef _STLP_NO_STATIC_TEMPLATE_DATA
  198. #  define  _STLP_NO_STATIC_TEMPLATE_DATA
  199. # endif
  200. # define  _STLP_STATIC_CONST_INIT_BUG 1
  201. # define  _STLP_NO_METHOD_SPECIALIZATION 1
  202.  
  203. #  if !defined (__CYGWIN32__) 
  204. #   define _STLP_NESTED_TYPE_PARAM_BUG   1
  205. #   define _STLP_BASE_MATCH_BUG       1
  206. /*  unused operators are required (forward) */
  207. #   define  _STLP_CONST_CONSTRUCTOR_BUG 
  208. #   define _STLP_NO_DEFAULT_NON_TYPE_PARAM
  209. #  endif
  210. #   define _STLP_NO_PARTIAL_SPECIALIZATION_SYNTAX 1
  211. #   define _STLP_NO_EXPLICIT_FUNCTION_TMPL_ARGS 1
  212. #   define _STLP_NO_EXCEPTION_HEADER 1
  213. #  else /* ! <= 2.7.* */
  214. #  endif /* ! <= 2.7.* */
  215.  
  216. /* static template data members workaround strategy for gcc tries
  217.  * to use weak symbols.
  218.  * if you don't want to use that, #define _STLP_WEAK_ATTRIBUTE=0 ( you'll
  219.  * have to put "#define __PUT_STATIC_DATA_MEMBERS_HERE" line in one of your
  220.  * compilation unit ( or CFLAGS for it ) _before_ including any STL header ).
  221.  */
  222. #   if defined (_STLP_NO_STATIC_TEMPLATE_DATA) && ! defined (_STLP_WEAK_ATTRIBUTE )
  223. /* systems using GNU ld or format that supports weak symbols
  224.    may use "weak" attribute
  225.    Linux & Solaris ( x86 & SPARC ) are being auto-recognized here */
  226. #    if defined(_STLP_GNU_LD) || defined(__ELF__) || defined (__CYGWIN__) || \
  227.      (( defined (__SVR4) || defined ( __svr4__ )) && \
  228.       ( defined (sun) || defined ( __sun__ )))
  229. #     define _STLP_WEAK_ATTRIBUTE 1
  230. #    endif
  231. #   endif /* _STLP_WEAK_ATTRIBUTE */
  232.  
  233.  
  234. /* strict ANSI prohibits "long long" ( gcc) */
  235. #  if defined ( __STRICT_ANSI__ )
  236. #    undef _STLP_LONG_LONG
  237. // #    define _STLP_STRICT_ANSI 1
  238. #  endif
  239.  
  240. //# if !defined (__STRICT_ANSI__) || defined (__BUILDING_STLPORT)
  241. //#    define _STLP_USE_TEMPLATE_EXPORT
  242. //#    define _STLP_EXPORT_TEMPLATE_KEYWORD extern
  243. //#    define _STLP_IMPORT_TEMPLATE_KEYWORD extern
  244. //# endif
  245.  
  246. #   ifndef __EXCEPTIONS
  247. #     undef  _STLP_HAS_NO_EXCEPTIONS
  248. #     define _STLP_HAS_NO_EXCEPTIONS  1
  249. #   endif
  250.  
  251. # if (__GNUC__ >= 3)
  252.  
  253. #  define _STLP_NATIVE_INCLUDE_PATH ../g++-v3
  254. #  define _STLP_NATIVE_OLD_STREAMS_INCLUDE_PATH ../g++-v3/backward
  255.  
  256. # elif (__GNUC_MINOR__ < 8)
  257.  
  258. #  define _STLP_NO_OWN_IOSTREAMS 1
  259. #  undef  _STLP_OWN_IOSTREAMS
  260. #  define _STLP_NATIVE_INCLUDE_PATH ../g++-include
  261.  
  262. /* tuning of static template data members workaround */
  263. #  if ( _STLP_STATIC_TEMPLATE_DATA < 1 )
  264. #   if ( _STLP_WEAK_ATTRIBUTE > 0 )
  265. #    define _STLP_WEAK __attribute__ (( weak ))
  266. #   else
  267. #    define _STLP_WEAK
  268. #   endif /* _STLP_WEAK_ATTRIBUTE */
  269.  
  270. #   ifdef __PUT_STATIC_DATA_MEMBERS_HERE
  271. #    define __DECLARE_INSTANCE(type,item,init) type item _STLP_WEAK init
  272. #   else
  273. #    define __DECLARE_INSTANCE(type,item,init)
  274. #   endif /* __PUT_STATIC_DATA_MEMBERS_HERE */
  275. #  endif /* _STLP_STATIC_TEMPLATE_DATA */
  276.  
  277. # else
  278.  
  279. // gcc-2.95.0 used to use "g++-3" directory which has been changed to "g++" in
  280. // system-dependent "include" for 2.95.2 except for Cygwin and Mingw packages.
  281. // I expect "g++-3" not being used in later releases.
  282. // If your installation use "g++-3" include directory for any reason (pre-2.95.2 or Win binary kit),
  283. // please change the macro below to point to your directory. 
  284.  
  285. # if defined(__DJGPP)
  286. #   define _STLP_NATIVE_INCLUDE_PATH ../lang/cxx
  287. # elif (__GNUC__ >= 3) || (__GNUC_MINOR__ >= 97)
  288. #   define _STLP_NATIVE_INCLUDE_PATH ../include/g++-v3
  289. # elif ((__GNUC_MINOR__ >= 95 && __GNUC_MINOR__ < 97) && !( defined (__FreeBSD__) || defined (__NetBSD__) || defined(__sgi) ) )
  290. #   define _STLP_NATIVE_INCLUDE_PATH ../g++-3
  291. # elif (__GNUC_MINOR__ > 8) && (__GNUC_MINOR__ < 95) && (__GNUC__ < 3) && !defined( __Lynx__ )
  292. // this really sucks, as GNUpro does not really identifies itself, so we have to guess 
  293. // depending on a platform
  294. #   ifdef __hpux
  295. #    define _STLP_NATIVE_INCLUDE_PATH ../g++-3
  296. #   else
  297. #    define _STLP_NATIVE_INCLUDE_PATH ../g++-2
  298. #   endif
  299. # else
  300. #   define _STLP_NATIVE_INCLUDE_PATH g++
  301. # endif
  302.  
  303. // <exception> et al
  304. # ifdef __FreeBSD__
  305. #   if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ > 95)
  306. #     define _STLP_NATIVE_CPP_RUNTIME_INCLUDE_PATH ../include
  307. #   endif
  308. # else
  309. // azov
  310. #   ifdef __Lynx__ 
  311. #     define _STLP_NATIVE_CPP_RUNTIME_INCLUDE_PATH _STLP_NATIVE_INCLUDE_PATH
  312. #   else
  313. #    if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)
  314. // #     define _STLP_NATIVE_CPP_RUNTIME_INCLUDE_PATH ../g++-v3
  315. #   else
  316. #     define _STLP_NATIVE_CPP_RUNTIME_INCLUDE_PATH ../include
  317. #   endif
  318. #  endif
  319. # endif
  320.  
  321. #endif /* GNUC_MINOR < 8 */
  322.  
  323. # define _STLP_NATIVE_CPP_C_INCLUDE_PATH _STLP_NATIVE_INCLUDE_PATH
  324. # define _STLP_NATIVE_C_INCLUDE_PATH ../include
  325.  
  326.  
  327. #ifdef _SCO_ELF
  328. # define _STLP_SCO_OPENSERVER
  329. #     if defined(_REENTRANT)
  330. #           define _UITHREADS     /* if      UnixWare < 7.0.1 */
  331. #           define _STLP_UITHREADS
  332. #     endif /* _REENTRANT */
  333. #endif
  334.  
  335. // Tune settings for the case where static template data members are not 
  336. // instaniated by default
  337. # if defined ( _STLP_NO_STATIC_TEMPLATE_DATA )
  338. #   define _STLP_STATIC_TEMPLATE_DATA 0
  339. #   if !defined ( _STLP_WEAK_ATTRIBUTE )
  340. #    define _STLP_WEAK_ATTRIBUTE 0
  341. #   endif
  342. #  ifdef __PUT_STATIC_DATA_MEMBERS_HERE
  343. #   define __DECLARE_INSTANCE(type,item,init) type item init
  344. #  else
  345. #   define __DECLARE_INSTANCE(type,item,init)
  346. #  endif
  347. # else
  348. #   define _STLP_STATIC_TEMPLATE_DATA 1
  349. # endif
  350.  
  351.  
  352.  
  353.  
  354.