27 #ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP
28 #define SOL_SINGLE_INCLUDE_FORWARD_HPP
34 #if (defined(__cplusplus) && __cplusplus == 201703L) || (defined(_MSC_VER) && _MSC_VER > 1900 && ((defined(_HAS_CXX17) && _HAS_CXX17 == 1) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201402L))))
35 #ifndef SOL_CXX17_FEATURES
36 #define SOL_CXX17_FEATURES 1
37 #endif // C++17 features macro
38 #endif // C++17 features check
40 #if defined(SOL_CXX17_FEATURES) && SOL_CXX17_FEATURES
41 #if defined(__cpp_noexcept_function_type) || ((defined(_MSC_VER) && _MSC_VER > 1911) && (defined(_MSVC_LANG) && ((_MSVC_LANG >= 201403L))))
42 #ifndef SOL_NOEXCEPT_FUNCTION_TYPE
43 #define SOL_NOEXCEPT_FUNCTION_TYPE 1
44 #endif // noexcept is part of a function's type
45 #endif // compiler-specific checks
46 #if defined(__clang__) && defined(__APPLE__)
47 #if defined(__has_include)
48 #if __has_include(<variant>)
49 #define SOL_STD_VARIANT 1
50 #endif // has include nonsense
51 #endif // __has_include
53 #define SOL_STD_VARIANT 1
54 #endif // Clang screws up variant
60 #if defined(_DEBUG) && !defined(NDEBUG)
62 #ifndef SOL_IN_DEBUG_DETECTED
63 #define SOL_IN_DEBUG_DETECTED 1
66 #endif // VC++ Debug macros
69 #ifndef SOL_NO_EXCEPTIONS
70 #define SOL_NO_EXCEPTIONS 1
72 #endif // Automatic Exceptions
78 #endif // Automatic RTTI
79 #elif defined(__GNUC__) || defined(__clang__)
81 #if !defined(NDEBUG) && !defined(__OPTIMIZE__)
83 #ifndef SOL_IN_DEBUG_DETECTED
84 #define SOL_IN_DEBUG_DETECTED 1
87 #endif // Not Debug && g++ optimizer flag
90 #ifndef SOL_NO_EXCEPTIONS
91 #define SOL_NO_EXCEPTIONS 1
93 #endif // No Exceptions
101 #endif // vc++ || clang++/g++
103 #if defined(SOL_CHECK_ARGUMENTS) && SOL_CHECK_ARGUMENTS
107 #if !defined(SOL_SAFE_GETTER)
108 #define SOL_SAFE_GETTER 1
115 #if !defined(SOL_SAFE_USERTYPE)
116 #define SOL_SAFE_USERTYPE 1
122 #if !defined(SOL_SAFE_REFERENCES)
123 #define SOL_SAFE_REFERENCES 1
128 #if !defined(SOL_SAFE_FUNCTION)
129 #define SOL_SAFE_FUNCTION 1
137 #if !defined(SOL_SAFE_FUNCTION_CALLS)
138 #define SOL_SAFE_FUNCTION_CALLS 1
144 #if !defined(SOL_SAFE_PROXIES)
145 #define SOL_SAFE_PROXIES 1
151 #if !defined(SOL_SAFE_NUMERICS)
152 #define SOL_SAFE_NUMERICS 1
159 #if !defined(SOL_NO_CHECK_NUMBER_PRECISION)
161 #define SOL_NO_CHECK_NUMBER_PRECISION 0
164 #endif // Turn on Safety for all if top-level macro is defined
166 #if defined(SOL_IN_DEBUG_DETECTED) && SOL_IN_DEBUG_DETECTED
168 #if !defined(SOL_SAFE_REFERENCES)
170 #define SOL_SAFE_REFERENCES 1
177 #if !defined(SOL_SAFE_USERTYPE)
178 #define SOL_SAFE_USERTYPE 1
181 #if !defined(SOL_SAFE_FUNCTION_CALLS)
183 #define SOL_SAFE_FUNCTION_CALLS 1
188 #if !defined(SOL_PRINT_ERRORS)
189 #define SOL_PRINT_ERRORS 1
192 #endif // DEBUG: Turn on all debug safety features for VC++ / g++ / clang++ and similar
194 #if !defined(SOL_PRINT_ERRORS)
195 #define SOL_PRINT_ERRORS 0
198 #if !defined(SOL_DEFAULT_PASS_ON_ERROR)
199 #define SOL_DEFAULT_PASS_ON_ERROR 0
202 #if !defined(SOL_ENABLE_INTEROP)
203 #define SOL_ENABLE_INTEROP 0
206 #if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) || defined(__OBJC__) || defined(nil)
207 #if !defined(SOL_NO_NIL)
210 #endif // avoiding nil defines / keywords
212 #if defined(SOL_USE_BOOST) && SOL_USE_BOOST
213 #ifndef SOL_UNORDERED_MAP_COMPATIBLE_HASH
214 #define SOL_UNORDERED_MAP_COMPATIBLE_HASH 1
215 #endif // SOL_UNORDERED_MAP_COMPATIBLE_HASH
218 #ifndef SOL_STACK_STRING_OPTIMIZATION_SIZE
219 #define SOL_STACK_STRING_OPTIMIZATION_SIZE 1024
220 #endif // Optimized conversion routines using a KB or so off the stack
233 class basic_reference;
234 using reference = basic_reference<false>;
235 using main_reference = basic_reference<true>;
236 class stack_reference;
238 struct proxy_base_tag;
239 template <
typename Super>
241 template <
typename Table,
typename Key>
244 template <
typename T>
246 template <
typename T>
247 class simple_usertype;
248 template <
bool,
typename T>
249 class basic_table_core;
251 using table_core = basic_table_core<b, reference>;
253 using main_table_core = basic_table_core<b, main_reference>;
255 using stack_table_core = basic_table_core<b, stack_reference>;
256 template <
typename T>
257 using basic_table = basic_table_core<false, T>;
258 typedef table_core<false> table;
259 typedef table_core<true> global_table;
260 typedef main_table_core<false> main_table;
261 typedef main_table_core<true> main_global_table;
262 typedef stack_table_core<false> stack_table;
263 typedef stack_table_core<true> stack_global_table;
264 template <
typename base_t>
265 struct basic_environment;
266 using environment = basic_environment<reference>;
267 using main_environment = basic_environment<main_reference>;
268 using stack_environment = basic_environment<stack_reference>;
269 template <
typename T,
bool>
270 class basic_function;
271 template <
typename T,
bool,
typename H>
272 class basic_protected_function;
273 using unsafe_function = basic_function<reference, false>;
274 using safe_function = basic_protected_function<reference, false, reference>;
275 using main_unsafe_function = basic_function<main_reference, false>;
276 using main_safe_function = basic_protected_function<main_reference, false, reference>;
277 using stack_unsafe_function = basic_function<stack_reference, false>;
278 using stack_safe_function = basic_protected_function<stack_reference, false, reference>;
279 using stack_aligned_unsafe_function = basic_function<stack_reference, true>;
280 using stack_aligned_safe_function = basic_protected_function<stack_reference, true, reference>;
281 using protected_function = safe_function;
282 using main_protected_function = main_safe_function;
283 using stack_protected_function = stack_safe_function;
284 using stack_aligned_protected_function = stack_aligned_safe_function;
285 #if defined(SOL_SAFE_FUNCTION) && SOL_SAFE_FUNCTION
286 using function = protected_function;
287 using main_function = main_protected_function;
288 using stack_function = stack_protected_function;
290 using function = unsafe_function;
291 using main_function = main_unsafe_function;
292 using stack_function = stack_unsafe_function;
294 using stack_aligned_function = stack_aligned_unsafe_function;
295 using stack_aligned_stack_handler_function = basic_protected_function<stack_reference, true, stack_reference>;
297 struct unsafe_function_result;
298 struct protected_function_result;
299 using safe_function_result = protected_function_result;
300 #if defined(SOL_SAFE_FUNCTION) && SOL_SAFE_FUNCTION
301 using function_result = safe_function_result;
303 using function_result = unsafe_function_result;
306 template <
typename base_t>
308 template <
typename base_t>
309 class basic_userdata;
310 template <
typename base_t>
311 class basic_lightuserdata;
312 template <
typename base_t>
313 class basic_coroutine;
314 template <
typename base_t>
317 using object = basic_object<reference>;
318 using userdata = basic_userdata<reference>;
319 using lightuserdata = basic_lightuserdata<reference>;
320 using thread = basic_thread<reference>;
321 using coroutine = basic_coroutine<reference>;
322 using main_object = basic_object<main_reference>;
323 using main_userdata = basic_userdata<main_reference>;
324 using main_lightuserdata = basic_lightuserdata<main_reference>;
325 using main_coroutine = basic_coroutine<main_reference>;
326 using stack_object = basic_object<stack_reference>;
327 using stack_userdata = basic_userdata<stack_reference>;
328 using stack_lightuserdata = basic_lightuserdata<stack_reference>;
329 using stack_thread = basic_thread<stack_reference>;
330 using stack_coroutine = basic_coroutine<stack_reference>;
332 struct stack_proxy_base;
334 struct variadic_args;
335 struct variadic_results;
338 struct this_main_state;
339 struct this_environment;
341 template <
typename T>
343 template <
typename T>
344 struct as_container_t;
345 template <
typename T>
347 template <
typename T>
349 template <
typename T>
351 template <
typename T>
353 template <
typename T>
355 template <
typename F,
typename... Filters>
356 struct filter_wrapper;
358 template <
typename T>
359 struct usertype_traits;
360 template <
typename T>
361 struct unique_usertype_traits;
366 #endif // SOL_SINGLE_INCLUDE_FORWARD_HPP