summaryrefslogtreecommitdiffstats
path: root/lib/tolua++/src/bin/lua/enumerate.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tolua++/src/bin/lua/enumerate.lua')
-rw-r--r--lib/tolua++/src/bin/lua/enumerate.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/tolua++/src/bin/lua/enumerate.lua b/lib/tolua++/src/bin/lua/enumerate.lua
index d5d4426cf..ef3a9574c 100644
--- a/lib/tolua++/src/bin/lua/enumerate.lua
+++ b/lib/tolua++/src/bin/lua/enumerate.lua
@@ -48,13 +48,17 @@ function classEnumerate:print (ident,close)
print(ident.."}"..close)
end
+function emitenumprototype(type)
+ output("int tolua_is" .. string.gsub(type,"::","_") .. " (lua_State* L, int lo, const char * type, int def, tolua_Error* err);")
+end
+
_global_output_enums = {}
-- write support code
function classEnumerate:supcode ()
if _global_output_enums[self.name] == nil then
_global_output_enums[self.name] = 1
- output("lua_Number tolua_is" .. self.name .. " (lua_State* L, int lo, int def, tolua_Error* err)")
+ output("int tolua_is" .. string.gsub(self.name,"::","_") .. " (lua_State* L, int lo, const char * type, int def, tolua_Error* err)")
output("{")
output("if (!tolua_isnumber(L,lo,def,err)) return 0;")
output("lua_Number val = tolua_tonumber(L,lo,def);")
@@ -130,7 +134,7 @@ function Enumerate (n,b,varname)
e.min = min
e.max = max
if n ~= "" then
- _enum_is_functions[n] = ("tolua_is" .. n)
+ _enums[n] = 1
Typedef("int "..n)
end
return _Enumerate(e, varname)