openxray / luabind-deboostified Goto Github PK
View Code? Open in Web Editor NEWThis project forked from decimad/luabind-deboostified
luabind without boost for OpenXRay
License: Other
This project forked from decimad/luabind-deboostified
luabind without boost for OpenXRay
License: Other
When building on Linux with GCC following error occures:
out_value_policy.hpp:220:33: error: wrong number of template arguments (1, should be 3)
storage_.template construct<T>();
out_value_policy.hpp:241:33: error: wrong number of template arguments (1, should be 3)
storage_.template construct<T>();
Compiling on linux. Compiler gcc version 5.3.0 20151204 (Ubuntu 5.3.0-3ubuntu1~14.04)
CMakeFiles/test_abstract_base.dir/test_abstract_base.cpp.o: In function `luabind::detail::call_allocator(void const*, unsigned long)':
test_abstract_base.cpp:(.text._ZN7luabind6detail14call_allocatorEPKvm[_ZN7luabind6detail14call_allocatorEPKvm]+0x13): undefined reference to `luabind::allocator'
test_abstract_base.cpp:(.text._ZN7luabind6detail14call_allocatorEPKvm[_ZN7luabind6detail14call_allocatorEPKvm]+0x1a): undefined reference to `luabind::allocator_context'
collect2: error: ld returned 1 exit status
make[2]: *** [test/test_abstract_base] Error 1
make[1]: *** [test/CMakeFiles/test_abstract_base.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
CMakeFiles/test_attributes.dir/test_attributes.cpp.o: In function `luabind::detail::call_allocator(void const*, unsigned long)':
test_attributes.cpp:(.text._ZN7luabind6detail14call_allocatorEPKvm[_ZN7luabind6detail14call_allocatorEPKvm]+0x13): undefined reference to `luabind::allocator'
test_attributes.cpp:(.text._ZN7luabind6detail14call_allocatorEPKvm[_ZN7luabind6detail14call_allocatorEPKvm]+0x1a): undefined reference to `luabind::allocator_context'
collect2: error: ld returned 1 exit status
make[2]: *** [test/test_attributes] Error 1
make[1]: *** [test/CMakeFiles/test_attributes.dir/all] Error 2
/home/razor/Documents/luabind-deboostified/test/test_adopt_wrapper.cpp: In function ‘void test_main(lua_State*)’:
/home/razor/Documents/luabind-deboostified/test/test_adopt_wrapper.cpp:34:28: error: ‘adopt_policy’ was not declared in this scope
def("make", &make, adopt_policy<0>()),
^
/home/razor/Documents/luabind-deboostified/test/test_adopt_wrapper.cpp:34:44: error: expected primary-expression before ‘)’ token
def("make", &make, adopt_policy<0>()),
^
/home/razor/Documents/luabind-deboostified/test/test_adopt_wrapper.cpp:35:44: error: expected primary-expression before ‘)’ token
def("take", &take, adopt_policy<1>())
^
/home/razor/Documents/luabind-deboostified/test/test_adopt.cpp: In function ‘void test_main(lua_State*)’:
/home/razor/Documents/luabind-deboostified/test/test_adopt.cpp:57:42: error: ‘adopt_policy’ was not declared in this scope
def("take_ownership", &take_ownership, adopt_policy<1>()),
^
/home/razor/Documents/luabind-deboostified/test/test_adopt.cpp:57:58: error: expected primary-expression before ‘)’ token
def("take_ownership", &take_ownership, adopt_policy<1>()),
^
make[2]: *** [test/CMakeFiles/test_adopt_wrapper.dir/test_adopt_wrapper.cpp.o] Error 1
make[1]: *** [test/CMakeFiles/test_adopt_wrapper.dir/all] Error 2
make[2]: *** [test/CMakeFiles/test_adopt.dir/test_adopt.cpp.o] Error 1
make[1]: *** [test/CMakeFiles/test_adopt.dir/all] Error 2
make: *** [all] Error 2
Merge nitrocaster changes.
https://github.com/nitrocaster/luabind
I have tried to use this in my project, and I have found the extern alloc_func allocator
which is missing... (my program is crashing on an attempt to load of LuaBind and fails on allocator as "calling pure-virtual method"). Where I can take the proper allocator and it's context to make this thing working?
https://github.com/OpenXRay/luabind-deboostified/blob/xray/src/memory.cpp
If you have function with default arguments, like this:
void Kill(CScriptGameObject* who, bool bypass_actor_check = false);
It would be exported to Lua as a functions that accepts two arguments, but not one. If you will try to call it with one argument it will crash.
In the previous luabind version you could use casts to fix the problem:
.def("kill", (void (CScriptGameObject::*)(CScriptGameObject*))&CScriptGameObject::Kill)
.def("kill", (void (CScriptGameObject::*)(CScriptGameObject*, bool))(&CScriptGameObject::Kill))
In this new version this doesn't help. The second parameter will be filled with trash.
The previous version of luabind was very permissive for script errors.
For example, you have a function and it is exported to Lua:
void func(int arg1, int arg2); // functions itself
def("func", &func) // export
If you pass to this functions wrong parameters, like this:
func("__") -- Passing string instead of a number. This is wrong!!!
-- The second argument is forgotten. This is wrong too!!!
Nothing will happen. The script just hang and that's all. No crash will proceed.
But in this new version it crashes on every error and doesn't have a permissive mode, which is bad for compatibility.
We should add some sort of permissive mode that ignores the errors like it was before.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.