summaryrefslogtreecommitdiffstats
path: root/lib/tolua++/src/bin/lua/function.lua
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-03-20 22:36:24 +0100
committermadmaxoft <github@xoft.cz>2014-03-20 22:36:24 +0100
commit62f84d968a71ab14f6d79696fd1312a17239ba60 (patch)
tree0fcc5c7192de84edcba547f417c9b5f1bb62077e /lib/tolua++/src/bin/lua/function.lua
parentPlugins can set flying speed. (diff)
parentFixed enum checking functions not being called in generated code (diff)
downloadcuberite-62f84d968a71ab14f6d79696fd1312a17239ba60.tar
cuberite-62f84d968a71ab14f6d79696fd1312a17239ba60.tar.gz
cuberite-62f84d968a71ab14f6d79696fd1312a17239ba60.tar.bz2
cuberite-62f84d968a71ab14f6d79696fd1312a17239ba60.tar.lz
cuberite-62f84d968a71ab14f6d79696fd1312a17239ba60.tar.xz
cuberite-62f84d968a71ab14f6d79696fd1312a17239ba60.tar.zst
cuberite-62f84d968a71ab14f6d79696fd1312a17239ba60.zip
Diffstat (limited to 'lib/tolua++/src/bin/lua/function.lua')
-rw-r--r--lib/tolua++/src/bin/lua/function.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/tolua++/src/bin/lua/function.lua b/lib/tolua++/src/bin/lua/function.lua
index 2358e9ff7..3b6b53c5e 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