Add support for loadable modules on POSIX systems
This commit is contained in:
19
src/test_module.cpp
Normal file
19
src/test_module.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
#include <chaiscript/chaiscript.hpp>
|
||||
#include <string>
|
||||
|
||||
std::string hello_world()
|
||||
{
|
||||
return "Hello World";
|
||||
}
|
||||
|
||||
extern "C"
|
||||
{
|
||||
chaiscript::ModulePtr create_chaiscript_module_test()
|
||||
{
|
||||
chaiscript::ModulePtr m(new chaiscript::Module());
|
||||
|
||||
m->add(chaiscript::fun(hello_world), "hello_world");
|
||||
return m;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user