[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:
parent
c3ec8fdce3
commit
f87371fe8c
15 changed files with 61 additions and 104 deletions
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue