From 6a3fe7adcc2a3855a574dbfc2bb79c86e7539f26 Mon Sep 17 00:00:00 2001 From: Tycho Date: Wed, 19 Mar 2014 12:38:00 -0700 Subject: Fixed bugs in patched tolua output --- lib/tolua++/src/bin/lua/basic.lua | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'lib/tolua++/src/bin/lua/basic.lua') diff --git a/lib/tolua++/src/bin/lua/basic.lua b/lib/tolua++/src/bin/lua/basic.lua index d195f6dec..b5788f2be 100644 --- a/lib/tolua++/src/bin/lua/basic.lua +++ b/lib/tolua++/src/bin/lua/basic.lua @@ -145,12 +145,14 @@ function typevar(type) end end +-- is enum +function isenum (type) + return _enums[type] +end + -- check if basic type function isbasic (type) local t = gsub(type,'const ','') - if _enum_is_functions[t] then - return nil - end local m,t = applytypedef('', t) local b = _basic[t] if b then @@ -385,7 +387,7 @@ end _push_functions = {} _is_functions = {} -_enum_is_functions = {} +_enums = {} _to_functions = {} _base_push_functions = {} @@ -414,5 +416,8 @@ function get_to_function(t) end function get_is_function(t) - return _enum_is_functions[t] or _is_functions[t] or search_base(t, _base_is_functions) or "tolua_isusertype" + if _enums[t] then + return "tolua_is" .. t + end + return _is_functions[t] or search_base(t, _base_is_functions) or "tolua_isusertype" end -- cgit v1.2.3