From 695f88366e507032a3a9e1eb747cc48610a4cbe1 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 17 Sep 2019 08:30:49 +0800 Subject: =?UTF-8?q?+=E5=8D=8F=E7=A8=8B=E6=B1=A0=E3=80=81=E6=9E=9A=E4=B8=BE?= =?UTF-8?q?=E3=80=81=E7=BA=BF=E7=A8=8B=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/configure.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/configure.h (limited to 'src/configure.h') diff --git a/src/configure.h b/src/configure.h new file mode 100644 index 0000000..bc107e1 --- /dev/null +++ b/src/configure.h @@ -0,0 +1,38 @@ +#ifndef _CONFIGURE_H_ +#define _CONFIGURE_H_ + +#define TEST_1 1 +#define TEST_2 2 +#define TEST_3 3 +#define TEST_4 4 +#define TEST_5 5 +#define TEST_6 6 +#define TEST_7 7 +#define TEST_8 8 +#define TEST_9 9 +#define TEST_10 10 + + +#define BUILD_TEST TEST_1 + +//----------------------------------------------------------------------------------------------------- + +extern "C" { +#include "lua51/lua.h" +#include "lua51/lualib.h" +#include "lua51/lauxlib.h" +} + +inline void luax_registerglobal(lua_State* L, luaL_reg *fns) +{ + luaL_reg* fn; + int i = 0; + for (fn = &fns[0]; fn->name != 0; fn = &fns[++i]) + { + lua_pushcfunction(L, fn->func); + lua_setglobal(L, fn->name); + } +} + + +#endif \ No newline at end of file -- cgit v1.1-26-g67d0