From 2d10eb3db6578a369a1038a6173e7fa78d005fcc Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Fri, 20 Apr 2007 23:00:52 +0000 Subject: Fixed Issue 226: JOGL seg faulting on Solaris AMD64 The implementation of glXGetProcAddressARB on Solaris/AMD64 had a similar problem to that seen on Linux/AMD64 distributions: internally the return value is being cast to a 32-bit value and then sign-extended back to 64 bits, causing the high half of its function pointer return values to be lost. Worked around by using dlsym() for lookup on this OS as well as on Linux/AMD64. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@1210 232f8b59-042b-4e1e-8c03-345bb8c30851 --- .../com/sun/opengl/impl/x11/X11GLDrawableFactory.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/classes/com') diff --git a/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java b/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java index 093f31232..feb3233b1 100644 --- a/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java +++ b/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java @@ -54,8 +54,9 @@ import com.sun.opengl.impl.*; public class X11GLDrawableFactory extends GLDrawableFactoryImpl { private static final boolean DEBUG = Debug.debug("X11GLDrawableFactory"); - // There is currently a bug on Linux/AMD64 distributions in glXGetProcAddressARB - private static boolean isLinuxAMD64; + // There is currently a bug on Linux/AMD64 and Solaris/AMD64 + // distributions in glXGetProcAddressARB + private static boolean isAMD64; // ATI's proprietary drivers apparently send GLX tokens even for // direct contexts, so we need to disable the context optimizations @@ -104,10 +105,9 @@ public class X11GLDrawableFactory extends GLDrawableFactoryImpl { AccessController.doPrivileged(new PrivilegedAction() { public Object run() { - String os = System.getProperty("os.name").toLowerCase(); String arch = System.getProperty("os.arch").toLowerCase(); - if (os.startsWith("linux") && arch.equals("amd64")) { - isLinuxAMD64 = true; + if (arch.equals("amd64") || arch.equals("x86_64")) { + isAMD64 = true; } return null; } @@ -346,7 +346,7 @@ public class X11GLDrawableFactory extends GLDrawableFactoryImpl { public long dynamicLookupFunction(String glFuncName) { long res = 0; - if (!isLinuxAMD64) { + if (!isAMD64) { res = GLX.glXGetProcAddressARB(glFuncName); } if (res == 0) { -- cgit v1.2.3