Commit Graph

45 Commits

Author SHA1 Message Date
ThePhD
2203c1f64f Overhaul examples
Overhaul docs for examples
Overhaul function_result and protected_function_result proxies
2017-11-09 17:41:46 -05:00
ThePhD
c523c67f9c move tests to subdir 2017-09-06 05:22:40 -04:00
mrgreywater
372db6f6ab large integer 2017-08-11 11:39:46 -04:00
ThePhD
6eaa277860 bootstrap update to link pthreads, on top of container_traits improvement because of clang++ bounds-checking 2017-08-07 13:58:06 -04:00
ThePhD
5ce8c9f9ba add pthreads to linking libraries because AAHAHAHAAA gcc. 2017-08-07 09:36:47 -04:00
ThePhD
e1c8d4b061 clang and gcc differ in their use of unknown options.... which is always nice, always nice for two compilers to fight with each other 2017-06-07 13:24:53 -04:00
ThePhD
b391a709bc no-unknown-warning should prevent older compilers from barfing 2017-06-07 13:02:51 -04:00
ThePhD
661386c384 revert codecvt fix for MinGW v7 and greater
add docs about compiler support
add notes about compilation issues
update single
2017-06-07 12:33:59 -04:00
ThePhD
282913c258 herp derp 2016-08-22 23:09:08 -04:00
ThePhD
5b65ea1460 O-O-O-OVERHAAAAAUL no not really just bug fixes.... 2016-08-22 22:45:06 -04:00
The Phantom Derpstorm
37540d086e Merge pull request #186 from wtfbbqhax/luajit-osx
Fix OSX + Luajit
2016-08-22 14:23:33 -04:00
Kevin Brightwell
afd32908d5 Add test case for require_file with a usertype
I was having problems with usertypes and require_file, so I figured I
shoudl work in a less complicated testbed than mine, and worked here.
There as not a test case, so I wrote this one.

Additionally, adjusted bootstrap.py to allow for `--lua-version lua53`
syntax since most older linux systems use lua52, its useful to override.
2016-08-22 12:19:03 -04:00
Victor Roemer
577058e00c Sprinkle magic sauce preventing EXC_BAD_ACCESS 2016-08-20 19:57:34 -04:00
Victor Roemer
a577a23685 Fix tests with luajit on darwin 2016-08-20 19:40:59 -04:00
ThePhD
7744a49cfe I can spell good I promise
update bootstrap to properly use depsfile
2016-08-17 15:47:18 -04:00
ThePhD
5460f7e626 update examples, support inherited usertype metatables, and beef up wording and fix other crap in docs
Addresses #157 temporarily
2016-08-10 20:39:30 -04:00
ThePhD
5efbae5798 Is pedantic safe to turn on? TIME TO FIND OUT. 2016-04-02 09:11:44 -04:00
ThePhD
3abcf7f086 Fuck you, clang: http://stackoverflow.com/a/8629943/5280922 2016-03-30 03:08:53 -04:00
ThePhD
aff7688620 mfw clang sucks 2016-03-30 02:35:13 -04:00
ThePhD
1a9c7484b1 Fix up the API; prepare for release. 2016-03-11 11:34:44 -05:00
ThePhD
d42efd7fdf Proper trampolines to allow luajit to play nice with all the other kids in sol. 2016-02-27 07:56:28 -05:00
ThePhD
23c3240d59 All set! Thanks Nav. Merged #18 2016-02-25 13:46:26 -05:00
Kevin Brightwell
a76d38571d Add usage of LUA_VERSION variable when using --ci
* Adjust finding Lua for Linux and OSX
* Readd `install.deps.sh`
2016-02-25 13:31:00 -05:00
ThePhD
3f681eea0d And fixes to bootstrap to properly enable building 2016-02-25 11:13:36 -05:00
ThePhD
c78f8b3292 And finally, proper library control. 2016-02-25 09:26:28 -05:00
ThePhD
f700bbc93d This is a lot harder than it needs to be. 2016-02-25 08:54:58 -05:00
ThePhD
32b9e13e91 Bwuh. Clang version 3.5 is not available on precis either. 2016-02-25 08:43:41 -05:00
ThePhD
994095636c Proper luajit testing 2016-02-25 08:28:07 -05:00
ThePhD
3f6de17856 clang and g++ versions we want to target 2016-02-25 08:08:05 -05:00
ThePhD
0bed2a9540 Alll the include files! 2016-02-25 03:45:44 -05:00
ThePhD
9227f25e9c Not very good at argparse... 2016-02-25 03:43:12 -05:00
ThePhD
626f4a7728 Compiling for both! 2016-02-25 03:36:21 -05:00
ThePhD
ac916b4b91 Default flags and shiny new badge 2016-02-25 00:08:42 -05:00
ThePhD
9c21d11b8c Proper defaults for bootstrap.py
Checks in g++ to make sure things compile
clang++ is a major asshole...
2016-02-24 13:59:17 -05:00
Kevin Brightwell
3263e67979 Change bootstrap.py to respect CXX variable 2016-02-24 10:36:12 -05:00
ThePhD
1293213775 Several improvements to tunnneling for the library, with included tests
Some stack size tests are also included to prevent stack overflow as well.
2016-02-13 20:14:31 -05:00
ThePhD
9372b54b02 Preparing for overload support
Preparing to benchmarking of several different lua frameworks
2016-02-09 03:38:11 -05:00
Rapptz
a5e24b4fa2 Fix userdata -> usertype in examples. 2015-07-21 19:26:35 -04:00
Rapptz
a2237eb068 Fix lack of inline in functions.
diff --git a/bootstrap.py b/bootstrap.py
index c24f6e5..1d6a0b3 100755
--- a/bootstrap.py
+++ b/bootstrap.py
@@ -37,6 +37,7 @@ parser = argparse.ArgumentParser()
 parser.add_argument('--debug', action='store_true', help='compile with debug flags')
 parser.add_argument('--cxx', metavar='<compiler>', help='compiler name to use (default: g++)', default='g++')
 parser.add_argument('--ci', action='store_true', help=argparse.SUPPRESS)
