summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-13 07:52:22 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-13 07:52:22 +0000
commit50258b19fd449048eaf22e88eec873d86c8719bf (patch)
treea0e228314395d920d53314d4d0724bab017c753a /include
parente41bd61822076275c337258ef53566ea18b70f87 (diff)
* 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/trunk@21487 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 38f44f94cd..7ce73951b1 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;