summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/BLua.h2
-rw-r--r--lib/BLua.cc11
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);
}