summaryrefslogtreecommitdiffstats
path: root/lib/tolua++/src/bin/lua/function.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tolua++/src/bin/lua/function.lua')
-rw-r--r--lib/tolua++/src/bin/lua/function.lua15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/tolua++/src/bin/lua/function.lua b/lib/tolua++/src/bin/lua/function.lua
index 2358e9ff7..9338e0fbc 100644
--- a/lib/tolua++/src/bin/lua/function.lua
+++ b/lib/tolua++/src/bin/lua/function.lua
@@ -50,11 +50,20 @@ end
-- Write binding function
-- Outputs C/C++ binding function.
function classFunction:supcode (local_constructor)
-
local overload = strsub(self.cname,-2,-1) - 1 -- indicate overloaded func
local nret = 0 -- number of returned values
local class = self:inclass()
local _,_,static = strfind(self.mod,'^%s*(static)')
+ -- prototypes for enum functions
+ if self.args[1].type ~= 'void' then
+ local i=1
+ while self.args[i] do
+ if isenumtype(self.args[i].type) then
+ emitenumprototype(self.args[i].type)
+ end
+ i = i+1
+ end
+ end
if class then
if self.name == 'new' and self.parent.flags.pure_virtual then
@@ -449,9 +458,8 @@ end
-- Internal constructor
function _Function (t)
setmetatable(t,classFunction)
-
if t.const ~= 'const' and t.const ~= '' then
- error("#invalid 'const' specification")
+ error("#invalid 'const' specification: " .. t.const)
end
append(t)
@@ -480,7 +488,6 @@ end
function Function (d,a,c)
--local t = split(strsub(a,2,-2),',') -- eliminate braces
--local t = split_params(strsub(a,2,-2))
-
if not flags['W'] and string.find(a, "%.%.%.%s*%)") then
warning("Functions with variable arguments (`...') are not supported. Ignoring "..d..a..c)