From: MAEDA Shugo Date: 1998-05-29T00:30:41+09:00 Subject: [ruby-dev:2779] Re: experimental release 1.1b9_21 前田です。 >どうも、拡張モジュール側で、 > >__declspec(dllimport) VALUE cObject; > >としてやる必要があるようですね。 >となると、いっそのことruby.def/ruby.expを使うのはやめて、 >ruby.h/intern.hを修正した方が良いでしょうか。 とりあえず、全部変更するのは大変そうなので、問題になる 部分だけ変更してみました。 とりあえず落ちるという事態は免れたのですが、socketは ちゃんと動いていないようです。 -- 前田 修吾 --- Makefile.in.orig Thu May 28 23:44:36 1998 +++ Makefile.in Thu May 28 23:44:50 1998 @@ -11,7 +11,7 @@ @SET_MAKE@ prefix = @prefix@ -CFLAGS = @CFLAGS@ -I@srcdir@ -I@includedir@ +CFLAGS = @CFLAGS@ -I@srcdir@ -I@includedir@ -DBUILDING_RUBY LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@ LIBS = @LIBS@ $(EXTLIBS) MISSING = @LIBOBJS@ @ALLOCA@ --- ruby.h.orig Thu May 28 23:47:54 1998 +++ ruby.h Thu May 28 23:47:39 1998 @@ -13,6 +13,16 @@ #ifndef RUBY_H #define RUBY_H +#ifdef __BEOS__ +#ifdef BUILDING_RUBY +#define DECLSPEC __declspec(dllexport) +#else +#define DECLSPEC __declspec(dllimport) +#endif +#else +#define DECLSPEC extern +#endif + #if defined(__cplusplus) extern "C" { #endif @@ -148,9 +158,9 @@ #define NIL_P(v) ((VALUE)(v) == Qnil) #ifdef __MACOS__ /* name conflict, AERegistory.h */ -extern VALUE cRubyObject; +DECLSPEC VALUE cRubyObject; #else -extern VALUE cObject; +DECLSPEC VALUE cObject; #endif VALUE rb_class_of _((VALUE)); @@ -294,7 +304,7 @@ void *data; }; -extern VALUE cData; +DECLSPEC VALUE cData; #define DATA_PTR(dta) (RDATA(dta)->data) @@ -465,7 +475,7 @@ VALUE rb_equal _((VALUE,VALUE)); -extern VALUE verbose, debug; +DECLSPEC VALUE verbose, debug; int rb_safe_level _((void)); void rb_set_safe_level _((int)); --- ext/socket/socket.c.orig Fri May 29 00:01:27 1998 +++ ext/socket/socket.c Fri May 29 00:03:30 1998 @@ -41,8 +41,13 @@ #define EWOULDBLOCK EAGAIN #endif +#ifdef __BEOS__ +__declspec(dllimport) VALUE cIO; +__declspec(dllimport) VALUE cInteger; +#else extern VALUE cIO; extern VALUE cInteger; +#endif VALUE cBasicSocket; VALUE cIPsocket; @@ -55,7 +60,11 @@ #endif VALUE cSocket; +#ifdef __BEOS__ +__declspec(dllimport) VALUE eStandardError; +#else extern VALUE eStandardError; +#endif static VALUE eSocket; #ifdef SOCKS