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:
William S Fulton 2005-09-20 19:35:23 +00:00
commit afda89dc49
7 changed files with 61 additions and 34 deletions

View file

@ -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 -----