diff options
Diffstat (limited to 'cinterface.lua')
-rw-r--r-- | cinterface.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cinterface.lua b/cinterface.lua index a32230b..c6b5c84 100644 --- a/cinterface.lua +++ b/cinterface.lua @@ -117,7 +117,8 @@ function CInterface:__addchelpers() table.insert(txt, '#define _CWRAP_STR_ARG_TYPES_4821726c1947cdf3eebacade98173939') table.insert(txt, '#include "string.h"') table.insert(txt, 'static void str_arg_types(lua_State *L, char *buf, int n) {') - table.insert(txt, ' for (int i = 1; i <= lua_gettop(L); i++) {') + table.insert(txt, ' int i;') + table.insert(txt, ' for (i = 1; i <= lua_gettop(L); i++) {') table.insert(txt, ' int l;') table.insert(txt, ' const char *torch_type = luaT_typename(L, i);') table.insert(txt, ' if(torch_type && !strncmp(torch_type, "torch.", 6)) torch_type += 6;') |