OSDN Git Service

we dont use these bits of SGI STL
[pf3gnuchains/gcc-fork.git] / libstdc++ / stl / stl_config.h
1 /*
2  *
3  * Copyright (c) 1994
4  * Hewlett-Packard Company
5  *
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.
13  *
14  * Copyright (c) 1997
15  * Silicon Graphics
16  *
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.
24  *
25  */
26
27 #ifndef __STL_CONFIG_H
28 # define __STL_CONFIG_H
29
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 
61 //       namespace.  
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
64 //       instead.
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.)
68 //       apropriately.
69 //  (18) Define exception-related macros (__STL_TRY, __STL_UNWIND, etc.)
70 //       appropriately.
71 //  (19) Defines __stl_assert either as a test or as a null macro,
72 //       depending on whether or not __STL_ASSERTIONS is defined.
73
74 #ifdef _PTHREADS
75 #   define __STL_PTHREADS
76 #endif
77
78 # if defined(__sgi) && !defined(__GNUC__)
79 #   if !defined(_BOOL)
80 #     define __STL_NEED_BOOL
81 #   endif
82 #   if !defined(_TYPENAME_IS_KEYWORD)
83 #     define __STL_NEED_TYPENAME
84 #   endif
85 #   ifdef _PARTIAL_SPECIALIZATION_OF_CLASS_TEMPLATES
86 #     define __STL_CLASS_PARTIAL_SPECIALIZATION
87 #   endif
88 #   ifdef _MEMBER_TEMPLATES
89 #     define __STL_MEMBER_TEMPLATES
90 #   endif
91 #   if !defined(_EXPLICIT_IS_KEYWORD)
92 #     define __STL_NEED_EXPLICIT
93 #   endif
94 #   ifdef __EXCEPTIONS
95 #     define __STL_USE_EXCEPTIONS
96 #   endif
97 #   if (_COMPILER_VERSION >= 721) && defined(_NAMESPACES)
98 #     define __STL_USE_NAMESPACES
99 #   endif 
100 #   if !defined(_NOTHREADS) && !defined(__STL_PTHREADS)
101 #     define __STL_SGI_THREADS
102 #   endif
103 # endif
104
105 # ifdef __GNUC__
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
111 #   else
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
116 #   endif
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
124 #     endif
125 #   endif
126 #   ifdef __EXCEPTIONS
127 #     define __STL_USE_EXCEPTIONS
128 #   endif
129 # endif
130
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
136 # endif
137
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
143 # endif
144
145 # if defined(_MSC_VER)
146 #   if _MSC_VER > 1000
147 #     include <yvals.h>
148 #   else
149 #     define __STL_NEED_BOOL
150 #   endif
151 #   define __STL_NO_DRAND48
152 #   define __STL_NEED_TYPENAME
153 #   if _MSC_VER < 1100
154 #     define __STL_NEED_EXPLICIT
155 #   endif
156 #   define __STL_NON_TYPE_TMPL_PARAM_BUG
157 #   define __SGI_STL_NO_ARROW_OPERATOR
158 #   ifdef _CPPUNWIND
159 #     define __STL_USE_EXCEPTIONS
160 #   endif
161 #   ifdef _MT
162 #     define __STL_WIN32THREADS
163 #   endif
164 # endif
165
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
172 #   ifdef _CPPUNWIND
173 #     define __STL_USE_EXCEPTIONS
174 #   endif
175 #   ifdef __MT__
176 #     define __STL_WIN32THREADS
177 #   endif
178 # endif
179
180
181 # if defined(__STL_NEED_BOOL)
182     typedef int bool;
183 #   define true 1
184 #   define false 0
185 # endif
186
187 # ifdef __STL_NEED_TYPENAME
188 #   define typename
189 # endif
190
191 # ifdef __STL_NEED_EXPLICIT
192 #   define explicit
193 # endif
194
195 # ifdef __STL_EXPLICIT_FUNCTION_TMPL_ARGS
196 #   define __STL_NULL_TMPL_ARGS <>
197 # else
198 #   define __STL_NULL_TMPL_ARGS
199 # endif
200
201 # ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
202 #   define __STL_TEMPLATE_NULL template<>
203 # else
204 #   define __STL_TEMPLATE_NULL
205 # endif
206
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)
210 #   define __STD std
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
217 # else
218 #   define __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 
225 # endif
226
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; }
233 # else
234 #   define __STL_TRY 
235 #   define __STL_CATCH_ALL if (false)
236 #   define __STL_RETHROW 
237 #   define __STL_NOTHROW 
238 #   define __STL_UNWIND(action) 
239 # endif
240
241 #ifdef __STL_ASSERTIONS
242 # include <stdio.h>
243 # define __stl_assert(expr) \
244     if (!(expr)) { fprintf(stderr, "%s:%d STL assertion failure: %s\n", \
245                           __FILE__, __LINE__, # expr); abort(); }
246 #else
247 # define __stl_assert(expr)
248 #endif
249
250 #endif /* __STL_CONFIG_H */
251
252 // Local Variables:
253 // mode:C++
254 // End: