[lua] extras compability for lua 5.1, fixed a static link name conflict

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9864 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Mark Gossage 2007-07-10 09:30:49 +00:00
commit f87371fe8c
15 changed files with 61 additions and 104 deletions

View file

@ -6,7 +6,7 @@
---- importing ----
if string.sub(_VERSION,1,7)=='Lua 5.0' then
-- lua5.0 doesnt have a nice way to do this
lib=loadlib('example.dll','Example_Init') or loadlib('example.so','Example_Init')
lib=loadlib('example.dll','luaopen_example') or loadlib('example.so','luaopen_example')
assert(lib)()
else
-- lua 5.1 does

View file

@ -3,7 +3,7 @@
---- importing ----
if string.sub(_VERSION,1,7)=='Lua 5.0' then
-- lua5.0 doesnt have a nice way to do this
lib=loadlib('example.dll','Example_Init') or loadlib('example.so','Example_Init')
lib=loadlib('example.dll','luaopen_example') or loadlib('example.so','luaopen_example')
assert(lib)()
else
-- lua 5.1 does

View file

@ -1,7 +1,7 @@
---- importing ----
if string.sub(_VERSION,1,7)=='Lua 5.0' then
-- lua5.0 doesnt have a nice way to do this
lib=loadlib('example.dll','Example_Init') or loadlib('example.so','Example_Init')
lib=loadlib('example.dll','luaopen_example') or loadlib('example.so','luaopen_example')
assert(lib)()
else
-- lua 5.1 does

View file

@ -1,7 +1,7 @@
---- importing ----
if string.sub(_VERSION,1,7)=='Lua 5.0' then
-- lua5.0 doesnt have a nice way to do this
lib=loadlib('example.dll','Example_Init') or loadlib('example.so','Example_Init')
lib=loadlib('example.dll','luaopen_example') or loadlib('example.so','luaopen_example')
assert(lib)()
else
-- lua 5.1 does

View file

@ -2,7 +2,7 @@
---- importing ----
if string.sub(_VERSION,1,7)=='Lua 5.0' then
-- lua5.0 doesnt have a nice way to do this
lib=loadlib('example.dll','Example_Init') or loadlib('example.so','Example_Init')
lib=loadlib('example.dll','luaopen_example') or loadlib('example.so','luaopen_example')
assert(lib)()
else
-- lua 5.1 does

View file

@ -4,14 +4,14 @@ print("Testing the %import directive")
if string.sub(_VERSION,1,7)=='Lua 5.0' then
-- lua5.0 doesnt have a nice way to do this
function loadit(a,b)
lib=loadlib(a..':dll',b) or loadlib(a..':so',b)
function loadit(a)
lib=loadlib(a..'.dll','luaopen_'..a) or loadlib(a..'.so','luaopen_'..a)
assert(lib)()
end
loadit('base','Base_Init')
loadit('foo','Foo_Init')
loadit('bar','Bar_Init')
loadit('spam','Spam_Init')
loadit('base')
loadit('foo')
loadit('bar')
loadit('spam')
else
-- lua 5.1 does
require 'base'

View file

@ -1,7 +1,7 @@
---- importing ----
if string.sub(_VERSION,1,7)=='Lua 5.0' then
-- lua5.0 doesnt have a nice way to do this
lib=loadlib('example.dll','Example_Init') or loadlib('example.so','Example_Init')
lib=loadlib('example.dll','luaopen_example') or loadlib('example.so','luaopen_example')
assert(lib)()
else
-- lua 5.1 does

View file

@ -1,7 +1,7 @@
---- importing ----
if string.sub(_VERSION,1,7)=='Lua 5.0' then
-- lua5.0 doesnt have a nice way to do this
lib=loadlib('example.dll','Example_Init') or loadlib('example.so','Example_Init')
lib=loadlib('example.dll','luaopen_example') or loadlib('example.so','luaopen_example')
assert(lib)()
else
-- lua 5.1 does

View file

@ -1,7 +1,7 @@
---- importing ----
if string.sub(_VERSION,1,7)=='Lua 5.0' then
-- lua5.0 doesnt have a nice way to do this
lib=loadlib('example.dll','Example_Init') or loadlib('example.so','Example_Init')
lib=loadlib('example.dll','luaopen_example') or loadlib('example.so','luaopen_example')
assert(lib)()
else
-- lua 5.1 does