diff options
author | Sven Gothel <[email protected]> | 2012-06-18 18:21:15 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-06-18 18:21:15 +0200 |
commit | 05024570dbf5fce08fa8ff081cb696f0fc4b7f95 (patch) | |
tree | 2d5ac237803252a7490805c35e211daebe07381b /src/java/com/jogamp/common/os/NativeLibrary.java | |
parent | 1468286bf569a493e4fdb887d5f3732f88c8cec3 (diff) |
Fix Platform static initialization interdependencies w/ GlueGen native library loading
Some Platform field declarations and it's static initialization has been delegated
to it's new abstract super class PlatformPropsImpl to solve
static initialization interdependencies w/ the GlueGen native library loading
and it's derived information {@link #getMachineDescription()}, {@link #is32Bit()}, ..<br>
This mechanism is preferred in this case to avoid synchronization and locking
and allow better performance accessing the mentioned fields/methods.
Diffstat (limited to 'src/java/com/jogamp/common/os/NativeLibrary.java')
-rwxr-xr-x | src/java/com/jogamp/common/os/NativeLibrary.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/java/com/jogamp/common/os/NativeLibrary.java b/src/java/com/jogamp/common/os/NativeLibrary.java index d0b135e..1fc2e65 100755 --- a/src/java/com/jogamp/common/os/NativeLibrary.java +++ b/src/java/com/jogamp/common/os/NativeLibrary.java @@ -42,6 +42,7 @@ package com.jogamp.common.os; import com.jogamp.common.util.IOUtil; import jogamp.common.os.MacOSXDynamicLinkerImpl; +import jogamp.common.os.PlatformPropsImpl; import jogamp.common.os.UnixDynamicLinkerImpl; import jogamp.common.os.WindowsDynamicLinkerImpl; @@ -70,7 +71,7 @@ public class NativeLibrary implements DynamicLookupHelper { static { // Instantiate dynamic linker implementation - switch (Platform.OS_TYPE) { + switch (PlatformPropsImpl.OS_TYPE) { case WINDOWS: dynLink = new WindowsDynamicLinkerImpl(); prefixes = new String[] { "" }; @@ -335,7 +336,7 @@ public class NativeLibrary implements DynamicLookupHelper { } // Add probable Mac OS X-specific paths - if (Platform.OS_TYPE == Platform.OSType.MACOS) { + if (PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS) { // Add historical location addPaths("/Library/Frameworks/" + libName + ".Framework", baseNames, paths); // Add current location @@ -349,7 +350,7 @@ public class NativeLibrary implements DynamicLookupHelper { private static String selectName(String windowsLibName, String unixLibName, String macOSXLibName) { - switch (Platform.OS_TYPE) { + switch (PlatformPropsImpl.OS_TYPE) { case WINDOWS: return windowsLibName; @@ -397,14 +398,14 @@ public class NativeLibrary implements DynamicLookupHelper { } String[] res = new String[prefixes.length * suffixes.length + - ( Platform.OS_TYPE == Platform.OSType.MACOS ? 1 : 0 )]; + ( PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS ? 1 : 0 )]; int idx = 0; for (int i = 0; i < prefixes.length; i++) { for (int j = 0; j < suffixes.length; j++) { res[idx++] = prefixes[i] + libName + suffixes[j]; } } - if (Platform.OS_TYPE == Platform.OSType.MACOS) { + if (PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS) { // Plain library-base-name in Framework folder res[idx++] = libName; } |