pkgsrc-wip/libxcb/libX11-xcb.diff
2008-03-25 20:49:06 +00:00

528 lines
18 KiB
Diff

? options.mk
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/x11/libX11/Makefile,v
retrieving revision 1.9
diff -u -b -r1.9 Makefile
--- Makefile 5 Aug 2007 22:39:38 -0000 1.9
+++ Makefile 25 Mar 2008 20:48:19 -0000
@@ -1,7 +1,7 @@
# $NetBSD: libX11-xcb.diff,v 1.1 2008/03/25 20:49:06 bsadewitz Exp $
#
-DISTNAME= libX11-1.1.3
+DISTNAME= libX11-1.1.4
CATEGORIES= x11 devel
MASTER_SITES= http://xorg.freedesktop.org/releases/individual/lib/
EXTRACT_SUFX= .tar.bz2
@@ -20,7 +20,6 @@
USE_TOOLS+= gmake pkg-config
CONFIGURE_ARGS+= --enable-man-pages=3
-CONFIGURE_ARGS+= --without-xcb
PKGCONFIG_OVERRIDE+= x11.pc.in
.include "../../mk/bsd.prefs.mk"
@@ -33,6 +32,8 @@
MAKE_ENV+= CC_FOR_BUILD=${NATIVE_CC:Q} CPPFLAGS_FOR_BUILD=-I${PREFIX}/include
.endif
+.include "options.mk"
+
.include "../../x11/bigreqsproto/buildlink3.mk"
.include "../../x11/inputproto/buildlink3.mk"
.include "../../x11/kbproto/buildlink3.mk"
Index: PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/x11/libX11/PLIST,v
retrieving revision 1.3
diff -u -b -r1.3 PLIST
--- PLIST 12 Jul 2007 15:02:00 -0000 1.3
+++ PLIST 25 Mar 2008 20:48:20 -0000
@@ -1,7 +1,8 @@
-@comment $NetBSD: libX11-xcb.diff,v 1.1 2008/03/25 20:49:06 bsadewitz Exp $
+@comment $NetBSD: libX11-xcb.diff,v 1.1 2008/03/25 20:49:06 bsadewitz Exp $
include/X11/ImUtil.h
include/X11/XKBlib.h
include/X11/Xcms.h
+${XCB}include/X11/Xlib-xcb.h
include/X11/Xlib.h
include/X11/XlibConf.h
include/X11/Xlibint.h
@@ -11,7 +12,9 @@
include/X11/Xutil.h
include/X11/cursorfont.h
lib/X11/Xcms.txt
+${XCB}lib/libX11-xcb.la
lib/libX11.la
+${XCB}lib/pkgconfig/x11-xcb.pc
lib/pkgconfig/x11.pc
man/man3/AllPlanes.3
man/man3/BitmapBitOrder.3
@@ -831,6 +834,9 @@
share/X11/locale/C/Compose
share/X11/locale/C/XI18N_OBJS
share/X11/locale/C/XLC_LOCALE
+share/X11/locale/am_ET.UTF-8/Compose
+share/X11/locale/am_ET.UTF-8/XI18N_OBJS
+share/X11/locale/am_ET.UTF-8/XLC_LOCALE
share/X11/locale/armscii-8/Compose
share/X11/locale/armscii-8/XI18N_OBJS
share/X11/locale/armscii-8/XLC_LOCALE
@@ -1058,8 +1064,9 @@
@dirrm share/X11/locale/en_US.UTF-8
@dirrm share/X11/locale/el_GR.UTF-8
@dirrm share/X11/locale/armscii-8
+@dirrm share/X11/locale/am_ET.UTF-8
@dirrm share/X11/locale/C
@dirrm share/X11/locale
-@comment @dirrm share/X11
-@comment @dirrm lib/X11
-@comment @dirrm include/X11
+@comment dirrm share/X11
+@comment dirrm lib/X11
+@comment dirrm include/X11
Index: buildlink3.mk
===================================================================
RCS file: /cvsroot/pkgsrc/x11/libX11/buildlink3.mk,v
retrieving revision 1.5
diff -u -b -r1.5 buildlink3.mk
--- buildlink3.mk 15 Dec 2007 15:21:53 -0000 1.5
+++ buildlink3.mk 25 Mar 2008 20:48:20 -0000
@@ -24,8 +24,14 @@
X11_LDFLAGS+= ${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.libX11}/lib
X11_LDFLAGS+= -L${BUILDLINK_PREFIX.libX11}/lib
+
+pkgbase:= libX11
+. include "../../mk/pkg-build-options.mk"
.endif # LIBX11_BUILDLINK3_MK
+.if !empty(PKG_BUILD_OPTIONS.libX11:Mxcb)
+. include "../../wip/libxcb/buildlink3.mk"
+.endif
.include "../../x11/kbproto/buildlink3.mk"
.include "../../x11/libXau/buildlink3.mk"
.include "../../x11/libXdmcp/buildlink3.mk"
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/x11/libX11/distinfo,v
retrieving revision 1.8
diff -u -b -r1.8 distinfo
--- distinfo 14 Jan 2008 07:12:53 -0000 1.8
+++ distinfo 25 Mar 2008 20:48:20 -0000
@@ -1,13 +1,14 @@
$NetBSD: libX11-xcb.diff,v 1.1 2008/03/25 20:49:06 bsadewitz Exp $
-SHA1 (libX11-1.1.3.tar.bz2) = 235f69172b262f874d2a2d7bd17e8197aea5b767
-RMD160 (libX11-1.1.3.tar.bz2) = fcb8d5d31befa0ae227210dc7274c17b30c37fad
-Size (libX11-1.1.3.tar.bz2) = 1526958 bytes
-SHA1 (patch-aa) = 7c1905781ca9467adfb45e2cad9b710533bbcd17
-SHA1 (patch-ab) = 000f81dd5d21cbabf38e91b5066e8f1ce43ff957
-SHA1 (patch-ac) = 9b3bea367661efeef337f8b9ae62d5f430a2204e
+SHA1 (libX11-1.1.4.tar.bz2) = e91092e22c3b48371c3549afba1b6a457acb2d7e
+RMD160 (libX11-1.1.4.tar.bz2) = 42776389986e0b158f703a9b88fdf95bb5095d1f
+Size (libX11-1.1.4.tar.bz2) = 1576030 bytes
+SHA1 (patch-aa) = 21d7c4bcbe0b1f3430bc731e6b5321bfcfa30b1a
+SHA1 (patch-ab) = e9050a4ab84d993760019e176c7e4e3de45a5176
+SHA1 (patch-ac) = 533b965ac592395e5fd6672ab293e1cdc29fbf55
SHA1 (patch-ad) = 58645e734f48334ce5cbf62f5870d087d95194ee
-SHA1 (patch-ae) = 124c47038ac2c12dd37f3f63606396b9ed976822
+SHA1 (patch-ae) = 75ad0db24f56b9ebdc06d163f7beb23584c0efbb
SHA1 (patch-af) = a97f3b31eecc783caecfeb315ac2cf6603ec32a5
-SHA1 (patch-ag) = 0d1cf4804049fd3640d627ddfbab7b717f20b445
-SHA1 (patch-ah) = 3565c046484ba7b7d18cd5ddc3265870f143ffda
+SHA1 (patch-ag) = a38a3cd74686576fd9f96c1adcdfa6cdeb256ad1
+SHA1 (patch-ah) = fc98136ac32d819aeac13cd532a5644128aa5f02
+SHA1 (patch-ai) = 3b9fec409570986f9d025c6b4fcaf9fa5fec1f88
Index: patches/patch-aa
===================================================================
RCS file: /cvsroot/pkgsrc/x11/libX11/patches/patch-aa,v
retrieving revision 1.3
diff -u -b -r1.3 patch-aa
--- patches/patch-aa 1 Aug 2007 16:48:41 -0000 1.3
+++ patches/patch-aa 25 Mar 2008 20:48:20 -0000
@@ -1,8 +1,57 @@
$NetBSD: libX11-xcb.diff,v 1.1 2008/03/25 20:49:06 bsadewitz Exp $
---- configure.ac.orig 2007-07-27 18:02:55.000000000 +0200
+--- configure.ac.orig 2008-03-06 15:48:26.000000000 -0500
+++ configure.ac
-@@ -304,6 +304,8 @@ else
+@@ -189,8 +189,8 @@ if test x$xthreads = xyes ; then
+ linux*|openbsd*|gnu*|k*bsd*-gnu)
+ XTHREADLIB=-lpthread ;;
+ netbsd*)
+- XTHREAD_CFLAGS="-D_POSIX_THREAD_SAFE_FUNCTIONS"
+- XTHREADLIB="-lpthread" ;;
++ XTHREAD_CFLAGS="-D_REENTRANT"
++ XTHREADLIB="-pthread" ;;
+ freebsd*)
+ XTHREAD_CFLAGS="-D_THREAD_SAFE"
+ XTHREADLIB="-pthread" ;;
+@@ -220,31 +220,14 @@ AC_CHECK_FUNC(poll, [AC_DEFINE(USE_POLL,
+ #
+ # Find keysymdef.h
+ #
+-KEYSYMDEF=""
+ AC_MSG_CHECKING([keysymdef.h])
+-for flag in $XPROTO_CFLAGS -I/usr/include; do
+- case "$KEYSYMDEF" in
+- "")
+- case "$flag" in
+- *-I*)
+- dir=`echo "$flag" | sed 's/ *-I//'`
+- file="$dir/X11/keysymdef.h"
+- if test -f "$file"; then
+- KEYSYMDEF="$file"
+- fi
+- ;;
+- esac
+- ;;
+- esac
+-done
+-case "$KEYSYMDEF" in
+-"")
++dir=`pkg-config --variable=includedir xproto`
++KEYSYMDEF="$dir/X11/keysymdef.h"
++if test -f "$KEYSYMDEF"; then
++ AC_MSG_RESULT([$KEYSYMDEF])
++else
+ AC_MSG_ERROR([Cannot find keysymdef.h])
+- ;;
+-*)
+- AC_MSG_RESULT([$KEYSYMDEF])
+- ;;
+-esac
++fi
+ AC_SUBST(KEYSYMDEF)
+
+ AM_CONDITIONAL(UDC, test xfalse = xtrue)
+@@ -322,6 +305,8 @@ else
fi
AC_SUBST(XKBPROTO_REQUIRES)
Index: patches/patch-ab
===================================================================
RCS file: /cvsroot/pkgsrc/x11/libX11/patches/patch-ab,v
retrieving revision 1.1
diff -u -b -r1.1 patch-ab
--- patches/patch-ab 12 Jul 2007 15:02:09 -0000 1.1
+++ patches/patch-ab 25 Mar 2008 20:48:20 -0000
@@ -1,20 +1,13 @@
-$NetBSD: libX11-xcb.diff,v 1.1 2008/03/25 20:49:06 bsadewitz Exp $
+$NetBSD: libX11-xcb.diff,v 1.1 2008/03/25 20:49:06 bsadewitz Exp $
+
+--- src/ConnDis.c.orig 2008-03-06 15:45:06.000000000 -0500
++++ src/ConnDis.c
+@@ -1143,7 +1143,7 @@ GetAuthorization(
+
+ /* In the case of v4 mapped addresses send the v4
+ part of the address - addr is already in network byte order */
+- if (memcmp(addr+8, ipv4mappedprefix, 12) == 0) {
++ if (memcmp((char*)addr+8, ipv4mappedprefix, 12) == 0) {
+ for (i = 20 ; i < 24; i++)
+ xdmcp_data[j++] = ((char *)addr)[i];
---- src/Xrm.c.orig 2006-09-25 12:57:47.000000000 +0200
-+++ src/Xrm.c
-@@ -808,6 +808,7 @@ void XrmCombineDatabase(
- }
- }
- (from->methods->destroy)(from->mbstate);
-+ _XUnlockMutex(&from->linfo);
- _XFreeMutex(&from->linfo);
- Xfree((char *)from);
- _XUnlockMutex(&(*into)->linfo);
-@@ -2656,6 +2657,7 @@ void XrmDestroyDatabase(
- else
- DestroyNTable(table);
- }
-+ _XUnlockMutex(&db->linfo);
- _XFreeMutex(&db->linfo);
- (*db->methods->destroy)(db->mbstate);
- Xfree((char *)db);
Index: patches/patch-ac
===================================================================
RCS file: /cvsroot/pkgsrc/x11/libX11/patches/patch-ac,v
retrieving revision 1.2
diff -u -b -r1.2 patch-ac
--- patches/patch-ac 5 Aug 2007 22:39:38 -0000 1.2
+++ patches/patch-ac 25 Mar 2008 20:48:20 -0000
@@ -1,8 +1,8 @@
$NetBSD: libX11-xcb.diff,v 1.1 2008/03/25 20:49:06 bsadewitz Exp $
---- configure.orig 2007-08-06 00:08:02.000000000 +0200
+--- configure.orig 2008-03-06 15:48:42.000000000 -0500
+++ configure
-@@ -926,6 +926,8 @@ XKB_FALSE
+@@ -927,6 +927,8 @@ XKB_FALSE
XKBPROTO_CFLAGS
XKBPROTO_LIBS
XKBPROTO_REQUIRES
@@ -11,7 +11,27 @@
LINT
LINT_FLAGS
LINT_TRUE
-@@ -23423,6 +23425,15 @@ else
+@@ -22905,7 +22907,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+-char pthread_self ();
++#include <pthread.h>
+ int
+ main ()
+ {
+@@ -22966,8 +22968,8 @@ if test x$xthreads = xyes ; then
+ linux*|openbsd*|gnu*|k*bsd*-gnu)
+ XTHREADLIB=-lpthread ;;
+ netbsd*)
+- XTHREAD_CFLAGS="-D_POSIX_THREAD_SAFE_FUNCTIONS"
+- XTHREADLIB="-lpthread" ;;
++ XTHREAD_CFLAGS="-D_REENTRANT"
++ XTHREADLIB="-pthread" ;;
+ freebsd*)
+ XTHREAD_CFLAGS="-D_THREAD_SAFE"
+ XTHREADLIB="-pthread" ;;
+@@ -23507,6 +23509,15 @@ else
fi
@@ -27,7 +47,7 @@
for ac_header in stdlib.h unistd.h
-@@ -24523,6 +24534,13 @@ echo "$as_me: error: conditional \"XKB\"
+@@ -24641,6 +24652,13 @@ echo "$as_me: error: conditional \"XKB\"
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -41,7 +61,7 @@
if test -z "${LINT_TRUE}" && test -z "${LINT_FALSE}"; then
{ { echo "$as_me:$LINENO: error: conditional \"LINT\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
-@@ -25339,6 +25357,8 @@ XKB_FALSE!$XKB_FALSE$ac_delim
+@@ -25466,6 +25486,8 @@ XKB_FALSE!$XKB_FALSE$ac_delim
XKBPROTO_CFLAGS!$XKBPROTO_CFLAGS$ac_delim
XKBPROTO_LIBS!$XKBPROTO_LIBS$ac_delim
XKBPROTO_REQUIRES!$XKBPROTO_REQUIRES$ac_delim
@@ -50,12 +70,12 @@
LINT!$LINT$ac_delim
LINT_FLAGS!$LINT_FLAGS$ac_delim
LINT_TRUE!$LINT_TRUE$ac_delim
-@@ -25360,7 +25380,7 @@ LIBOBJS!$LIBOBJS$ac_delim
+@@ -25490,7 +25512,7 @@ LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
-- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 79; then
-+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 81; then
+- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 83; then
++ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 85; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
Index: patches/patch-ae
===================================================================
RCS file: /cvsroot/pkgsrc/x11/libX11/patches/patch-ae,v
retrieving revision 1.2
diff -u -b -r1.2 patch-ae
--- patches/patch-ae 5 Aug 2007 22:39:39 -0000 1.2
+++ patches/patch-ae 25 Mar 2008 20:48:20 -0000
@@ -1,6 +1,6 @@
$NetBSD: libX11-xcb.diff,v 1.1 2008/03/25 20:49:06 bsadewitz Exp $
---- src/util/Makefile.in.orig 2007-08-06 00:07:57.000000000 +0200
+--- src/util/Makefile.in.orig 2008-03-06 15:48:52.000000000 -0500
+++ src/util/Makefile.in
@@ -34,7 +34,6 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
@@ -10,17 +10,7 @@
subdir = src/util
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-@@ -53,6 +52,9 @@ makekeys_LDADD = $(LDADD)
- makekeys_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
- --mode=link $(CCLD) $(makekeys_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
- $(LDFLAGS) -o $@
-+xmakekeys_SOURCES = xmakekeys.c
-+xmakekeys_OBJECTS = xmakekeys.$(OBJEXT)
-+xmakekeys_LDADD = $(LDADD)
- DEFAULT_INCLUDES = -I. -I$(top_builddir)/src -I$(top_builddir)/include/X11@am__isrc@
- depcomp = $(SHELL) $(top_srcdir)/depcomp
- am__depfiles_maybe = depfiles
-@@ -62,8 +64,11 @@ LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIB
+@@ -62,8 +61,11 @@ LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIB
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
@@ -34,7 +24,7 @@
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-@@ -223,10 +228,9 @@ sysconfdir = @sysconfdir@
+@@ -225,10 +227,9 @@ sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
@@ -47,7 +37,7 @@
EXTRA_DIST = mkks.sh
# Check source code with tools like lint & sparse
-@@ -276,6 +280,9 @@ clean-noinstPROGRAMS:
+@@ -278,6 +279,9 @@ clean-noinstPROGRAMS:
makekeys$(EXEEXT): $(makekeys_OBJECTS) $(makekeys_DEPENDENCIES)
@rm -f makekeys$(EXEEXT)
$(makekeys_LINK) $(makekeys_OBJECTS) $(makekeys_LDADD) $(LIBS)
@@ -57,7 +47,7 @@
mostlyclean-compile:
-rm -f *.$(OBJEXT)
-@@ -284,6 +291,7 @@ distclean-compile:
+@@ -286,6 +290,7 @@ distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/makekeys-makekeys.Po@am__quote@
@@ -65,7 +55,7 @@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@@ -503,6 +511,10 @@ uninstall-am:
+@@ -504,6 +509,10 @@ uninstall-am:
pdf pdf-am ps ps-am tags uninstall uninstall-am
Index: patches/patch-ag
===================================================================
RCS file: /cvsroot/pkgsrc/x11/libX11/patches/patch-ag,v
retrieving revision 1.2
diff -u -b -r1.2 patch-ag
--- patches/patch-ag 5 Aug 2007 22:39:39 -0000 1.2
+++ patches/patch-ag 25 Mar 2008 20:48:20 -0000
@@ -1,18 +1,20 @@
$NetBSD: libX11-xcb.diff,v 1.1 2008/03/25 20:49:06 bsadewitz Exp $
---- src/Makefile.in.orig 2007-08-06 00:07:52.000000000 +0200
+--- src/Makefile.in.orig 2008-03-06 15:48:51.000000000 -0500
+++ src/Makefile.in
-@@ -512,6 +512,8 @@ libX11_la_LIBADD = \
+@@ -517,6 +517,10 @@ libX11_la_LIBADD = \
@LINT_TRUE@ALL_LINT_FLAGS = $(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
@LINT_TRUE@ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
+@CROSS_COMPILING_FALSE@MAKEKEYS = $(top_builddir)/src/util/makekeys
+@CROSS_COMPILING_TRUE@MAKEKEYS = $(top_builddir)/src/util/xmakekeys
- all: $(BUILT_SOURCES) config.h
- $(MAKE) $(AM_MAKEFLAGS) all-recursive
-
-@@ -1214,7 +1216,7 @@ preprocess: $(patsubst %.c,%.ii,$(libX11
- @LINT_TRUE@ done
++
++
+ @MAKE_LINT_LIB_TRUE@lintlibdir = $(libdir)
+ @MAKE_LINT_LIB_TRUE@lintlib_DATA = $(LINTLIB)
+ @MAKE_LINT_LIB_TRUE@lintlib_src = $(libX11_la_SOURCES) xcms/*.c xkb/*.c
+@@ -1243,7 +1247,7 @@ preprocess: $(patsubst %.c,%.ii,$(libX11
+ @MAKE_LINT_LIB_TRUE@ $(LINT) -y -oX11 -x $(ALL_LINT_FLAGS) $(lintlib_src)
ks_tables.h: $(KEYSYMDEF) $(top_builddir)/src/util/makekeys$(EXEEXT)
- $(top_builddir)/src/util/makekeys < $(KEYSYMDEF) > ks_tables_h
Index: patches/patch-ah
===================================================================
RCS file: /cvsroot/pkgsrc/x11/libX11/patches/patch-ah,v
retrieving revision 1.2
diff -u -b -r1.2 patch-ah
--- patches/patch-ah 14 Jan 2008 07:12:53 -0000 1.2
+++ patches/patch-ah 25 Mar 2008 20:48:20 -0000
@@ -1,6 +1,6 @@
$NetBSD: libX11-xcb.diff,v 1.1 2008/03/25 20:49:06 bsadewitz Exp $
---- src/XlibInt.c.orig 2007-07-21 10:45:39.000000000 +0200
+--- src/XlibInt.c.orig 2008-03-23 11:27:47.000000000 -0400
+++ src/XlibInt.c
@@ -138,8 +138,13 @@ xthread_t (*_Xthread_self_fn)(void) = NU
#ifdef ISC
@@ -16,3 +16,60 @@
#define ESET(val) errno = val
#endif
#endif
+@@ -201,8 +206,6 @@ static char *_XAsyncReply(
+ Bool discard);
+ #endif /* !USE_XCB */
+
+-#define SEQLIMIT (65535 - (BUFSIZE / SIZEOF(xReq)) - 10)
+-
+ /*
+ * The following routines are internal routines used by Xlib for protocol
+ * packet transmission and reception.
+@@ -565,33 +568,42 @@ _XWaitForReadable(
+ }
+ #endif /* !USE_XCB */
+
++static int sync_hazard(Display *dpy)
++{
++ unsigned long span = dpy->request - dpy->last_request_read;
++ unsigned long hazard = min((dpy->bufmax - dpy->buffer) / SIZEOF(xReq), 65535 - 10);
++ return span >= 65535 - hazard - 10;
++}
++
+ static
+ int _XSeqSyncFunction(
+ register Display *dpy)
+ {
+ xGetInputFocusReply rep;
+ register xReq *req;
++ int sent_sync = 0;
+
+ LockDisplay(dpy);
+- if ((dpy->request - dpy->last_request_read) >= (BUFSIZE / SIZEOF(xReq))) {
++ if ((dpy->request - dpy->last_request_read) >= (65535 - BUFSIZE/SIZEOF(xReq))) {
+ GetEmptyReq(GetInputFocus, req);
+ (void) _XReply (dpy, (xReply *)&rep, 0, xTrue);
++ sent_sync = 1;
+ }
+ /* could get XID handler while waiting for reply in MT env */
+- if (dpy->synchandler == _XSeqSyncFunction) {
++ if (dpy->synchandler == _XSeqSyncFunction && !sync_hazard(dpy)) {
+ dpy->synchandler = dpy->savedsynchandler;
+ dpy->flags &= ~XlibDisplayPrivSync;
+ }
+ UnlockDisplay(dpy);
+- SyncHandle();
++ if (sent_sync)
++ SyncHandle();
+ return 0;
+ }
+
+ void _XSetSeqSyncFunction(
+ register Display *dpy)
+ {
+- if ((dpy->request - dpy->last_request_read) >= SEQLIMIT &&
+- !(dpy->flags & XlibDisplayPrivSync)) {
++ if (!(dpy->flags & XlibDisplayPrivSync) && sync_hazard(dpy)) {
+ dpy->savedsynchandler = dpy->synchandler;
+ dpy->synchandler = _XSeqSyncFunction;
+ dpy->flags |= XlibDisplayPrivSync;
Index: patches/patch-ai
===================================================================
RCS file: patches/patch-ai
diff -N patches/patch-ai
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-ai 25 Mar 2008 20:48:20 -0000
@@ -0,0 +1,15 @@
+$NetBSD: libX11-xcb.diff,v 1.1 2008/03/25 20:49:06 bsadewitz Exp $
+
+--- include/X11/Xlibint.h.orig 2008-03-06 15:45:05.000000000 -0500
++++ include/X11/Xlibint.h
+@@ -40,6 +40,10 @@ from The Open Group.
+ * Warning, there be dragons here....
+ */
+
++#ifdef __NetBSD__
++#include <unistd.h>
++#endif
++
+ #include <X11/Xlib.h>
+ #include <X11/Xproto.h> /* to declare xEvent */
+ #include <X11/XlibConf.h> /* for configured options like XTHREADS */