From: <eli...@us...> - 2006-07-03 10:28:47
|
Revision: 2419 Author: elias_naur Date: 2006-07-03 03:28:32 -0700 (Mon, 03 Jul 2006) ViewCVS: http://svn.sourceforge.net/java-game-lib/?rev=2419&view=rev Log Message: ----------- Removed multiple library names support from Sys.java, it is not needed anymore Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/DefaultSysImplementation.java trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java trunk/LWJGL/src/java/org/lwjgl/Sys.java trunk/LWJGL/src/java/org/lwjgl/SysImplementation.java trunk/LWJGL/src/java/org/lwjgl/applet/LWJGLInstaller.java trunk/LWJGL/src/java/org/lwjgl/test/applet/AppletTest.java Modified: trunk/LWJGL/src/java/org/lwjgl/DefaultSysImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/DefaultSysImplementation.java 2006-07-03 10:21:44 UTC (rev 2418) +++ trunk/LWJGL/src/java/org/lwjgl/DefaultSysImplementation.java 2006-07-03 10:28:32 UTC (rev 2419) @@ -39,13 +39,6 @@ * $Id$ */ abstract class DefaultSysImplementation implements SysImplementation { - /** The native library name */ - protected static final String LIBRARY_NAME = "lwjgl"; - - public String[] getNativeLibraryNames() { - return new String[]{LIBRARY_NAME}; - } - public native String getNativeLibraryVersion(); public native void setDebug(boolean debug); Modified: trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java 2006-07-03 10:21:44 UTC (rev 2418) +++ trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java 2006-07-03 10:28:32 UTC (rev 2419) @@ -42,37 +42,6 @@ * $Id$ */ class MacOSXSysImplementation extends J2SESysImplementation { - public String[] getNativeLibraryNames() { - /* If we're on 10.4, fine, we'll just try the default library name. For - * earlier versions of Mac OS X, try the legacy library first. - * - * Having a kludge like this is unfortunate, but necessary for the following reasons: - * 1. We need two libraries to support Mac OS X 10.2, 10.3 and 10.4. We could - * cover 10.2, 10.3 and 10.4 with one gcc 3 compiled library, but then we - * loose intel mac support. Instead, we'll distribute two versions of the lwjgl - * native library, the default and a legacy one. - * 2. The default library will be universal ('fat') with both intel and powerpc support - * compiled in. This requires gcc 4, and makes the library unusable on Mac OS X 10.3 - * and earlier (actually 10.3.9 has the required gcc 4 libraries, but we'll ignore that). - * We could still choose to load the default library first, and the legacy one later, - * but a bug in the Mac OS X java implementation forces a java program to exit - * if the loaded library has a missing dependency (The correct behaviour is to throw - * an UnsatisfiedLinkError, like on linux and windows). - * 3. If the LWJGL program is launched with an intelligent ClassLoader, this issue can be avoided - * altogether, and the legacy library naming can be avoided too. For example, when - * using webstart, one can supply two nativelib references, one for Mac OS X 10.4 - * (the default library), and one for earlier Mac OS X (the legacy library). This is the - * preferred way to deploy the libraries. The legacy naming is for the users that don't want to - * mess around with libraries and classloaders. They can simply make sure that lwjgl.jar - * is in the classpath and that both the default library and the legacy library is in the native - * library path (java.library.path). - */ - if (LWJGLUtil.isMacOSXEqualsOrBetterThan(10, 4)) - return super.getNativeLibraryNames(); - else - return new String[]{LIBRARY_NAME + "-legacy", LIBRARY_NAME}; - } - public boolean openURL(String url) { try { Method openURL_method = (Method)AccessController.doPrivileged(new PrivilegedExceptionAction() { Modified: trunk/LWJGL/src/java/org/lwjgl/Sys.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/Sys.java 2006-07-03 10:21:44 UTC (rev 2418) +++ trunk/LWJGL/src/java/org/lwjgl/Sys.java 2006-07-03 10:28:32 UTC (rev 2419) @@ -50,8 +50,10 @@ * $Id$ */ public final class Sys { + /** The native library name */ + private static final String JNI_LIBRARY_NAME = "lwjgl"; - /** Current version of library */ + /** Current version of library */ private static final String VERSION = "1.0beta2"; /** The implementation instance to delegate platform specific behavior to */ @@ -74,23 +76,8 @@ static { implementation = createImplementation(); - String[] library_names = implementation.getNativeLibraryNames(); - UnsatisfiedLinkError last_load_error = null; - for (int i = 0; i < library_names.length; i++) { - try { - loadLibrary(library_names[i]); - last_load_error = null; - break; - } catch (UnsatisfiedLinkError e) { - last_load_error = e; - } - } + loadLibrary(JNI_LIBRARY_NAME); - // check for error - if (last_load_error != null) { - throw last_load_error; - } - String native_version = implementation.getNativeLibraryVersion(); if (!native_version.equals(getVersion())) throw new LinkageError("Version mismatch: jar version is '" + getVersion() + Modified: trunk/LWJGL/src/java/org/lwjgl/SysImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/SysImplementation.java 2006-07-03 10:21:44 UTC (rev 2418) +++ trunk/LWJGL/src/java/org/lwjgl/SysImplementation.java 2006-07-03 10:28:32 UTC (rev 2419) @@ -42,12 +42,6 @@ */ interface SysImplementation { /** - * Return an array of possible library names. later names - * tried last. - */ - public String[] getNativeLibraryNames(); - - /** * Return the version of the native library */ public String getNativeLibraryVersion(); Modified: trunk/LWJGL/src/java/org/lwjgl/applet/LWJGLInstaller.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/applet/LWJGLInstaller.java 2006-07-03 10:21:44 UTC (rev 2418) +++ trunk/LWJGL/src/java/org/lwjgl/applet/LWJGLInstaller.java 2006-07-03 10:28:32 UTC (rev 2419) @@ -225,7 +225,7 @@ */ static String createTemporaryDir(final String user_temp_dir) throws Exception { return (String) AccessController.doPrivileged(new PrivilegedExceptionAction() { - public Object run() { + public Object run() throws Exception { // create the temp directory File tempDir = new File(user_temp_dir + File.separator + "lwjgl-" + System.currentTimeMillis()); if(!tempDir.mkdir()) { Modified: trunk/LWJGL/src/java/org/lwjgl/test/applet/AppletTest.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/applet/AppletTest.java 2006-07-03 10:21:44 UTC (rev 2418) +++ trunk/LWJGL/src/java/org/lwjgl/test/applet/AppletTest.java 2006-07-03 10:28:32 UTC (rev 2419) @@ -65,7 +65,7 @@ try { LWJGLInstaller.tempInstall(); - } catch (LWJGLException le) { + } catch (Exception le) { /* screwed */ le.printStackTrace(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |