mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-07 09:16:53 +08:00
26 lines
407 B
C++
26 lines
407 B
C++
|
|
#include <chaiscript/chaiscript.hpp>
|
|
#include <string>
|
|
|
|
std::string hello_world()
|
|
{
|
|
return "Hello World";
|
|
}
|
|
|
|
#ifdef _MSC_VER
|
|
#define EXPORT __declspec(dllexport)
|
|
#else
|
|
#define EXPORT
|
|
#endif
|
|
|
|
extern "C"
|
|
{
|
|
EXPORT chaiscript::ModulePtr create_chaiscript_module_test()
|
|
{
|
|
chaiscript::ModulePtr m(new chaiscript::Module());
|
|
|
|
m->add(chaiscript::fun(hello_world), "hello_world");
|
|
return m;
|
|
}
|
|
}
|