diff options
author | Sven Gothel <[email protected]> | 2013-06-18 01:41:30 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-06-18 01:41:30 +0200 |
commit | 4feb65517ae4a4e2b9b04cdfc4b85582cb8b9784 (patch) | |
tree | b043abfa0ae00ed3915862730e35ef15c9f7f630 /src/java/jogamp/common | |
parent | e18771cc020f6fd42f6427540c079e48699ab310 (diff) |
Robostness: Catch Throwables on NativeLibrary.open(..) and be verbose in DEBUG mode ; DynamicLinker: Add 'String getLastError()'.
Diffstat (limited to 'src/java/jogamp/common')
-rw-r--r-- | src/java/jogamp/common/os/UnixDynamicLinkerImpl.java | 5 | ||||
-rw-r--r-- | src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java b/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java index e4cdbda..7675977 100644 --- a/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java +++ b/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java @@ -71,5 +71,8 @@ public class UnixDynamicLinkerImpl implements DynamicLinker { public void closeLibrary(long libraryHandle) { dlclose(libraryHandle); } - + + public String getLastError() { + return dlerror(); + } } diff --git a/src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java b/src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java index 17d4adc..884ac39 100644 --- a/src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java +++ b/src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java @@ -66,4 +66,9 @@ public class WindowsDynamicLinkerImpl implements DynamicLinker { FreeLibrary(libraryHandle); } + public String getLastError() { + final int err = GetLastError(); + return "Last error: 0x"+Integer.toHexString(err)+" ("+err+")"; + } + } |