$OpenBSD: patch-jdk_src_solaris_native_sun_awt_awt_GraphicsEnv_c,v 1.1 2008/03/19 18:05:46 kurt Exp $
--- jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c.orig	Tue Dec  4 04:05:26 2007
+++ jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Thu Feb 14 17:34:41 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;
@@ -739,11 +739,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 */
 
@@ -1599,7 +1599,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();
@@ -1612,7 +1612,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;
 }
