diff options
author | pixel <pixel> | 2008-08-06 11:58:06 +0000 |
---|---|---|
committer | pixel <pixel> | 2008-08-06 11:58:06 +0000 |
commit | b7014aad09a7f5653e2931858a1c148a15f21352 (patch) | |
tree | f5d5b27ca0fa8128deed1ac8a4d3a858f0c25eb7 /src/lua-plugin.cc | |
parent | f3c88af7e5db334fbce6cc4399e6b7e41dc33812 (diff) |
Adding win32 osmesa / imagemagick support, and cleaning up a bit.
Diffstat (limited to 'src/lua-plugin.cc')
-rw-r--r-- | src/lua-plugin.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lua-plugin.cc b/src/lua-plugin.cc index 79968a6..92b379b 100644 --- a/src/lua-plugin.cc +++ b/src/lua-plugin.cc @@ -9,6 +9,8 @@ void LuaLoadPlugin(const String & _fname, Lua * L) throw (GeneralException) { HMODULE handle; String fname = _fname + ".dll"; + printm(M_INFO, "Loading library " + fname + "\n"); + if (!(handle = LoadLibraryEx(fname.to_charp(), NULL, LOAD_WITH_ALTERED_SEARCH_PATH)) && !(handle = LoadLibraryEx(fname.to_charp(), NULL, NULL))) { throw GeneralException("File not found or error loading shared object file: " + fname + "; Error #" + String((int) GetLastError())); @@ -20,6 +22,8 @@ void LuaLoadPlugin(const String & _fname, Lua * L) throw (GeneralException) { throw GeneralException("No init pointer on plugin " + fname); } + printm(M_INFO, "Library loaded, init ptr = %p\n", init_ptr); + init_ptr(L); } #else @@ -28,6 +32,8 @@ void LuaLoadPlugin(const String & _fname, Lua * L) throw (GeneralException) { void LuaLoadPlugin(const String & fname, Lua * L) throw (GeneralException) { void * handle = dlopen(("./" + fname + ".so").to_charp(), RTLD_NOW | RTLD_GLOBAL); + printm(M_INFO, "Loading library " + fname + "\n"); + if (!handle) { throw GeneralException("File not found or error loading shared object file: " + fname + "; " + dlerror()); } @@ -38,6 +44,8 @@ void LuaLoadPlugin(const String & fname, Lua * L) throw (GeneralException) { throw GeneralException("No init pointer on plugin " + fname); } + printm(M_INFO, "Library loaded, init ptr = %p\n", init_ptr); + init_ptr(L); } #endif |