diff options
Diffstat (limited to 'src/java/jogamp/common/os')
4 files changed, 15 insertions, 3 deletions
diff --git a/src/java/jogamp/common/os/BionicDynamicLinkerImpl.java b/src/java/jogamp/common/os/BionicDynamicLinkerImpl.java index 488ce99..b4ae70e 100644 --- a/src/java/jogamp/common/os/BionicDynamicLinkerImpl.java +++ b/src/java/jogamp/common/os/BionicDynamicLinkerImpl.java @@ -45,7 +45,7 @@ public final class BionicDynamicLinkerImpl extends UnixDynamicLinkerImpl { private static final int RTLD_LOCAL = 0x00000; private static final int RTLD_GLOBAL = 0x00002; - // --- Begin CustomJavaCode .cfg declarations + @Override public final long openLibraryLocal(String pathname, boolean debug) throws SecurityException { // Note we use RTLD_GLOBAL visibility to _NOT_ allow this functionality to // be used to pre-resolve dependent libraries of JNI code without @@ -58,6 +58,7 @@ public final class BionicDynamicLinkerImpl extends UnixDynamicLinkerImpl { return dlopen(pathname, RTLD_LAZY | RTLD_LOCAL); } + @Override public final long openLibraryGlobal(String pathname, boolean debug) throws SecurityException { // Note we use RTLD_GLOBAL visibility to allow this functionality to // be used to pre-resolve dependent libraries of JNI code without @@ -70,6 +71,7 @@ public final class BionicDynamicLinkerImpl extends UnixDynamicLinkerImpl { return dlopen(pathname, RTLD_LAZY | RTLD_GLOBAL); } + @Override public final long lookupSymbolGlobal(String symbolName) { final long addr = dlsym(RTLD_DEFAULT, symbolName); if(DEBUG_LOOKUP) { diff --git a/src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java b/src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java index bebddc4..b0b77ce 100644 --- a/src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java +++ b/src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java @@ -43,7 +43,7 @@ public final class MacOSXDynamicLinkerImpl extends UnixDynamicLinkerImpl { private static final int RTLD_LOCAL = 0x00004; private static final int RTLD_GLOBAL = 0x00008; - // --- Begin CustomJavaCode .cfg declarations + @Override public final long openLibraryLocal(String pathname, boolean debug) throws SecurityException { // Note we use RTLD_LOCAL visibility to _NOT_ allow this functionality to // be used to pre-resolve dependent libraries of JNI code without @@ -56,6 +56,7 @@ public final class MacOSXDynamicLinkerImpl extends UnixDynamicLinkerImpl { return dlopen(pathname, RTLD_LAZY | RTLD_LOCAL); } + @Override public final long openLibraryGlobal(String pathname, boolean debug) throws SecurityException { // Note we use RTLD_GLOBAL visibility to allow this functionality to // be used to pre-resolve dependent libraries of JNI code without @@ -68,6 +69,7 @@ public final class MacOSXDynamicLinkerImpl extends UnixDynamicLinkerImpl { return dlopen(pathname, RTLD_LAZY | RTLD_GLOBAL); } + @Override public final long lookupSymbolGlobal(String symbolName) { final long addr = dlsym(RTLD_DEFAULT, symbolName); if(DEBUG_LOOKUP) { diff --git a/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java b/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java index 28e166e..1942477 100644 --- a/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java +++ b/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java @@ -50,6 +50,7 @@ import com.jogamp.common.os.DynamicLinker; protected static native long dlsym(long arg0, java.lang.String arg1); + @Override public final long lookupSymbol(long libraryHandle, String symbolName) { final long addr = dlsym(libraryHandle, symbolName); if(DEBUG_LOOKUP) { @@ -58,10 +59,12 @@ import com.jogamp.common.os.DynamicLinker; return addr; } + @Override public final void closeLibrary(long libraryHandle) { dlclose(libraryHandle); } + @Override public final String getLastError() { return dlerror(); } diff --git a/src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java b/src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java index 158bd7c..b95f204 100644 --- a/src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java +++ b/src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java @@ -45,13 +45,14 @@ public final class WindowsDynamicLinkerImpl implements DynamicLinker { private static native long LoadLibraryW(java.lang.String lpLibFileName); - // --- Begin CustomJavaCode .cfg declarations + @Override public final long openLibraryLocal(String libraryName, boolean debug) throws SecurityException { // How does that work under Windows ? // Don't know .. so it's an alias for the time being return openLibraryGlobal(libraryName, debug); } + @Override public final long openLibraryGlobal(String libraryName, boolean debug) throws SecurityException { SecurityUtil.checkLinkPermission(libraryName); long handle = LoadLibraryW(libraryName); @@ -62,6 +63,7 @@ public final class WindowsDynamicLinkerImpl implements DynamicLinker { return handle; } + @Override public final long lookupSymbol(long libraryHandle, String symbolName) { String _symbolName = symbolName; long addr = GetProcAddressA(libraryHandle, _symbolName); @@ -81,6 +83,7 @@ public final class WindowsDynamicLinkerImpl implements DynamicLinker { return addr; } + @Override public final long lookupSymbolGlobal(String symbolName) { if(DEBUG_LOOKUP) { System.err.println("lookupSymbolGlobal: Not supported on Windows"); @@ -89,10 +92,12 @@ public final class WindowsDynamicLinkerImpl implements DynamicLinker { return 0; } + @Override public final void closeLibrary(long libraryHandle) { FreeLibrary(libraryHandle); } + @Override public final String getLastError() { final int err = GetLastError(); return "Last error: 0x"+Integer.toHexString(err)+" ("+err+")"; |