[freenet-cvs] r18390 - trunk/freenet/src/freenet/support

nextgens at freenetproject.org nextgens at freenetproject.org
Thu Mar 6 15:33:06 UTC 2008


Author: nextgens
Date: 2008-03-06 15:33:05 +0000 (Thu, 06 Mar 2008)
New Revision: 18390

Modified:
   trunk/freenet/src/freenet/support/LibraryLoader.java
Log:
better that way

Modified: trunk/freenet/src/freenet/support/LibraryLoader.java
===================================================================
--- trunk/freenet/src/freenet/support/LibraryLoader.java	2008-03-06 15:31:37 UTC (rev 18389)
+++ trunk/freenet/src/freenet/support/LibraryLoader.java	2008-03-06 15:33:05 UTC (rev 18390)
@@ -33,12 +33,13 @@
 	
 	public static void loadNative(String path, String libraryName) {
 		final boolean isWindows = File.pathSeparatorChar == '\\';
+		final String prefix = (isWindows ? ".dll" : ((System.getProperty("os.name")).toLowerCase().startsWith("mac") ? ".jnilib" : ".so"));
 		final String libraryNameWithPrefix = (isWindows ? "" : "lib") + libraryName;
 		final String libraryNameWithPrefixAndArch = libraryNameWithPrefix + '-' + getSimplifiedArchitecture();
-		final String libraryNameWithPrefixAndArchAndSuffix = libraryNameWithPrefixAndArch + (isWindows ? ".dll" : ((System.getProperty("os.name")).toLowerCase().startsWith("mac") ? ".jnilib" : ".so"));
+		final String libraryNameWithPrefixAndArchAndSuffix = libraryNameWithPrefixAndArch + prefix;
 		String resourceName = path + libraryNameWithPrefixAndArchAndSuffix;
 
-		File nativeLib = new File((System.getProperty("java.library.path")) + "/lib" + libraryName + (isWindows ? ".dll" : ".so"));
+		File nativeLib = new File((System.getProperty("java.library.path")) + "/lib" + libraryName + prefix);
 		if (nativeLib.exists()) {
 			System.out.println("Attempting to load the NativeThread library ["+libraryName+']');
 			System.loadLibrary(libraryName);




More information about the cvs mailing list