[#7102] Ruby 1.3.4-990611 — Yukihiro Matsumoto <matz@...>

Ruby 1.3.4-990611 is out, check out:

20 messages 1999/06/11

[#7223] Ruby 1.3.4-990625 — Yukihiro Matsumoto <matz@...>

Ruby 1.3.4-990625 is out, check out:

14 messages 1999/06/25
[#7224] -Wl,-rpath on Linux (Re: Ruby 1.3.4-990625) — Ryo HAYASAKA <hayasaka@...21.u-aizu.ac.jp> 1999/06/25

早坂@会津大学です。

[ruby-dev:7118] Re: Ruby 1.3.4-990611

From: Koji Oda <oda@...1.qnes.nec.co.jp>
Date: 1999-06-15 08:38:27 UTC
List: ruby-dev #7118
小田@QNES です。

ruby with VC++ で select が使えるようになるパッチです。
ただし、VC の select は socket 専用みたいですので
ご注意ください。

 sample/srv.rb
 sample/tsrv.rb
 sample/clnt.rb
で、動作確認しました。

socket.dll 対応もついでにやってます。

--- ruby.h.org  Tue Jun 08 00:57:41 1999
+++ ruby.h      Tue Jun 15 16:20:58 1999
@@ -276,7 +276,6 @@
     void *data;
 };

-extern VALUE rb_cData;
 #define DATA_PTR(dta) (RDATA(dta)->data)

 VALUE rb_data_object_alloc _((VALUE,void*,void (*)(),void (*)()));
--- rubysig.h.org       Tue Jun 15 17:29:09 1999
+++ rubysig.h   Tue Jun 15 17:29:27 1999
@@ -10,7 +10,7 @@
 #ifndef SIG_H
 #define SIG_H

-extern int rb_trap_immediate;
+EXTERN int rb_trap_immediate;
 #define TRAP_BEG (rb_trap_immediate=1)
 #define TRAP_END (rb_trap_immediate=0)
--- io.c.org    Tue Jun 15 17:06:03 1999
+++ io.c        Tue Jun 15 17:06:53 1999
@@ -2330,9 +2330,6 @@
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
-#ifdef NT
-#define select(v, w, x, y, z) (-1) /* anytime fail */
-#endif

 static VALUE
 rb_f_select(argc, argv, obj)
--- st.c.org    Tue Jun 15 16:47:46 1999
+++ st.c        Tue Jun 15 16:48:21 1999
@@ -10,6 +10,10 @@
 #include <stdlib.h>
 #endif

+#ifdef NT
+#include <malloc.h>
+#endif
+
 typedef struct st_table_entry st_table_entry;

 struct st_table_entry {
--- missing/isinf.c.org Tue Jun 15 16:41:59 1999
+++ missing/isinf.c     Tue Jun 15 16:43:41 1999
@@ -1,3 +1,7 @@
+#ifdef NT
+#include <string.h>
+#endif
+
 static double zero()   { return 0.0; }
 static double one()    { return 1.0; }
 static double inf()    { return one() / zero(); }
--- win32/win32.h.org   Fri May 28 13:26:52 1999
+++ win32/win32.h       Tue Jun 15 13:58:02 1999
@@ -175,6 +175,9 @@
 extern SOCKET  myaccept(SOCKET, struct sockaddr *, int *);
 extern int  mybind(SOCKET, struct sockaddr *, int);
 extern int  myconnect(SOCKET, struct sockaddr *, int);
+extern void myfdset(int, fd_set*);
+extern int  myfdisset(int, fd_set*);
+extern long myselect(int, fd_set *, fd_set *, fd_set *, struct timeval *);
 extern int  mygetpeername(SOCKET, struct sockaddr *, int *);
 extern int  mygetsockname(SOCKET, struct sockaddr *, int *);
 extern int  mygetsockopt(SOCKET, int, int, char *, int *);
@@ -274,6 +277,15 @@
 #endif
 #define connect myconnect

+#undef FD_SET
+#define FD_SET myfdset
+
+#undef FD_ISSET
+#define FD_ISSET myfdisset
+
+#undef select
+#define select myselect
+
 #ifdef getpeername
 #undef getpeername
 #endif
--- win32/win32.c.org   Fri May 28 13:30:08 1999
+++ win32/win32.c       Tue Jun 15 14:06:17 1999
@@ -1780,6 +1780,36 @@
 }

 
+#undef FD_SET
+
+void
+myfdset(int fd, fd_set *set)
+{
+    unsigned int i;
+    SOCKET s = TO_SOCKET(fd);
+
+    for (i = 0; i < set->fd_count; i++) {
+        if (set->fd_array[i] == s) {
+            return;
+        }
+    }
+    if (i == set->fd_count) {
+        if (set->fd_count < FD_SETSIZE) {
+            set->fd_array[i] = s;
+            set->fd_count++;
+        }
+    }
+}
+
+
+#undef FD_ISSET
+
+int
+myfdisset(int fd, fd_set *set)
+{
+       return __WSAFDIsSet(TO_SOCKET(fd), set);
+}
+
 //
 // Networking trampolines
 // These are used to avoid socket startup/shutdown overhead in case
--- win32/ruby.def.org  Tue Jun 01 14:10:33 1999
+++ win32/ruby.def      Tue Jun 15 17:01:34 1999
@@ -27,6 +27,8 @@
        rb_mErrno;
 ;eval.c:
        rb_cProc
+       rb_thread_tick
+       rb_thread_critical
 ;file.c:
        rb_cFile
 ;hash.c:
@@ -35,6 +37,7 @@
        ruby_unsetenv
 ;io.c:
        rb_cIO
+       rb_io_check_closed
 ;numeric.c:
        rb_cNumeric
        rb_cFloat
@@ -52,6 +55,10 @@
        rb_cFalseClass
 ;re.c:
        rb_cRegexp
+;signal.c
+       rb_trap_immediate
+       rb_trap_pending
+       rb_prohibit_interrupt
 ;string.c:
        rb_cString
        rb_cStruct
@@ -60,9 +67,13 @@
 ;missing/nt.c
        NtInitialize
        myfdopen
+       myfdclose
        myaccept
        mybind
        myconnect
+       myfdset
+       myfdisset
+       myselect
        mygetpeername
        mygetsockname
        mygetsockopt
@@ -82,10 +93,11 @@
        mygetprotobynumber
        mygetservbyname
        mygetservbyport
+       myget_osfhandle
 ;array.c
        rb_ary_freeze
-       rb_ary_new2
        rb_ary_new
+       rb_ary_new2
        rb_ary_new3
        rb_ary_new4
        rb_assoc_new
@@ -118,6 +130,7 @@
        rb_uint2inum
        rb_int2inum
        rb_str2inum
+       rb_str2cstr
        rb_big2str
        rb_big2ulong
        rb_big2long
@@ -236,6 +249,7 @@
        rb_thread_scope_shared_p
        rb_thread_interrupt
        rb_thread_trap_eval
+       rb_thread_fd_close
        rb_catch
        rb_throw
        rb_yield
@@ -293,6 +307,7 @@
        rb_obj_is_instance_of
        rb_obj_is_kind_of
        rb_obj_alloc
+       rb_obj_taint
        rb_to_id
        rb_class_of
        rb_type
@@ -301,6 +316,7 @@
        rb_Float
        rb_String
        rb_Array
+       rb_num2dbl
 ; parse.c
        rb_node_newnode
        rb_id_attrset
@@ -334,6 +350,9 @@
        rb_get_kcode
        rb_set_kcode
 ; ruby.c
+       rb_argv
+       rb_argv0
+       rb_progname
        rb_load_file
        ruby_script
        ruby_prog_init
--- ext/socket/getaddrinfo.c.org        Thu Jun 03 19:31:31 1999
+++ ext/socket/getaddrinfo.c    Tue Jun 15 17:16:32 1999
@@ -55,6 +55,7 @@
 #include <unistd.h>
 #else
 #include <winsock2.h>
+#include <io.h>
 #endif
 #include <string.h>
 #include <stdio.h>

In This Thread