pkgsrc/x11/xproto/patches/patch-Xpoll.h.in
wiz 4f64a9ba0f Updated xproto to 7.0.29.
Alan Coopersmith (1):
      Incorrect guard block in HPkeysym.h

James Clarke (1):
      Don't let XFD_SETSIZE exceed FD_SETSIZE

Julien Cristau (1):
      xproto 7.0.29

Olivier Fourdan (1):
      Raise the number of FD on WIN32 as well
2016-05-16 21:54:29 +00:00

41 lines
907 B
C

$NetBSD: patch-Xpoll.h.in,v 1.2 2016/05/16 21:54:30 wiz Exp $
Fix FD_SETSIZE definition.
Move the define of FD_SETSIZE before the include of select.h, so that
is actually does something useful.
--- Xpoll.h.in.orig 2016-05-13 08:26:10.000000000 +0000
+++ Xpoll.h.in
@@ -54,6 +54,15 @@ from The Open Group.
#ifndef USE_POLL
+#if defined(FD_SETSIZE) && FD_SETSIZE < 512
+# define XFD_SETSIZE FD_SETSIZE
+#else
+# define XFD_SETSIZE 512
+# ifndef FD_SETSIZE
+# define FD_SETSIZE XFD_SETSIZE
+# endif
+#endif
+
#include <X11/Xos.h>
#include <sys/select.h> /* Get the FD_* macros. */
@@ -67,15 +76,6 @@ typedef long fd_mask;
# endif
#endif
-#if defined(FD_SETSIZE) && FD_SETSIZE < 512
-# define XFD_SETSIZE FD_SETSIZE
-#else
-# define XFD_SETSIZE 512
-# ifndef FD_SETSIZE
-# define FD_SETSIZE XFD_SETSIZE
-# endif
-#endif
-
#ifndef NBBY
#define NBBY 8 /* number of bits in a byte */
#endif