$OpenBSD: patch-jdk_src_solaris_native_sun_awt_awt_GraphicsEnv_c,v 1.2 2009/01/04 23:25:16 kurt Exp $
--- jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c.orig	Thu Jul 17 03:43:47 2008
+++ jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Sat Aug  2 16:12:56 2008
@@ -122,7 +122,7 @@ static char *x11GraphicsConfigClassName = "sun/awt/X11
  */
 
 #define MAXFRAMEBUFFERS 16
-#ifdef __linux__
+#if defined(__linux__) || defined(_ALLBSD_SOURCE)
 typedef struct {
    int   screen_number;
    short x_org;
@@ -631,7 +631,7 @@ void checkNewXineramaScreen(JNIEnv* env, jobject peer,
 #endif /* HEADLESS */
 
 #ifndef HEADLESS
-#ifdef __linux__
+#if defined(__linux__) || defined(_ALLBSD_SOURCE)
 static void xinerama_init_linux()
 {
     void* libHandle = 0;
@@ -679,7 +679,7 @@ static void xinerama_init_linux()
     }
 }
 #endif
-#ifndef __linux__ /* Solaris */
+#if !defined(__linux__) && !defined(_ALLBSD_SOURCE) /* Solaris */
 static void xinerama_init_solaris()
 {
     void* libHandle = 0;
@@ -740,11 +740,11 @@ static void xineramaInit(void) {
     }
 
     DTRACE_PRINTLN("Xinerama extension is available");
-#ifdef __linux__
+#if defined(__linux__) || defined(_ALLBSD_SOURCE)
     xinerama_init_linux();
 #else /* Solaris */
     xinerama_init_solaris();
-#endif /* __linux__ */
+#endif /* __linux__ || _ALLBSD_SOURCE */
 }
 #endif /* HEADLESS */
 
@@ -1600,7 +1600,7 @@ Java_sun_awt_X11GraphicsEnvironment_getXineramaCenterP
 {
     jobject point = NULL;
 #ifndef HEADLESS    /* return NULL in HEADLESS, Linux */
-#ifndef __linux__
+#if !defined(__linux__) && !defined(_ALLBSD_SOURCE)
     int x,y;
 
     AWT_LOCK();
@@ -1613,7 +1613,7 @@ Java_sun_awt_X11GraphicsEnvironment_getXineramaCenterP
         DTRACE_PRINTLN("unable to call XineramaSolarisCenterFunc: symbol is null");
     }
     AWT_FLUSH_UNLOCK();
-#endif /* __linux __ */
+#endif /* __linux __ || _ALLBSD_SOURCE */
 #endif /* HEADLESS */
     return point;
 }
