こんにちは、なかむら(う)です。

とりあえず、win32/Makefile.sub以外のパッチです。
これで、miniruby.exeのリンクに失敗するところまではいけます :-)

miniruby.exeのリンクに失敗するのはFile I/Oの実装に絡むところ
なので、前にも書いたように策を練る必要があります。

diff -u2pr ruby-1.6.5/node.h bcc/node.h --- ruby-1.6.5/node.h Fri Apr 6 14:42:40 2001 +++ bcc/node.h Fri Oct 5 19:49:08 2001 @@ -336,7 +336,9 @@ typedef struct RNode { #define NOEX_PROTECTED 4 +#ifndef __BORLANDC__ NODE *rb_compile_cstr _((const char*, const char*, int, int)); NODE *rb_compile_string _((const char*, VALUE, int)); NODE *rb_compile_file _((const char*, VALUE, int)); +#endif void rb_add_method _((VALUE, ID, NODE *, int)); diff -u2pr ruby-1.6.5/ruby.h bcc/ruby.h --- ruby-1.6.5/ruby.h Fri Jul 13 14:48:26 2001 +++ bcc/ruby.h Fri Oct 5 19:50:44 2001 @@ -429,5 +429,9 @@ void rb_gc_register_address _((VALUE*)); void rb_gc_unregister_address _((VALUE*)); +#ifdef __BORLANDC__ +ID rb_intern(); +#else ID rb_intern _((const char*)); +#endif char *rb_id2name _((ID)); ID rb_to_id _((VALUE)); @@ -544,5 +548,5 @@ EXTERN VALUE rb_eLoadError; static inline VALUE -#if defined(__cplusplus) +#if defined(__cplusplus) || defined(HAVE_PROTOTYPES) rb_class_of(VALUE obj) #else @@ -561,5 +565,5 @@ rb_class_of(obj) static inline int -#if defined(__cplusplus) +#if defined(__cplusplus) || defined(HAVE_PROTOTYPES) rb_type(VALUE obj) #else @@ -578,5 +582,5 @@ rb_type(obj) static inline int -#if defined(__cplusplus) +#if defined(__cplusplus) || defined(HAVE_PROTOTYPES) rb_special_const_p(VALUE obj) #else diff -u2pr ruby-1.6.5/util.c bcc/util.c --- ruby-1.6.5/util.c Thu Mar 22 17:59:26 2001 +++ bcc/util.c Fri Oct 5 20:10:36 2001 @@ -254,5 +254,5 @@ valid_filename(char *s) */ - if ((fd = _open(s, O_CREAT, 0666)) >= 0) { + if ((fd = open(s, O_CREAT, 0666)) >= 0) { _close(fd); _unlink (s); /* don't leave it laying around */ diff -u2pr ruby-1.6.5/win32/config.h.in bcc/win32/config.h.in --- ruby-1.6.5/win32/config.h.in Tue Jul 24 18:01:26 2001 +++ bcc/win32/config.h.in Fri Oct 5 19:44:26 2001 @@ -41,5 +41,5 @@ #define RSHIFT(x,y) ((x)>>y) -#define FILE_COUNT _cnt +#define FILE_COUNT level #define DEFAULT_KCODE KCODE_NONE #define DLEXT ".so" diff -u2pr ruby-1.6.5/win32/dir.h bcc/win32/dir.h --- ruby-1.6.5/win32/dir.h Sat May 26 00:18:08 2001 +++ bcc/win32/dir.h Fri Oct 5 19:42:10 2001 @@ -1,2 +1,7 @@ +#ifndef WIN32_DIR_H_ +#define WIN32_DIR_H_ + +#include <sys/types.h> + struct direct { @@ -19,2 +24,4 @@ void seekdir(DIR *, long); void rewinddir(DIR *); void closedir(DIR *); + +#endif diff -u2pr ruby-1.6.5/win32/win32.c bcc/win32/win32.c --- ruby-1.6.5/win32/win32.c Fri Aug 24 15:35:24 2001 +++ bcc/win32/win32.c Fri Oct 5 20:13:08 2001 @@ -1612,5 +1612,5 @@ valid_filename(char *s) // - if ((fd = _open(s, _O_CREAT, 0666)) >= 0) { + if ((fd = open(s, _O_CREAT, 0666)) >= 0) { close(fd); _unlink (s); // don\'t leave it laying around @@ -1865,5 +1865,9 @@ setgid(int gid) int /* ioctl(int i, unsigned int u, char *data) */ +#ifdef __BORLANDC__ +ioctl(int i, int u, ...) +#else ioctl(int i, unsigned int u, long data) +#endif { return -1; @@ -2040,8 +2044,14 @@ StartSockets () atexit((void (*)(void)) WSACleanup); +#ifndef SO_SYNCHRONOUS_NONALERT +#define SO_SYNCHRONOUS_NONALERT 0x20 +#endif iSockOpt = SO_SYNCHRONOUS_NONALERT; /* * Enable the use of sockets as filehandles */ +#ifndef SO_OPENTYPE +#define SO_OPENTYPE 0x7008 +#endif setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, (char *)&iSockOpt, sizeof(iSockOpt)); @@ -2453,5 +2463,10 @@ win32_getcwd(buffer, size) char *bp; +#ifdef __BORLANDC__ +#undef getcwd + if (getcwd(buffer, size) == NULL) { +#else if (_getcwd(buffer, size) == NULL) { +#endif return NULL; } diff -u2pr ruby-1.6.5/win32/win32.h bcc/win32/win32.h --- ruby-1.6.5/win32/win32.h Tue Aug 14 17:09:34 2001 +++ bcc/win32/win32.h Fri Oct 5 20:10:22 2001 @@ -117,21 +117,33 @@ extern "C++" { #define WNOHANG -1 +#ifndef __BORLANDC__ #define access _access +#endif #define chmod _chmod +#ifndef __BORLANDC__ #define chsize _chsize +#endif #define close _close #define creat _creat +#ifndef __BORLANDC__ #define dup _dup #define dup2 _dup2 +#endif #define eof _eof #define filelength _filelength +#ifndef __BORLANDC__ #define isatty _isatty +#endif #define locking _locking #define lseek _lseek #define mktemp _mktemp +#ifndef __BORLANDC__ #define open _open +#endif #define perror _perror #define read _read +#ifndef __BORLANDC__ #define setmode _setmode +#endif #define sopen _sopen #define tell _tell @@ -139,4 +151,5 @@ extern "C++" { #define unlink _unlink #define write _write +#ifndef __BORLANDC__ #define execl _execl #define execle _execle @@ -147,6 +160,8 @@ extern "C++" { #define execvp _execvp #define execvpe _execvpe +#endif #define getpid _getpid #define sleep(x) win32_sleep((x)*1000) +#ifndef __BORLANDC__ #define spawnl _spawnl #define spawnle _spawnle @@ -160,4 +175,5 @@ extern "C++" { #define fileno _fileno #endif +#endif #define utime _utime #define vsnprintf _vsnprintf @@ -165,6 +181,11 @@ extern "C++" { #define popen _popen #define pclose _pclose +#ifdef __BORLANDC__ +#define strcasecmp stricmp +#define strncasecmp strnicmp +#else #define strcasecmp _stricmp #define strncasecmp _strnicmp +#endif #undef rb_sys_stat #define rb_sys_stat win32_stat
それでは。 -- U.Nakamura <usa / osb.att.ne.jp>