diff options
author | chai <chaifix@163.com> | 2018-10-25 08:18:13 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-10-25 08:18:13 +0800 |
commit | 7322a090355af1989d7a1de0de431b6c89844fe2 (patch) | |
tree | c164a05b263007e18cc1c83c8183023d6a19ef82 /src/lua/modules/bit/je_lua_bit.cpp | |
parent | f889c9c20fc09f26eb8a70674c1d60181835c38a (diff) |
*增加lua导出宏
Diffstat (limited to 'src/lua/modules/bit/je_lua_bit.cpp')
-rw-r--r-- | src/lua/modules/bit/je_lua_bit.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/lua/modules/bit/je_lua_bit.cpp b/src/lua/modules/bit/je_lua_bit.cpp index cedd60a..f182ebd 100644 --- a/src/lua/modules/bit/je_lua_bit.cpp +++ b/src/lua/modules/bit/je_lua_bit.cpp @@ -1,5 +1,7 @@ +#include "lua/common/je_lua_common.h" #include "lua/modules/luax.h" #include "libjin/jin.h" + #include <cstdlib> namespace JinEngine @@ -7,7 +9,7 @@ namespace JinEngine namespace Lua { - static int l_and(lua_State* L) + LUA_IMPLEMENT int l_and(lua_State* L) { int a = luax_checkinteger(L, 1); int b = luax_checkinteger(L, 2); @@ -15,7 +17,7 @@ namespace JinEngine return 1; } - static int l_or(lua_State* L) + LUA_IMPLEMENT int l_or(lua_State* L) { int a = luax_checkinteger(L, 1); int b = luax_checkinteger(L, 2); @@ -23,7 +25,7 @@ namespace JinEngine return 1; } - static int l_xor(lua_State* L) + LUA_IMPLEMENT int l_xor(lua_State* L) { int a = luax_checkinteger(L, 1); int b = luax_checkinteger(L, 2); @@ -31,14 +33,14 @@ namespace JinEngine return 1; } - static int l_not(lua_State* L) + LUA_IMPLEMENT int l_not(lua_State* L) { int n = luax_checkinteger(L, 1); luax_pushinteger(L, ~n); return 1; } - static int l_lshift(lua_State* L) + LUA_IMPLEMENT int l_lshift(lua_State* L) { int a = luax_checkinteger(L, 1); int b = luax_checkinteger(L, 2); @@ -46,7 +48,7 @@ namespace JinEngine return 1; } - static int l_rshift(lua_State* L) + LUA_IMPLEMENT int l_rshift(lua_State* L) { int a = luax_checkinteger(L, 1); int b = luax_checkinteger(L, 2); @@ -54,7 +56,7 @@ namespace JinEngine return 1; } - static int l_include(lua_State* L) + LUA_IMPLEMENT int l_include(lua_State* L) { int a = luax_checkinteger(L, 1); int b = luax_checkinteger(L, 2); @@ -62,7 +64,7 @@ namespace JinEngine return 1; } - static const luaL_Reg f[] = { + LUA_IMPLEMENT const luaL_Reg f[] = { { "bAnd", l_and }, { "bOr" , l_or }, { "bXor", l_xor }, @@ -73,7 +75,7 @@ namespace JinEngine { 0, 0 } }; - int luaopen_bit(lua_State* L) + LUA_EXPORT int luaopen_bit(lua_State* L) { luax_newlib(L, f); |