1 // Copyright (c) 2003 Daniel Wallin and Arvid Norberg
2 
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:
9 
10 // The above copyright notice and this permission notice shall be included
11 // in all copies or substantial portions of the Software.
12 
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.
22 
23 
24 #ifndef LUABIND_CONFIG_HPP_INCLUDED
25 #define LUABIND_CONFIG_HPP_INCLUDED
26 
27 #include <boost/config.hpp>
28 
29 #ifdef BOOST_MSVC
30 	#define LUABIND_ANONYMOUS_FIX static
31 #else
32 	#define LUABIND_ANONYMOUS_FIX
33 #endif
34 
35 #if defined (BOOST_MSVC) && (BOOST_MSVC <= 1200)
36 
37 #define for if (false) {} else for
38 
39 #include <cstring>
40 
41 namespace std
42 {
43 	using ::strlen;
44 	using ::strcmp;
45 	using ::type_info;
46 }
47 
48 #endif
49 
50 
51 #if defined (BOOST_MSVC) && (BOOST_MSVC <= 1300)
52 	#define LUABIND_MSVC_TYPENAME
53 #else
54 	#define LUABIND_MSVC_TYPENAME typename
55 #endif
56 
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
65 
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
75 
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.
87 
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.
93 
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).
102 
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
116 
117 #ifndef LUABIND_API
118 # define LUABIND_API
119 #endif
120 
121 namespace luabind {
122 
123 LUABIND_API void disable_super_deprecation();
124 
125 } // namespace luabind
126 
127 #endif // LUABIND_CONFIG_HPP_INCLUDED
128 
129