Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!hc!lll-winken!lll-crg.llnl.gov!casey From: casey@lll-crg.llnl.gov (Casey Leedom) Newsgroups: comp.windows.x Subject: Small problem with lib/Xt/fd.h and 4.3BSD + FIX Message-ID: <16287@lll-winken.UUCP> Date: 5 Jan 89 08:49:05 GMT Sender: usenet@lll-winken.UUCP Reply-To: casey@lll-crg.llnl.gov (Casey Leedom) Organization: Lawrence Livermore National Laboratory Lines: 31 I haven't seen this mentioned before, so I'll post it. The problem occurred on a VAX 785 running 4.3BSD + all BSD patches + 1988 April networking code. I've checked the stock 4.3BSD source code and you'd run into the problem there too. Essentially fd.h and both define the typedef fd_set. My patch uses a test of the defined status of NFDBITS to determine whether or not fd_set has been typedef'd. Unfortunately C doesn't provide a mechanism to test for the existence of typedef's. I don't like my fix, but I think it should work on most systems. Fd_set and NFDBITS came into existence at the same time. Casey ----- *** fd.h-dist Tue Sep 6 13:29:39 1988 --- fd.h Wed Jan 4 23:57:44 1989 *************** *** 42,49 **** --- 42,51 ---- #define FD_SETSIZE 256 #endif + #ifndef NFDBITS typedef long fd_mask; #define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ + #endif #ifndef howmany #define howmany(x, y) (((x)+((y)-1))/(y)) #endif