わたなべです.

KIMURA Koichi <kkimura / pure.cpdc.canon.co.jp> writes:

:そうですね。とりあえず、どこに何のための#ifdefがあるかまとめてみ
:ようと思います。

あのままだと GNU Win32 では make が通らないので, そのための 
patch です.
名前はそのままだけど, ま, 作っちゃったので出します. :-)

macro の名前は
 WIN32(MSWIN32, __BORLANDC__, __LCC__, __MINGW32__ の場合 define する)
 DOSISH(MSDOS, DJGPP, WIN32 の場合 define する)
 __BOW__, __CYGWIN32_ はどうしょうもないので別扱い.
って感じでどうでしょう?
(GNU Win32, Minimalist GNU Win32 では WIN32 は define されて
ないが _WIN32 は define されてる).

-- 
わたなべひろふみ

diff -u1rb ruby-1.0-970701-nt.org/dir.c ruby-1.0-970701-nt/dir.c --- ruby-1.0-970701-nt.org/dir.c Wed Jul 02 22:28:05 1997 +++ ruby-1.0-970701-nt/dir.c Wed Jul 02 23:00:17 1997 @@ -214,3 +214,3 @@ { -#if !defined(DJGPP) && !defined(__CYGWIN32__) && !defined(_WIN32) +#if !defined(DJGPP) && !defined(_WIN32) rb_secure(2); diff -u1rb ruby-1.0-970701-nt.org/dln.c ruby-1.0-970701-nt/dln.c --- ruby-1.0-970701-nt.org/dln.c Wed Jul 02 22:28:05 1997 +++ ruby-1.0-970701-nt/dln.c Wed Jul 02 23:04:53 1997 @@ -1338,3 +1338,3 @@ /* extract a component */ -#if !defined(MSDOS) && !defined(_WIN32) +#if (!defined(MSDOS) && !defined(_WIN32)) || defined(__CYGWIN32__) ep = strchr(dp, ':'); diff -u1rb ruby-1.0-970701-nt.org/eval.c ruby-1.0-970701-nt/eval.c --- ruby-1.0-970701-nt.org/eval.c Wed Jul 02 22:28:05 1997 +++ ruby-1.0-970701-nt/eval.c Thu Jul 03 01:50:55 1997 @@ -3338,3 +3338,3 @@ } -#if !defined(MSDOS) && !defined(_WIN32) +#if (!defined(MSDOS) && !defined(_WIN32)) || defined(__CYGWIN32__) vpath = ary_join(rb_load_path, str_new2(":")); @@ -4911,3 +4911,3 @@ -#if defined(HAVE_SETITIMER) && !defined(__BOW__) +#if defined(HAVE_SETITIMER) && !defined(__BOW__) && !defined(__CYGWIN32__) static void @@ -4939,3 +4939,3 @@ -#if defined(HAVE_SETITIMER) && !defined(__BOW__) +#if defined(HAVE_SETITIMER) && !defined(__BOW__) && !defined(__CYGWIN32__) static init = 0; diff -u1rb ruby-1.0-970701-nt.org/ext/socket/socket.c ruby-1.0-970701-nt/ext/socket/socket.c --- ruby-1.0-970701-nt.org/ext/socket/socket.c Wed Jul 02 22:28:05 1997 +++ ruby-1.0-970701-nt/ext/socket/socket.c Thu Jul 03 00:13:29 1997 @@ -14,2 +14,3 @@ #include <sys/types.h> +#if !defined(_WIN32) || defined(__CYGWIN32__) #include <sys/socket.h> @@ -17,2 +18,3 @@ #include <netdb.h> +#endif #include <errno.h> diff -u1rb ruby-1.0-970701-nt.org/file.c ruby-1.0-970701-nt/file.c --- ruby-1.0-970701-nt.org/file.c Wed Jul 02 22:28:05 1997 +++ ruby-1.0-970701-nt/file.c Wed Jul 02 23:10:03 1997 @@ -266,3 +266,3 @@ #include <sys/types.h> -#ifndef _WIN32 +#if !defined(_WIN32) || defined(__CYGWIN32__) #include <sys/file.h> @@ -339,3 +339,3 @@ { -#if !defined(MSDOS) && !defined(_WIN32) +#if (!defined(MSDOS) && !defined(_WIN32)) || defined(__CYGWIN32__) struct stat st; @@ -356,3 +356,3 @@ { -#if !defined(MSDOS) && !defined(_WIN32) +#if (!defined(MSDOS) && !defined(_WIN32)) || defined(__CYGWIN32__) OpenFile *fptr; @@ -958,3 +958,3 @@ GetOpenFile(obj, fptr); -#if defined(DJGPP) || defined(__CYGWIN32__) || defined(_WIN32) +#if defined(DJGPP) || defined(_WIN32) if (chmod(fptr->path, mode) == -1) @@ -1017,3 +1017,3 @@ GetOpenFile(obj, fptr); -#if defined(DJGPP) || defined(__CYGWIN32__) || defined(_WIN32) +#if defined(DJGPP) || defined(_WIN32) if (chown(fptr->path, NUM2INT(owner), NUM2INT(group)) == -1) @@ -1123,3 +1123,3 @@ { -#if !defined(MSDOS) && !defined(_WIN32) +#if (!defined(MSDOS) && !defined(_WIN32)) || defined(__CYGWIN32__) Check_SafeStr(from); @@ -1140,3 +1140,3 @@ { -#if !defined(MSDOS) && !defined(_WIN32) +#if (!defined(MSDOS) && !defined(_WIN32)) || defined(__CYGWIN32__) char buf[MAXPATHLEN]; diff -u1rb ruby-1.0-970701-nt.org/io.c ruby-1.0-970701-nt/io.c --- ruby-1.0-970701-nt.org/io.c Wed Jul 02 22:28:07 1997 +++ ruby-1.0-970701-nt/io.c Wed Jul 02 23:16:07 1997 @@ -41,3 +41,3 @@ -#if defined(DJGPP) || defined(__CYGWIN32__) || defined(_WIN32) +#if defined(DJGPP) || defined(_WIN32) #include <fcntl.h> @@ -1275,3 +1275,3 @@ #endif -#if defined(MSDOS) || defined(__BOW__) || defined(__CYGWIN32__) || defined(_WIN32) +#if defined(MSDOS) || defined(__BOW__) || defined(_WIN32) (void)fclose(fr); @@ -1290,3 +1290,3 @@ else { -#if !defined(MSDOS) && !defined(__BOW__) && !defined(__CYGWIN32__) && !defined(_WIN32) +#if !defined(MSDOS) && !defined(__BOW__) && !defined(_WIN32) if (unlink(fn) < 0) { @@ -1302,3 +1302,3 @@ fw = rb_fopen(fn, "w"); -#if !defined(MSDOS) && !defined(__CYGWIN32__) && !(_WIN32) +#if !defined(MSDOS) && !defined(_WIN32) fstat(fileno(fw), &st2); @@ -1450,3 +1450,3 @@ #endif -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__CYGWIN32__) #define select(v, w, x, y, z) (-1) /* anytime fail */ diff -u1rb ruby-1.0-970701-nt.org/process.c ruby-1.0-970701-nt/process.c --- ruby-1.0-970701-nt.org/process.c Wed Jul 02 22:28:09 1997 +++ ruby-1.0-970701-nt/process.c Wed Jul 02 23:33:09 1997 @@ -237,3 +237,3 @@ -#if defined(THREAD) && defined(HAVE_SETITIMER) +#if defined(THREAD) && defined(HAVE_SETITIMER) && !defined(__CYGWIN32__) static void @@ -312,3 +312,3 @@ if (*s != ' ' && !isalpha(*s) && strchr("*?{}[]<>()~&|\\$;'`\"\n",*s)) { -#if defined(MSDOS) || defined(_WIN32) +#if defined(MSDOS) || (defined(_WIN32) && !defined(__CYGWIN32__)) /*TODO: use execl in _WIN32 environment */ diff -u1rb ruby-1.0-970701-nt.org/ruby.c ruby-1.0-970701-nt/ruby.c --- ruby-1.0-970701-nt.org/ruby.c Wed Jul 02 22:28:09 1997 +++ ruby-1.0-970701-nt/ruby.c Wed Jul 02 23:14:01 1997 @@ -60,3 +60,3 @@ #ifndef RUBY_LIB -#if defined(MSDOS) || defined(_WIN32) +#if defined(MSDOS) || (defined(_WIN32) && !defined(__CYGWIN32__)) #define RUBY_LIB "/usr/local/lib/ruby;." @@ -67,3 +67,3 @@ -#if defined(MSDOS) || defined(_WIN32) +#if defined(MSDOS) || (defined(_WIN32) && !defined(__CYGWIN32__)) #define RUBY_LIB_SEP ';' diff -u1rb ruby-1.0-970701-nt.org/sig.h ruby-1.0-970701-nt/sig.h --- ruby-1.0-970701-nt.org/sig.h Mon Feb 03 10:17:17 1997 +++ ruby-1.0-970701-nt/sig.h Thu Jul 03 01:50:35 1997 @@ -24,3 +24,3 @@ extern int thread_critical; -#if defined(HAVE_SETITIMER) && !defined(__BOW__) +#if defined(HAVE_SETITIMER) && !defined(__BOW__) && !defined(__CYGWIN32__) extern int thread_pending; diff -u1rb ruby-1.0-970701-nt.org/signal.c ruby-1.0-970701-nt/signal.c --- ruby-1.0-970701-nt.org/signal.c Wed Jul 02 22:28:09 1997 +++ ruby-1.0-970701-nt/signal.c Wed Jul 02 23:33:41 1997 @@ -421,3 +421,3 @@ } -#if defined(THREAD) && defined(HAVE_SETITIMER) && !defined(__BOW__) +#if defined(THREAD) && defined(HAVE_SETITIMER) && !defined(__BOW__) && !defined(__CYGWIN32__) if (sig == SIGVTALRM) {