Mark Gossage patch 1295168
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7470 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
92c5d2a22b
commit
afda89dc49
7 changed files with 61 additions and 34 deletions
|
|
@ -3,13 +3,15 @@
|
|||
-- This file illustrates class C++ interface generated
|
||||
-- by SWIG.
|
||||
|
||||
-- importing (lua does not have a nice way to do this)
|
||||
loadlibrary = loadlib("example.so","Example_Init")
|
||||
if loadlibrary == nil then
|
||||
loadlibrary = loadlib("example.dll","Example_Init")
|
||||
---- 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')
|
||||
assert(lib)()
|
||||
else
|
||||
-- lua 5.1 does
|
||||
require('example')
|
||||
end
|
||||
assert(loadlibrary, "could not find dynamic libray")
|
||||
loadlibrary()
|
||||
|
||||
----- Object creation -----
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue