swig/swig-lua-fix-void-return-for-int-functions.patch
Klaus Kämpf 9108068fca Accepting request 201652 from home:badshah400:branches:devel:tools:building
Add patch to fix a swig regression in version 2.0.11 causing void returns in non-void functions; patch submitted upstream.

OBS-URL: https://build.opensuse.org/request/show/201652
OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/swig?expand=0&rev=56
2013-10-02 06:33:50 +00:00

43 lines
1.3 KiB
Diff

From ea4a4e435f721380555fea039bd5dc758eda43ae Mon Sep 17 00:00:00 2001
From: Atri <badshah400@gmail.com>
Date: Tue, 1 Oct 2013 01:28:26 +0530
Subject: [PATCH] Lua: Fix void return for non-void functions
Commit #c3f3880d caused the functions
SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State* L,
swig_lua_namespace* ns)
and
SWIGINTERN int SWIG_Lua_namespace_register(lua_State* L,
swig_lua_namespace* ns)
to return void when int returns were expected resulting in the build
failures for plplot's lua bindings for example. This commit fixes the
issue.
---
Lib/lua/luarun.swg | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Lib/lua/luarun.swg b/Lib/lua/luarun.swg
index 4d851bd..8485ed4 100644
--- a/Lib/lua/luarun.swg
+++ b/Lib/lua/luarun.swg
@@ -524,7 +524,7 @@ SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State* L, swig_lua_namespace*
/* clear stack - remove metatble */
lua_pop(L,1);
-
+ return 0;
}
/* helper function. creates namespace table and add it to module table */
@@ -555,6 +555,7 @@ SWIGINTERN int SWIG_Lua_namespace_register(lua_State* L, swig_lua_namespace* ns)
lua_setmetatable(L,-2); /* set metatable */
lua_rawset(L,-3); /* add namespace to module table */
+ return 0;
}
/* -----------------------------------------------------------------------------
* global variable support code: classes
--
1.8.4