summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-15 15:37:20 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-15 15:37:20 +0000
commit6227816910c2d125193bb4c6bb044e7bca91bec6 (patch)
tree77d6c2857cc730406aa240a49fd62553fe4a53fc /include
parentd5251e8d25eb0d86d3eab3f6deceb11896f73e59 (diff)
merges r21487 from trunk into ruby_1_9_1.
* include/ruby/intern.h, thread.c, win32/Makefile.sub (rb_fdset_t, rb_fd_init, rb_fd_term, rb_fd_zero, rb_fd_set, rb_fd_clr, rb_fd_isset, rb_fd_select, rb_fd_ptr, rb_fd_max, HAVE_RB_FD_INIT): new type, functions, and macros for Windows. * win32/win32.c (extract_fd, rb_w32_select): use rb_fdset_t to expand fd_array if needed. [ruby-core:19946] * win32/win32.c (copy_fd): new funcion for rb_w32_select(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r--include/ruby/intern.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index dc2e1325ac..0e282c6790 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -218,6 +218,24 @@ int rb_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *
#define rb_fd_ptr(f) ((f)->fdset)
#define rb_fd_max(f) ((f)->maxfd)
+#elif defined(_WIN32)
+
+typedef struct {
+ int capa;
+ fd_set *fdset;
+} rb_fdset_t;
+
+void rb_fd_init(volatile rb_fdset_t *);
+void rb_fd_term(rb_fdset_t *);
+#define rb_fd_zero(f) ((f)->fdset->fd_count = 0)
+void rb_fd_set(int, rb_fdset_t *);
+#define rb_fd_clr(n, f) rb_w32_fdclr(n, (f)->fdset)
+#define rb_fd_isset(n, f) rb_w32_fdisset(n, (f)->fdset)
+#define rb_fd_select(n, rfds, wfds, efds, timeout) rb_w32_select(n, (rfds) ? ((rb_fdset_t*)rfds)->fdset : NULL, (wfds) ? ((rb_fdset_t*)wfds)->fdset : NULL, (efds) ? ((rb_fdset_t*)efds)->fdset: NULL, timeout)
+
+#define rb_fd_ptr(f) ((f)->fdset)
+#define rb_fd_max(f) ((f)->fdset->fd_count)
+
#else
typedef fd_set rb_fdset_t;