diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2009-11-08 07:37:18 +0100 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2009-11-08 07:37:18 +0100 |
commit | 988d955f5ff8f2b8ac9cadcc477a9aaa3e708f91 (patch) | |
tree | d68c5d5efa3de9e5c3abdf45ef54a1d246a9c091 | |
parent | 90d611a5f1af7d88393067a97330796feadbff5f (diff) |
Adding jit and bit opens to the Lua class.
-rw-r--r-- | include/BLua.h | 2 | ||||
-rw-r--r-- | lib/BLua.cc | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/include/BLua.h b/include/BLua.h index 4d53191..2afcdef 100644 --- a/include/BLua.h +++ b/include/BLua.h @@ -79,6 +79,8 @@ class Lua : public Base { void open_math(); void open_debug(); void open_dir(); + void open_bit(); + void open_jit(); int wrap_open(openlualib_t); void declarefunc(const String &, lua_CFunction, int = LUA_GLOBALSINDEX); void call(const String &, int = LUA_GLOBALSINDEX, int = 0, int = 0); diff --git a/lib/BLua.cc b/lib/BLua.cc index 7dbf6c1..8771406 100644 --- a/lib/BLua.cc +++ b/lib/BLua.cc @@ -21,6 +21,7 @@ #include "BLua.h" #include "Buffer.h" #include <lualib.h> +#include <luajit.h" #ifndef BUFFERSIZE #define BUFFERSIZE 2048 @@ -644,6 +645,16 @@ void Lua::open_dir() { lua_pop(L, 1); } +void Lua::open_jit() { + luaopen_jit(L); + lua_pop(L, 1); +} + +void Lua::open_bit() { + luaopen_bit(L); + lua_pop(L, 1); +} + int Lua::wrap_open(openlualib_t open) { return open(L); } |