Add missing index_tuple.hpp header.
[luabind.git] / luabind / config.hpp
blobd72daa7a4de36c9fdaff764bc874a1e23ec17998
1 // Copyright (c) 2003 Daniel Wallin and Arvid Norberg
3 // Permission is hereby granted, free of charge, to any person obtaining a
4 // copy of this software and associated documentation files (the "Software"),
5 // to deal in the Software without restriction, including without limitation
6 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 // and/or sell copies of the Software, and to permit persons to whom the
8 // Software is furnished to do so, subject to the following conditions:
10 // The above copyright notice and this permission notice shall be included
11 // in all copies or substantial portions of the Software.
13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
14 // ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
15 // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16 // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
17 // SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
18 // ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
21 // OR OTHER DEALINGS IN THE SOFTWARE.
24 #ifndef LUABIND_CONFIG_HPP_INCLUDED
25 #define LUABIND_CONFIG_HPP_INCLUDED
27 #include <boost/config.hpp>
29 #ifdef BOOST_MSVC
30 #define LUABIND_ANONYMOUS_FIX static
31 #else
32 #define LUABIND_ANONYMOUS_FIX
33 #endif
35 #if defined (BOOST_MSVC) && (BOOST_MSVC <= 1200)
37 #define for if (false) {} else for
39 #include <cstring>
41 namespace std
43 using ::strlen;
44 using ::strcmp;
45 using ::type_info;
48 #endif
51 #if defined (BOOST_MSVC) && (BOOST_MSVC <= 1300)
52 #define LUABIND_MSVC_TYPENAME
53 #else
54 #define LUABIND_MSVC_TYPENAME typename
55 #endif
57 // the maximum number of arguments of functions that's
58 // registered. Must at least be 2
59 #ifndef LUABIND_MAX_ARITY
60 #define LUABIND_MAX_ARITY 10
61 #elif LUABIND_MAX_ARITY <= 1
62 #undef LUABIND_MAX_ARITY
63 #define LUABIND_MAX_ARITY 2
64 #endif
66 // the maximum number of classes one class
67 // can derive from
68 // max bases must at least be 1
69 #ifndef LUABIND_MAX_BASES
70 #define LUABIND_MAX_BASES 4
71 #elif LUABIND_MAX_BASES <= 0
72 #undef LUABIND_MAX_BASES
73 #define LUABIND_MAX_BASES 1
74 #endif
76 // LUABIND_NO_ERROR_CHECKING
77 // define this to remove all error checks
78 // this will improve performance and memory
79 // footprint.
80 // if it is defined matchers will only be called on
81 // overloaded functions, functions that's
82 // not overloaded will be called directly. The
83 // parameters on the lua stack are assumed
84 // to match those of the function.
85 // exceptions will still be catched when there's
86 // no error checking.
88 // LUABIND_NOT_THREADSAFE
89 // this define will make luabind non-thread safe. That is,
90 // it will rely on a static variable. You can still have
91 // multiple lua states and use coroutines, but only
92 // one of your real threads may run lua code.
94 // LUABIND_NO_EXCEPTIONS
95 // this define will disable all usage of try, catch and throw in
96 // luabind. This will in many cases disable runtime-errors, such
97 // as invalid casts, when calling lua-functions that fails or
98 // returns values that cannot be converted by the given policy.
99 // Luabind requires that no function called directly or indirectly
100 // by luabind throws an exception (throwing exceptions through
101 // C code has undefined behavior, lua is written in C).
103 #ifdef LUABIND_DYNAMIC_LINK
104 # ifdef BOOST_WINDOWS
105 # ifdef LUABIND_BUILDING
106 # define LUABIND_API __declspec(dllexport)
107 # else
108 # define LUABIND_API __declspec(dllimport)
109 # endif
110 # else
111 # if defined(_GNUC_) && _GNUC_ >=4
112 # define LUABIND_API __attribute__ ((visibility("default")))
113 # endif
114 # endif
115 #endif
117 #ifndef LUABIND_API
118 # define LUABIND_API
119 #endif
121 #if !defined(LUABIND_CPP0x) \
122 && !defined(BOOST_NO_DECLTYPE) \
123 && !defined(BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS) \
124 && !defined(BOOST_NO_VARIADIC_TEMPLATES)
126 # define LUABIND_CPP0x
128 #endif
130 namespace luabind {
132 LUABIND_API void disable_super_deprecation();
134 } // namespace luabind
136 #endif // LUABIND_CONFIG_HPP_INCLUDED