aboutsummaryrefslogtreecommitdiffstats
path: root/src/sysselect.h
diff options
context:
space:
mode:
authorEli Zaretskii2015-11-02 19:04:06 +0200
committerEli Zaretskii2015-11-02 19:04:06 +0200
commit470e3028d8a741d97349faa8fdeb148d913a49d0 (patch)
treed194711816fd6bc66726b0917ae74ef3116f38b1 /src/sysselect.h
parent39372e1a1032521be74575bb06f95a3898fbae30 (diff)
downloademacs-470e3028d8a741d97349faa8fdeb148d913a49d0.tar.gz
emacs-470e3028d8a741d97349faa8fdeb148d913a49d0.zip
Fix the MS-Windows build
* src/thread.h [WINDOWSNT]: Include sys/socket.h. * src/sysselect.h: Don't define fd_set and FD_* macros for MS-Windows here. * src/w32.h: Define them here. * src/process.h (sys_select): Declare prototype. * src/sysdep.c: * src/process.c: * src/filelock.c: * src/emacs.c: * src/callproc.c: Move inclusion of sys/select.h after lisp.h. * nt/inc/socket.h: Include w32.h instead of sysselect.h
Diffstat (limited to 'src/sysselect.h')
-rw-r--r--src/sysselect.h38
1 files changed, 4 insertions, 34 deletions
diff --git a/src/sysselect.h b/src/sysselect.h
index e0f7b4e13ee..d6c5d1c7148 100644
--- a/src/sysselect.h
+++ b/src/sysselect.h
@@ -25,40 +25,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
25 25
26#include "lisp.h" 26#include "lisp.h"
27 27
28#ifdef WINDOWSNT 28/* The w32 build defines select stuff in w32.h, which is included
29 29 where w32 needs it, but not where sysselect.h is included. The w32
30/* File descriptor set emulation. */ 30 definitions in w32.h are incompatible with the below. */
31 31#ifndef WINDOWSNT
32/* MSVC runtime library has limit of 64 descriptors by default */
33#define FD_SETSIZE 64
34typedef struct {
35 unsigned int bits[FD_SETSIZE / 32];
36} fd_set;
37
38/* standard access macros */
39#define FD_SET(n, p) \
40 do { \
41 if ((n) < FD_SETSIZE) { \
42 (p)->bits[(n)/32] |= (1 << (n)%32); \
43 } \
44 } while (0)
45#define FD_CLR(n, p) \
46 do { \
47 if ((n) < FD_SETSIZE) { \
48 (p)->bits[(n)/32] &= ~(1 << (n)%32); \
49 } \
50 } while (0)
51#define FD_ISSET(n, p) ((n) < FD_SETSIZE ? ((p)->bits[(n)/32] & (1 << (n)%32)) : 0)
52#define FD_ZERO(p) memset((p), 0, sizeof(fd_set))
53
54#define SELECT_TYPE fd_set
55
56#include "systime.h"
57extern int sys_select (int, SELECT_TYPE *, SELECT_TYPE *, SELECT_TYPE *,
58 struct timespec *, sigset_t *);
59
60#else /* not WINDOWSNT */
61
62#ifdef FD_SET 32#ifdef FD_SET
63#ifndef FD_SETSIZE 33#ifndef FD_SETSIZE
64#define FD_SETSIZE 64 34#define FD_SETSIZE 64