OSDN Git Service

Initial revision
[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 template classes.
40 //  (6) Defines __STL_MEMBER_TEMPLATES if the compiler supports
41 //      template members of classes.
42 //  (7) Defines 'explicit' as a null macro if the compiler does not support
43 //      the explicit keyword.    
44 //  (8) Defines __STL_LIMITED_DEFAULT_TEMPLATES if the compiler is
45 //      unable to handle default template parameters that depend on
46 //      previous template parameters.
47 //  (9) Defines __STL_NON_TYPE_TMPL_PARAM_BUG if the compiler has 
48 //      trouble performing function template argument deduction for
49 //      non-type template parameters.
50 //  (10) Defines __STL_USE_EXCEPTIONS if the compiler (in the current
51 //      compilation mode) supports exceptions.
52 //  (11) Defines __STL_SGI_THREADS if this is being compiled on an SGI
53 //      compiler, and if the user hasn't selected pthreads or no threads
54 //      instead.
55 //  (12) Defines __STL_WIN32THREADS if this is being compiled on a 
56 //       WIN32 compiler in multithreaded mode.
57 //  (13) Defines __stl_assert either as a test or as a null macro,
58 //       depending on whether or not __STL_ASSERTIONS is defined.
59
60 # if defined(__sgi) && !defined(__GNUC__)
61 #   if !defined(_BOOL)
62 #     define __STL_NEED_BOOL
63 #   endif
64 #   if !defined(_TYPENAME_IS_KEYWORD)
65 #     define __STL_NEED_TYPENAME
66 #   endif
67 #   ifdef _PARTIAL_SPECIALIZATION_OF_CLASS_TEMPLATES
68 #     define __STL_CLASS_PARTIAL_SPECIALIZATION
69 #   endif
70 #   ifdef _MEMBER_TEMPLATES
71 #     define __STL_MEMBER_TEMPLATES
72 #   endif
73 #   if !defined(_EXPLICIT_IS_KEYWORD)
74 #     define __STL_NEED_EXPLICIT
75 #   endif
76 #   ifdef __EXCEPTIONS
77 #     define __STL_USE_EXCEPTIONS
78 #   endif
79 #   if !defined(_NOTHREADS) && !defined(_PTHREADS)
80 #     define __STL_SGI_THREADS
81 #   endif
82 # endif
83
84 # ifdef __GNUC__
85 #   if 0 && (__GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8))
86 #     define __STL_STATIC_TEMPLATE_MEMBER_BUG
87 #     define __STL_NEED_TYPENAME
88 #     define __STL_NEED_EXPLICIT
89 #   else
90 #     define __STL_CLASS_PARTIAL_SPECIALIZATION
91 #   endif
92 #   ifdef __EXCEPTIONS
93 #     define __STL_USE_EXCEPTIONS
94 #   endif
95 # endif
96
97 # if defined(__SUNPRO_CC) 
98 #   define __STL_NEED_BOOL
99 #   define __STL_NEED_TYPENAME
100 #   define __STL_NEED_EXPLICIT
101 #   define __STL_USE_EXCEPTIONS
102 # endif
103
104 # if defined(__COMO__)
105 #   define __STL_MEMBER_TEMPLATES
106 #   define __STL_CLASS_PARTIAL_SPECIALIZATION
107 #   define __STL_USE_EXCEPTIONS
108 # endif
109
110 # if defined(_MSC_VER)
111 #   if _MSC_VER > 1000
112 #     include <yvals.h>
113 #   else
114 #     define __STL_NEED_BOOL
115 #   endif
116 #   define __STL_NO_DRAND48
117 #   define __STL_NEED_TYPENAME
118 #   if _MSC_VER < 1100
119 #     define __STL_NEED_EXPLICIT
120 #   endif
121 #   define __STL_NON_TYPE_TMPL_PARAM_BUG
122 #   ifdef _CPPUNWIND
123 #     define __STL_USE_EXCEPTIONS
124 #   endif
125 #   ifdef _MT
126 #     define __STL_WIN32THREADS
127 #   endif
128 # endif
129
130 # if defined(__BORLANDC__)
131 #   define __STL_NO_DRAND48
132 #   define __STL_NEED_TYPENAME
133 #   define __STL_LIMITED_DEFAULT_TEMPLATES
134 #   define __STL_NON_TYPE_TMPL_PARAM_BUG
135 #   ifdef _CPPUNWIND
136 #     define __STL_USE_EXCEPTIONS
137 #   endif
138 #   ifdef __MT__
139 #     define __STL_WIN32THREADS
140 #   endif
141 # endif
142
143
144 # if defined(__STL_NEED_BOOL)
145     typedef int bool;
146 #   define true 1
147 #   define false 0
148 #   undef __STL_NEED_BOOL
149 # endif
150
151 # ifdef __STL_NEED_TYPENAME
152 #   define typename
153 #   undef __STL_NEED_TYPENAME
154 # endif
155
156 # ifdef __STL_NEED_EXPLICIT
157 #   define explicit
158 #   undef __STL_NEED_EXPLICIT
159 # endif
160
161 #ifdef __STL_ASSERTIONS
162 # include <stdio.h>
163 # define __stl_assert(expr) \
164     if (!(expr)) { fprintf(stderr, "%s:%d STL assertion failure: %s\n", \
165                           __FILE__, __LINE__, # expr); abort(); }
166 #else
167 # define __stl_assert(expr)
168 #endif
169
170 #endif /* __STL_CONFIG_H */