diff options
Diffstat (limited to 'tests/testmod.c')
-rw-r--r-- | tests/testmod.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/testmod.c b/tests/testmod.c index 1034d20..a0d2e2a 100644 --- a/tests/testmod.c +++ b/tests/testmod.c | |||
@@ -1,7 +1,5 @@ | |||
1 | #include <stdio.h> | 1 | #include <stdio.h> |
2 | #include <stdlib.h> | 2 | #include <stdlib.h> |
3 | #include <lua.h> | ||
4 | #include <lauxlib.h> | ||
5 | #include "compat-5.3.h" | 3 | #include "compat-5.3.h" |
6 | 4 | ||
7 | 5 | ||
@@ -12,7 +10,7 @@ static int test_isinteger (lua_State *L) { | |||
12 | 10 | ||
13 | 11 | ||
14 | static int test_rotate (lua_State *L) { | 12 | static int test_rotate (lua_State *L) { |
15 | int r = luaL_checkint(L, 1); | 13 | int r = (int)luaL_checkinteger(L, 1); |
16 | int n = lua_gettop(L)-1; | 14 | int n = lua_gettop(L)-1; |
17 | luaL_argcheck(L, (r < 0 ? -r : r) <= n, 1, "not enough arguments"); | 15 | luaL_argcheck(L, (r < 0 ? -r : r) <= n, 1, "not enough arguments"); |
18 | lua_rotate(L, 2, r); | 16 | lua_rotate(L, 2, r); |
@@ -336,6 +334,9 @@ static const luaL_Reg more_funcs[] = { | |||
336 | }; | 334 | }; |
337 | 335 | ||
338 | 336 | ||
337 | #ifdef __cplusplus | ||
338 | extern "C" { | ||
339 | #endif | ||
339 | int luaopen_testmod (lua_State *L) { | 340 | int luaopen_testmod (lua_State *L) { |
340 | int i = 1; | 341 | int i = 1; |
341 | luaL_newlib(L, funcs); | 342 | luaL_newlib(L, funcs); |
@@ -344,4 +345,7 @@ int luaopen_testmod (lua_State *L) { | |||
344 | luaL_setfuncs(L, more_funcs, NUP); | 345 | luaL_setfuncs(L, more_funcs, NUP); |
345 | return 1; | 346 | return 1; |
346 | } | 347 | } |
348 | #ifdef __cplusplus | ||
349 | } | ||
350 | #endif | ||
347 | 351 | ||