]> git.lyx.org Git - lyx.git/blob - boost/boost/typeof/typeof.hpp
run extract script again on boost 1.47: now bcp wants more files
[lyx.git] / boost / boost / typeof / typeof.hpp
1 // Copyright (C) 2004 Arkadiy Vertleyb
2 // Distributed under the Boost Software License, Version 1.0. (See accompanying
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4
5 #ifndef BOOST_TYPEOF_TYPEOF_HPP_INCLUDED
6 #define BOOST_TYPEOF_TYPEOF_HPP_INCLUDED
7
8 #if defined(BOOST_TYPEOF_COMPLIANT)
9 #   define BOOST_TYPEOF_EMULATION
10 #endif
11
12 #if defined(BOOST_TYPEOF_EMULATION) && defined(BOOST_TYPEOF_NATIVE)
13 #   error both typeof emulation and native mode requested
14 #endif
15
16 #if defined(__COMO__)
17 #   ifdef __GNUG__
18 #       ifndef BOOST_TYPEOF_EMULATION
19 #           ifndef BOOST_TYPEOF_NATIVE
20 #               define BOOST_TYPEOF_NATIVE
21 #           endif
22 #           define BOOST_TYPEOF_KEYWORD typeof
23 #       endif
24 #   else
25 #       ifndef BOOST_TYPEOF_NATIVE
26 #           ifndef BOOST_TYPEOF_EMULATION
27 #               define BOOST_TYPEOF_EMULATION
28 #           endif
29 #       else
30 #           error native typeof is not supported
31 #       endif
32 #   endif
33
34 #elif defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)
35 #   ifdef __GNUC__
36 #       ifndef BOOST_TYPEOF_EMULATION
37 #           ifndef BOOST_TYPEOF_NATIVE
38 #               define BOOST_TYPEOF_NATIVE
39 #           endif
40 #           define BOOST_TYPEOF_KEYWORD __typeof__
41 #       endif
42 #   else
43 #       ifndef BOOST_TYPEOF_NATIVE
44 #           ifndef BOOST_TYPEOF_EMULATION
45 #               define BOOST_TYPEOF_EMULATION
46 #           endif
47 #       else
48 #           error native typeof is not supported
49 #       endif
50 #   endif
51
52 #elif defined(__GNUC__)
53 #   ifndef BOOST_TYPEOF_EMULATION
54 #       ifndef BOOST_TYPEOF_NATIVE
55 #           define BOOST_TYPEOF_NATIVE
56 #       endif
57 #       define BOOST_TYPEOF_KEYWORD __typeof__
58 #   endif
59
60 #elif defined(__MWERKS__)
61 #   if(__MWERKS__ <= 0x3003)  // 8.x
62 #       ifndef BOOST_TYPEOF_EMULATION
63 #           ifndef BOOST_TYPEOF_NATIVE
64 #               define BOOST_TYPEOF_NATIVE
65 #           endif
66 #           define BOOST_TYPEOF_KEYWORD __typeof__
67 #       else
68 #           define BOOST_TYPEOF_EMULATION_UNSUPPORTED
69 #       endif
70 #   else // 9.x
71 #       ifndef BOOST_TYPEOF_EMULATION
72 #           ifndef BOOST_TYPEOF_NATIVE
73 #               define BOOST_TYPEOF_NATIVE
74 #           endif
75 #           define BOOST_TYPEOF_KEYWORD __typeof__
76 #       endif
77 #   endif
78 #elif defined __CODEGEARC__
79 #   ifndef BOOST_TYPEOF_EMULATION
80 #       ifndef BOOST_TYPEOF_NATIVE
81 #           define BOOST_TYPEOF_EMULATION_UNSUPPORTED
82 #       endif
83 #   else
84 #       define BOOST_TYPEOF_EMULATION_UNSUPPORTED
85 #   endif
86 #elif defined __BORLANDC__
87 #   ifndef BOOST_TYPEOF_EMULATION
88 #       ifndef BOOST_TYPEOF_NATIVE
89 #           define BOOST_TYPEOF_EMULATION_UNSUPPORTED
90 #       endif
91 #   else
92 #       define BOOST_TYPEOF_EMULATION_UNSUPPORTED
93 #   endif
94 #elif defined __DMC__
95 #   ifndef BOOST_TYPEOF_EMULATION
96 #       ifndef BOOST_TYPEOF_NATIVE
97 #           define BOOST_TYPEOF_NATIVE
98 #       endif
99 #       include <boost/typeof/dmc/typeof_impl.hpp>
100 #       define MSVC_TYPEOF_HACK
101 #   endif
102 #elif defined(_MSC_VER)
103 #   if (_MSC_VER <= 1300)  // 6.5, 7.0
104 #       ifndef BOOST_TYPEOF_EMULATION
105 #           ifndef BOOST_TYPEOF_NATIVE
106 #               define BOOST_TYPEOF_NATIVE
107 #           endif
108 #           include <boost/typeof/msvc/typeof_impl.hpp>
109 #           define MSVC_TYPEOF_HACK
110 #       else
111 #           error typeof emulation is not supported
112 #       endif
113 #   elif (_MSC_VER >= 1310)  // 7.1 ->
114 #       ifndef BOOST_TYPEOF_EMULATION
115 #           ifndef BOOST_TYPEOF_NATIVE
116 #               ifndef _MSC_EXTENSIONS
117 #                   define BOOST_TYPEOF_EMULATION
118 #               else
119 #                   define BOOST_TYPEOF_NATIVE
120 #               endif
121 #           endif
122 #       endif
123 #       ifdef BOOST_TYPEOF_NATIVE
124 #           include <boost/typeof/msvc/typeof_impl.hpp>
125 #           define MSVC_TYPEOF_HACK
126 #       endif
127 #   endif
128 #elif defined(__HP_aCC)
129 #   ifndef BOOST_TYPEOF_NATIVE
130 #       ifndef BOOST_TYPEOF_EMULATION
131 #           define BOOST_TYPEOF_EMULATION
132 #       endif
133 #   else
134 #       error native typeof is not supported
135 #   endif
136
137 #elif defined(__DECCXX)
138 #   ifndef BOOST_TYPEOF_NATIVE
139 #       ifndef BOOST_TYPEOF_EMULATION
140 #           define BOOST_TYPEOF_EMULATION
141 #       endif
142 #   else
143 #       error native typeof is not supported
144 #   endif
145
146 #elif defined(__BORLANDC__)
147 #   if (__BORLANDC__ < 0x590)
148 #       define BOOST_TYPEOF_NO_FUNCTION_TYPES
149 #       define BOOST_TYPEOF_NO_MEMBER_FUNCTION_TYPES
150 #   endif
151 #   ifndef BOOST_TYPEOF_NATIVE
152 #       ifndef BOOST_TYPEOF_EMULATION
153 #           define BOOST_TYPEOF_EMULATION
154 #       endif
155 #   else
156 #       error native typeof is not supported
157 #   endif
158
159 #else //unknown compiler
160 #   ifndef BOOST_TYPEOF_NATIVE
161 #       ifndef BOOST_TYPEOF_EMULATION
162 #           define BOOST_TYPEOF_EMULATION
163 #       endif
164 #   else
165 #       ifndef BOOST_TYPEOF_KEYWORD
166 #           define BOOST_TYPEOF_KEYWORD typeof
167 #       endif
168 #   endif
169
170 #endif
171
172 #define BOOST_TYPEOF_UNIQUE_ID()\
173      BOOST_TYPEOF_REGISTRATION_GROUP * 0x10000 + __LINE__
174
175 #define BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()\
176      <boost/typeof/incr_registration_group.hpp>
177
178 #ifdef BOOST_TYPEOF_EMULATION_UNSUPPORTED
179 #   include <boost/typeof/unsupported.hpp>
180 #elif defined BOOST_TYPEOF_EMULATION
181 #   define BOOST_TYPEOF_TEXT "using typeof emulation"
182 #   include <boost/typeof/message.hpp>
183 #   include <boost/typeof/typeof_impl.hpp>
184 #   include <boost/typeof/type_encoding.hpp>
185 #   include <boost/typeof/template_encoding.hpp>
186 #   include <boost/typeof/modifiers.hpp>
187 #   include <boost/typeof/pointers_data_members.hpp>
188 #   include <boost/typeof/register_functions.hpp>
189 #   include <boost/typeof/register_fundamental.hpp>
190
191 #elif defined(BOOST_TYPEOF_NATIVE)
192 #   define BOOST_TYPEOF_TEXT "using native typeof"
193 #   include <boost/typeof/message.hpp>
194 #   include <boost/typeof/native.hpp>
195 #else
196 #   error typeof configuration error
197 #endif
198
199 // auto
200 #define BOOST_AUTO(Var, Expr) BOOST_TYPEOF(Expr) Var = Expr
201 #define BOOST_AUTO_TPL(Var, Expr) BOOST_TYPEOF_TPL(Expr) Var = Expr
202
203 #endif//BOOST_TYPEOF_TYPEOF_HPP_INCLUDED