4 * Hewlett-Packard Company
6 * Permission to use, copy, modify, distribute and sell this software
7 * and its documentation for any purpose is hereby granted without fee,
8 * provided that the above copyright notice appear in all copies and
9 * that both that copyright notice and this permission notice appear
10 * in supporting documentation. Hewlett-Packard Company makes no
11 * representations about the suitability of this software for any
12 * purpose. It is provided "as is" without express or implied warranty.
17 * Permission to use, copy, modify, distribute and sell this software
18 * and its documentation for any purpose is hereby granted without fee,
19 * provided that the above copyright notice appear in all copies and
20 * that both that copyright notice and this permission notice appear
21 * in supporting documentation. Silicon Graphics makes no
22 * representations about the suitability of this software for any
23 * purpose. It is provided "as is" without express or implied warranty.
27 #ifndef __STL_CONFIG_H
28 # define __STL_CONFIG_H
30 // What this file does.
31 // (1) Defines bool, true, and false if the compiler doesn't do so already.
32 // (2) Defines __STL_NO_DRAND48 if the compiler's standard library does
33 // not support the drand48() function.
34 // (3) Defines __STL_STATIC_TEMPLATE_MEMBER_BUG if the compiler can't
35 // handle static members of template classes.
36 // (4) Defines 'typename' as a null macro if the compiler does not support
37 // the typename keyword.
38 // (5) Defines __STL_CLASS_PARTIAL_SPECIALIZATION if the compiler
39 // supports partial specialization of class templates.
40 // (6) Defines __STL_FUNCTION_TMPL_PARTIAL_ORDER if the compiler supports
41 // partial ordering of function templates (a.k.a partial specialization
42 // of function templates.
43 // (7) Defines __STL_EXPLICIT_FUNCTION_TMPL_ARGS if the compiler
44 // supports calling a function template by providing its template
45 // arguments explicitly.
46 // (8) Defines __STL_MEMBER_TEMPLATES if the compiler supports
47 // template members of classes.
48 // (9) Defines 'explicit' as a null macro if the compiler does not support
49 // the explicit keyword.
50 // (10) Defines __STL_LIMITED_DEFAULT_TEMPLATES if the compiler is
51 // unable to handle default template parameters that depend on
52 // previous template parameters.
53 // (11) Defines __STL_NON_TYPE_TMPL_PARAM_BUG if the compiler has
54 // trouble performing function template argument deduction for
55 // non-type template parameters.
56 // (12) Defines __SGI_STL_NO_ARROW_OPERATOR if the compiler is unable
57 // to support the -> operator for iterators.
58 // (13) Defines __STL_USE_EXCEPTIONS if the compiler (in the current
59 // compilation mode) supports exceptions.
60 // (14) Define __STL_USE_NAMESPACES if we're putting the STL into a
62 // (15) Defines __STL_SGI_THREADS if this is being compiled on an SGI
63 // compiler, and if the user hasn't selected pthreads or no threads
65 // (16) Defines __STL_WIN32THREADS if this is being compiled on a
66 // WIN32 compiler in multithreaded mode.
67 // (17) Define namespace-related macros (__STD, __STL_BEGIN_NAMESPACE, etc.)
69 // (18) Define exception-related macros (__STL_TRY, __STL_UNWIND, etc.)
71 // (19) Defines __stl_assert either as a test or as a null macro,
72 // depending on whether or not __STL_ASSERTIONS is defined.
75 # define __STL_PTHREADS
78 # if defined(__sgi) && !defined(__GNUC__)
80 # define __STL_NEED_BOOL
82 # if !defined(_TYPENAME_IS_KEYWORD)
83 # define __STL_NEED_TYPENAME
85 # ifdef _PARTIAL_SPECIALIZATION_OF_CLASS_TEMPLATES
86 # define __STL_CLASS_PARTIAL_SPECIALIZATION
88 # ifdef _MEMBER_TEMPLATES
89 # define __STL_MEMBER_TEMPLATES
91 # if !defined(_EXPLICIT_IS_KEYWORD)
92 # define __STL_NEED_EXPLICIT
95 # define __STL_USE_EXCEPTIONS
97 # if (_COMPILER_VERSION >= 721) && defined(_NAMESPACES)
98 # define __STL_USE_NAMESPACES
100 # if !defined(_NOTHREADS) && !defined(__STL_PTHREADS)
101 # define __STL_SGI_THREADS
106 # include <_G_config.h>
107 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
108 # define __STL_STATIC_TEMPLATE_MEMBER_BUG
109 # define __STL_NEED_TYPENAME
110 # define __STL_NEED_EXPLICIT
112 # define __STL_CLASS_PARTIAL_SPECIALIZATION
113 # define __STL_FUNCTION_TMPL_PARTIAL_ORDER
114 # define __STL_EXPLICIT_FUNCTION_TMPL_ARGS
115 # define __STL_MEMBER_TEMPLATES
117 /* glibc pre 2.0 is very buggy. We have to disable thread for it.
118 It should be upgraded to glibc 2.0 or later. */
119 # if !defined(_NOTHREADS) && __GLIBC__ >= 2 && defined(_G_USING_THUNKS)
120 # define __STL_PTHREADS
121 # ifdef __STRICT_ANSI__
122 /* Work around a bug in the glibc 2.0.x pthread.h. */
123 # define sigset_t __sigset_t
127 # define __STL_USE_EXCEPTIONS
131 # if defined(__SUNPRO_CC)
132 # define __STL_NEED_BOOL
133 # define __STL_NEED_TYPENAME
134 # define __STL_NEED_EXPLICIT
135 # define __STL_USE_EXCEPTIONS
138 # if defined(__COMO__)
139 # define __STL_MEMBER_TEMPLATES
140 # define __STL_CLASS_PARTIAL_SPECIALIZATION
141 # define __STL_USE_EXCEPTIONS
142 # define __STL_USE_NAMESPACES
145 # if defined(_MSC_VER)
149 # define __STL_NEED_BOOL
151 # define __STL_NO_DRAND48
152 # define __STL_NEED_TYPENAME
154 # define __STL_NEED_EXPLICIT
156 # define __STL_NON_TYPE_TMPL_PARAM_BUG
157 # define __SGI_STL_NO_ARROW_OPERATOR
159 # define __STL_USE_EXCEPTIONS
162 # define __STL_WIN32THREADS
166 # if defined(__BORLANDC__)
167 # define __STL_NO_DRAND48
168 # define __STL_NEED_TYPENAME
169 # define __STL_LIMITED_DEFAULT_TEMPLATES
170 # define __SGI_STL_NO_ARROW_OPERATOR
171 # define __STL_NON_TYPE_TMPL_PARAM_BUG
173 # define __STL_USE_EXCEPTIONS
176 # define __STL_WIN32THREADS
181 # if defined(__STL_NEED_BOOL)
187 # ifdef __STL_NEED_TYPENAME
191 # ifdef __STL_NEED_EXPLICIT
195 # ifdef __STL_EXPLICIT_FUNCTION_TMPL_ARGS
196 # define __STL_NULL_TMPL_ARGS <>
198 # define __STL_NULL_TMPL_ARGS
201 # ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
202 # define __STL_TEMPLATE_NULL template<>
204 # define __STL_TEMPLATE_NULL
207 // __STL_NO_NAMESPACES is a hook so that users can disable namespaces
208 // without having to edit library headers.
209 # if defined(__STL_USE_NAMESPACES) && !defined(__STL_NO_NAMESPACES)
211 # define __STL_BEGIN_NAMESPACE namespace std {
212 # define __STL_END_NAMESPACE }
213 # define __STL_USE_NAMESPACE_FOR_RELOPS
214 # define __STL_BEGIN_RELOPS_NAMESPACE namespace std {
215 # define __STL_END_RELOPS_NAMESPACE }
216 # define __STD_RELOPS std
219 # define __STL_BEGIN_NAMESPACE
220 # define __STL_END_NAMESPACE
221 # undef __STL_USE_NAMESPACE_FOR_RELOPS
222 # define __STL_BEGIN_RELOPS_NAMESPACE
223 # define __STL_END_RELOPS_NAMESPACE
224 # define __STD_RELOPS
227 # ifdef __STL_USE_EXCEPTIONS
228 # define __STL_TRY try
229 # define __STL_CATCH_ALL catch(...)
230 # define __STL_RETHROW throw
231 # define __STL_NOTHROW throw()
232 # define __STL_UNWIND(action) catch(...) { action; throw; }
235 # define __STL_CATCH_ALL if (false)
236 # define __STL_RETHROW
237 # define __STL_NOTHROW
238 # define __STL_UNWIND(action)
241 #ifdef __STL_ASSERTIONS
243 # define __stl_assert(expr) \
244 if (!(expr)) { fprintf(stderr, "%s:%d STL assertion failure: %s\n", \
245 __FILE__, __LINE__, # expr); abort(); }
247 # define __stl_assert(expr)
250 #endif /* __STL_CONFIG_H */