$NetBSD: patch-af,v 1.2 2012/03/07 15:52:40 hans Exp $

--- x11.c.orig	2006-01-12 20:53:39.000000000 +0000
+++ x11.c
@@ -31,8 +31,18 @@
 #include <unistd.h>
 #if defined(__FreeBSD__)
 #include <machine/endian.h>
-#elif defined(__NetBSD__) || defined(__OpenBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
 #include <sys/endian.h>
+#elif defined(__sun)
+#include <sys/byteorder.h>
+#define LITTLE_ENDIAN 1234
+#define BIG_ENDIAN 4321
+#define PDP_ENDIAN 3412
+#ifdef _BIG_ENDIAN
+#define BYTE_ORDER BIG_ENDIAN
+#else
+#define BYTE_ORDER LITTLE_ENDIAN
+#endif
 #else /* Linux */
 #include <endian.h>
 #endif
@@ -93,6 +103,8 @@
 #ifdef HAVE_SYS_SHM_H
 #ifdef HAVE_X11_EXTENSIONS_XSHM_H
 #define HAVE_SHM 1
+#include <X11/Xmd.h>
+#include <X11/extensions/shmproto.h>
 #endif /* HAVE_X11_EXTENSIONS_XSHM_H */
 #endif /* HAVE_SYS_SHM_H */
 #endif /* HAVE_SYS_IPC_H */
