diff options
| author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-13 07:52:22 +0000 |
|---|---|---|
| committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-13 07:52:22 +0000 |
| commit | c563aca4dc601788e5f3d5507ae96970e749db59 (patch) | |
| tree | a0e228314395d920d53314d4d0724bab017c753a /include/ruby | |
| parent | 4a95d4ff0a1d7274046140f4c711811a753eeaa4 (diff) | |
| download | ruby-c563aca4dc601788e5f3d5507ae96970e749db59.tar.gz ruby-c563aca4dc601788e5f3d5507ae96970e749db59.tar.xz ruby-c563aca4dc601788e5f3d5507ae96970e749db59.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@21487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby')
| -rw-r--r-- | include/ruby/intern.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/ruby/intern.h b/include/ruby/intern.h index 38f44f94c..7ce73951b 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; |