+parser.add_argument('--testing', action='store_true', help=argparse.SUPPRESS)
 parser.add_argument('--lua-dir', metavar='<dir>', help='directory lua is in with include and lib subdirectories')
 parser.add_argument('--install-dir', metavar='<dir>', help='directory to install the headers to', default=install_dir);
 parser.epilog = """In order to install sol, administrative privileges might be required.
@@ -80,6 +81,9 @@ if args.ci:
 else:
     ldflags.extend(libraries(['lua']))

+if args.testing:
+    cxxflags.append('-Wmissing-declarations')
+
 if 'linux' in sys.platform:
     ldflags.extend(libraries(['dl']))

diff --git a/sol/demangle.hpp b/sol/demangle.hpp
index 694a2be..78f4dd4 100644
--- a/sol/demangle.hpp
+++ b/sol/demangle.hpp
@@ -33,12 +33,12 @@
 namespace sol {
 namespace detail {
 #ifdef _MSC_VER
-std::string get_type_name(const std::type_info& id) {
+inline std::string get_type_name(const std::type_info& id) {
     return id.name();
 }

 #elif defined(__GNUC__) || defined(__clang__)
-std::string get_type_name(const std::type_info& id) {
+inline std::string get_type_name(const std::type_info& id) {
     int status;
     char* unmangled = abi::__cxa_demangle(id.name(), 0, 0, &status);
     std::string realname = unmangled;
@@ -50,7 +50,7 @@ std::string get_type_name(const std::type_info& id) {
 #error Compiler not supported for demangling
 #endif // compilers

-std::string demangle(const std::type_info& id) {
+inline std::string demangle(const std::type_info& id) {
     std::string realname = get_type_name(id);
     const static std::array<std::string, 2> removals = {{ "struct ", "class " }};
     const static std::array<std::string, 2> replacements = {{ "::", "_" }};
diff --git a/sol/resolve.hpp b/sol/resolve.hpp
index 0d849d0..1f6f606 100644
--- a/sol/resolve.hpp
+++ b/sol/resolve.hpp
@@ -28,66 +28,67 @@
 namespace sol {
 namespace detail {
 template<typename R, typename... Args, typename F, typename = typename std::result_of<Unqualified<F>(Args...)>::type>
-auto resolve_i(types<R(Args...)>, F&&)->R(Unqualified<F>::*)(Args...) {
+inline auto resolve_i(types<R(Args...)>, F&&) -> R(Unqualified<F>::*)(Args...) {
     using Sig = R(Args...);
     typedef Unqualified<F> Fu;
     return static_cast<Sig Fu::*>(&Fu::operator());
 }

 template<typename F, typename U = Unqualified<F>>
-auto resolve_f(std::true_type, F&& f) -> decltype(resolve_i(types<function_signature_t<decltype(&U::operator())>>(), std::forward<F>(f))) {
+inline auto resolve_f(std::true_type, F&& f)
+-> decltype(resolve_i(types<function_signature_t<decltype(&U::operator())>>(), std::forward<F>(f))) {
     return resolve_i(types<function_signature_t<decltype(&U::operator())>>(), std::forward<F>(f));
 }

 template<typename F>
-void resolve_f(std::false_type, F&&) {
+inline void resolve_f(std::false_type, F&&) {
     static_assert(has_deducible_signature<F>::value,
                   "Cannot use no-template-parameter call with an overloaded functor: specify the signature");
 }

 template<typename F, typename U = Unqualified<F>>
-auto resolve_i(types<>, F&& f) -> decltype(resolve_f(has_deducible_signature<U> {}, std::forward<F>(f))) {
+inline auto resolve_i(types<>, F&& f) -> decltype(resolve_f(has_deducible_signature<U> {}, std::forward<F>(f))) {
     return resolve_f(has_deducible_signature<U> {}, std::forward<F>(f));
 }

 template<typename... Args, typename F, typename R = typename std::result_of<F&(Args...)>::type>
-auto resolve_i(types<Args...>, F&& f) -> decltype( resolve_i(types<R(Args...)>(), std::forward<F>(f))) {
+inline auto resolve_i(types<Args...>, F&& f) -> decltype( resolve_i(types<R(Args...)>(), std::forward<F>(f))) {
     return resolve_i(types<R(Args...)>(), std::forward<F>(f));
 }

 template<typename Sig, typename C>
-Sig C::* resolve_v(std::false_type, Sig C::* mem_func_ptr) {
+inline Sig C::* resolve_v(std::false_type, Sig C::* mem_func_ptr) {
     return mem_func_ptr;
 }

 template<typename Sig, typename C>
-Sig C::* resolve_v(std::true_type, Sig C::* mem_variable_ptr) {
+inline Sig C::* resolve_v(std::true_type, Sig C::* mem_variable_ptr) {
     return mem_variable_ptr;
 }
 } // detail

 template<typename... Args, typename R>
-auto resolve(R fun_ptr(Args...)) -> R(*)(Args...) {
+inline auto resolve(R fun_ptr(Args...)) -> R(*)(Args...) {
     return fun_ptr;
 }

 template<typename Sig>
-Sig* resolve(Sig* fun_ptr) {
+inline Sig* resolve(Sig* fun_ptr) {
     return fun_ptr;
 }

 template<typename... Args, typename R, typename C>
-auto resolve(R(C::*mem_ptr)(Args...)) -> R(C::*)(Args...) {
+inline auto resolve(R(C::*mem_ptr)(Args...)) -> R(C::*)(Args...) {
     return mem_ptr;
 }

 template<typename Sig, typename C>
-Sig C::* resolve(Sig C::* mem_ptr) {
+inline Sig C::* resolve(Sig C::* mem_ptr) {
     return detail::resolve_v(std::is_member_object_pointer<Sig C::*>(), mem_ptr);
 }

 template<typename... Sig, typename F>
-auto resolve(F&& f) -> decltype(detail::resolve_i(types<Sig...>(), std::forward<F>(f))) {
+inline auto resolve(F&& f) -> decltype(detail::resolve_i(types<Sig...>(), std::forward<F>(f))) {
     return detail::resolve_i(types<Sig...>(), std::forward<F>(f));
 }
 } // sol
2014-08-10 21:07:19 -04:00
Rapptz
2a5b800286 Change shebang of bootstrap 2014-08-10 19:59:03 -04:00
Rapptz
6774249bb5 Ignore some warnings on clang. 2014-08-04 21:19:16 -04:00
Rapptz
68c89c53b9 Add uninstall and install targets to ninja. 2014-08-04 19:29:38 -04:00
Rapptz
6f52eb532e Update bootstrap.py to handle external lua directories and linking on
linux.
2014-08-04 18:30:13 -04:00
Rapptz
ab935a01a2 Fix typo with bootstrap.py 2014-06-05 18:45:59 -04:00
Rapptz
047d9de0f8 Switched over to bootstrap.py script 2014-06-05 18:37:46 -04:00