pkgsrc/x11/hanterm/patches/patch-ab
fredb 13499173ec Use the FD_* macros with select(). Take a clue from XFree-3.3.6 xterm,
and make this conditional on only "#ifndef VMS".
2001-05-03 18:37:47 +00:00

94 lines
2.8 KiB
Text

$NetBSD: patch-ab,v 1.1 2001/05/03 18:37:48 fredb Exp $
--- charproc.c.orig Tue Nov 28 04:44:05 2000
+++ charproc.c
@@ -46,6 +46,8 @@
#include <setjmp.h>
#include <ctype.h>
#include <X11/keysym.h>
+#include <sys/types.h>
+
#include "hangul.h"
#include "hstrdefs.h"
@@ -1755,7 +1757,7 @@
static char *v_bufstr = NULL; /* beginning of area to write */
static char *v_bufptr; /* end of area to write */
static char *v_bufend; /* end of physical buffer */
-#if !defined(linux) && !defined(SVR4) /* dkim@surecom.com */
+#ifdef VMS
#define ptymask() (v_bufptr > v_bufstr ? pty_mask : 0)
#endif
@@ -1783,7 +1785,7 @@
fprintf(stderr, "\n");
#endif
-#if defined(linux) || defined(SVR4)
+#ifndef VMS
if (f != pty_mask)
#else
if ((1 << f) != pty_mask)
@@ -1908,7 +1910,7 @@
return(c);
}
-#if (defined(linux)||defined(SVR4))||(defined(hpux) && OSMAJORVERSION >= 10)
+#ifndef VMS
static fd_set select_mask;
static fd_set write_mask;
#else
@@ -1924,7 +1926,7 @@
static struct timeval select_timeout;
for( ; ; ) {
-#if defined(linux)||defined(SVR4)||(defined(hpux) && OSMAJORVERSION >= 10)
+#ifndef VMS
if (FD_ISSET(pty_mask, &select_mask) && eventMode == NORMAL) {
#else
if (select_mask & pty_mask && eventMode == NORMAL) {
@@ -1984,7 +1986,7 @@
/* stop speed reading at some point to look for X stuff */
/* (4096 is just a random large number.) */
if (pty_read_bytes > 4096) {
-#if defined(linux)||defined(SVR4)||(defined(hpux) && OSMAJORVERSION >= 10)
+#ifndef VMS
FD_CLR(pty_mask, &select_mask);
#else
select_mask &= ~pty_mask;
@@ -2014,7 +2016,7 @@
/* Update the masks and, unless X events are already in the queue,
wait for I/O to be possible. */
select_mask = Select_mask;
-#if defined(linux) || defined(SVR4) ||(defined(hpux) && OSMAJORVERSION >= 10)
+#ifndef VMS
if (v_bufptr > v_bufstr)
FD_SET(pty_mask, &write_mask);
else
@@ -2028,7 +2030,7 @@
/* by sangil's report */
/* #if defined(linux)||defined(SVR4)
||(defined(hpux) && OSMAJORVERSION >= 10) */
-#if defined(linux)||defined(SVR4)
+#ifndef VMS
if (QLength (screen->display))
{
i = select(max_plus1, (fd_set*) &select_mask, (fd_set*) &write_mask, (fd_set *)NULL, (struct timeval *) &select_timeout);
@@ -2054,7 +2056,7 @@
}
/* if there is room to write more data to the pty, go write more */
-#if defined(linux)||defined(SVR4)||(defined(hpux) && OSMAJORVERSION >= 10)
+#ifndef VMS
if ((v_bufptr > v_bufstr) && FD_ISSET(pty_mask, &write_mask)) {
#else
if (write_mask & ptymask()) {
@@ -2064,7 +2066,7 @@
/* if there are X events already in our queue, it
counts as being readable */
-#if defined(linux)||defined(SVR4)||(defined(hpux) && OSMAJORVERSION >= 10)
+#ifndef VMS
if (QLength(screen->display) || (FD_ISSET(X_mask, &select_mask))) {
#else
if (QLength(screen->display) || (select_mask & X_mask)) {