From b19e36a214a864572baee3643ddb369cfeb94d77 Mon Sep 17 00:00:00 2001 From: uema2 Date: Sun, 15 Dec 2002 03:18:08 +0000 Subject: * configure.in, defines.h, dir.c, dir.h, dln.c, error.c, eval.c, file.c, hash.c, io.c, main.c, missing.c, process.c, ruby.c, rubysig.h, signal.c, st.c, util.c, util.h, bcc/Makefile.sub, win32/Makefile.sub, win32/win32.h, ext/Win32API/Win32API.c, ext/socket/getaddrinfo.c, ext/socket/getnameinfo.c, ext/socket/socket.c, ext/tcltklib/stubs.c : replace "NT" with "_WIN32", add DOSISH_DRIVE_LETTER * wince/exe.mak : delete \r at the end of lines. * wince/mswince-ruby17.def : delete rb_obj_become git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 13 ++++++++++++ bcc32/Makefile.sub | 2 +- configure.in | 4 ++-- defines.h | 20 +++++++++++------- dir.c | 19 +++++++---------- dln.c | 20 ++++++++++-------- error.c | 2 +- eval.c | 2 +- ext/Win32API/Win32API.c | 2 +- ext/socket/getaddrinfo.c | 2 +- ext/socket/getnameinfo.c | 4 ++-- ext/socket/socket.c | 6 +++--- ext/tcltklib/stubs.c | 4 ++-- file.c | 54 +++++++++++++----------------------------------- hash.c | 2 +- io.c | 22 ++++++++++---------- main.c | 2 +- missing.h | 2 +- missing/flock.c | 2 +- missing/strftime.c | 2 +- process.c | 12 +++++------ ruby.c | 3 +++ rubysig.h | 2 +- signal.c | 12 +++++------ st.c | 2 +- util.c | 10 ++++----- util.h | 2 +- win32/Makefile.sub | 3 +-- win32/win32.h | 8 +++++++ wince/exe.mak | 2 +- wince/mswince-ruby17.def | 25 +++++++++++----------- 31 files changed, 134 insertions(+), 133 deletions(-) diff --git a/ChangeLog b/ChangeLog index e724363036..b97327fefc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Sat Dec 15 12:15:00 2002 Takaaki Uematsu + + * configure.in, defines.h, dir.c, dir.h, dln.c, error.c, + eval.c, file.c, hash.c, io.c, main.c, missing.c, + process.c, ruby.c, rubysig.h, signal.c, st.c, util.c, util.h, + bcc/Makefile.sub, win32/Makefile.sub, win32/win32.h, + ext/Win32API/Win32API.c, ext/socket/getaddrinfo.c, + ext/socket/getnameinfo.c, ext/socket/socket.c, + ext/tcltklib/stubs.c + : replace "NT" with "_WIN32", add DOSISH_DRIVE_LETTER + * wince/exe.mak : delete \r at the end of lines. + * wince/mswince-ruby17.def : delete rb_obj_become + Sun Dec 15 11:43:26 2002 Nobuyoshi Nakada * parse.y (dispose_string): dispose String object. diff --git a/bcc32/Makefile.sub b/bcc32/Makefile.sub index 80aa5e1137..7e787b18ff 100644 --- a/bcc32/Makefile.sub +++ b/bcc32/Makefile.sub @@ -87,7 +87,7 @@ prefix = /usr DESTDIR = $(prefix) !endif !ifndef CFLAGS -CFLAGS = -q -DNT=1 $(DEBUGFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG) -w- +CFLAGS = -q $(DEBUGFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG) -w- !endif !ifndef CPPFLAGS CPPFLAGS = -I. -I$(srcdir) -I$(srcdir)missing -DLIBRUBY_SO=\"$(LIBRUBY_SO)\" diff --git a/configure.in b/configure.in index 2765072790..a00dc0d7cb 100644 --- a/configure.in +++ b/configure.in @@ -354,7 +354,7 @@ AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(stdlib.h string.h unistd.h limits.h sys/file.h sys/ioctl.h\ fcntl.h sys/fcntl.h sys/select.h sys/time.h sys/times.h sys/param.h\ syscall.h pwd.h a.out.h utime.h memory.h direct.h sys/resource.h \ - sys/mkdev.h) + sys/mkdev.h sys/utime.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_TYPE_UID_T @@ -1156,7 +1156,7 @@ case "$target_os" in COMMON_LIBS=m COMMON_MACROS="WIN32_LEAN_AND_MEAN=" COMMON_HEADERS="windows.h winsock.h" - CFLAGS="-DNT -D__NO_ISOCEXT $CFLAGS" + CFLAGS="-D__NO_ISOCEXT $CFLAGS" CCDLFLAGS=-DIMPORT ;; esac if test x"$enable_shared" = xyes; then diff --git a/defines.h b/defines.h index 55dd9eecf4..52d9856ab6 100644 --- a/defines.h +++ b/defines.h @@ -86,9 +86,16 @@ void xfree _((void*)); # define BDIGIT_DBL_SIGNED long #endif +#if defined(MSDOS) || defined(_WIN32) || defined(__human68k__) || defined(__EMX__) +#define DOSISH 1 +#ifndef _WIN32_WCE +# define DOSISH_DRIVE_LETTER +#endif +#endif + /* define RUBY_USE_EUC/SJIS for default kanji-code */ #ifndef DEFAULT_KCODE -#if defined(MSDOS) || defined(__CYGWIN__) || defined(__human68k__) || defined(__MACOS__) || defined(__EMX__) || defined(OS2) || defined(NT) || defined(_WIN32_WCE) +#if defined(DOSISH) || defined(__CYGWIN__) || defined(__MACOS__) || defined(OS2) #define DEFAULT_KCODE KCODE_SJIS #else #define DEFAULT_KCODE KCODE_EUC @@ -106,7 +113,10 @@ void xfree _((void*)); #define HAVE_SYS_WAIT_H /* configure fails to find this */ #endif /* NeXT */ -#if defined(NT) || defined(_WIN32_WCE) +#ifdef __CYGWIN__ +#undef _WIN32 +#endif +#ifdef _WIN32 #include "win32/win32.h" #endif @@ -137,11 +147,7 @@ void xfree _((void*)); #define FLUSH_REGISTER_WINDOWS /* empty -- nothing to do here */ #endif -#if defined(MSDOS) || defined(_WIN32) || defined(__human68k__) || defined(__EMX__) -#define DOSISH 1 -#endif - -#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(OS2) || defined(_WIN32_WCE) +#if defined(DOSISH) #define PATH_SEP ";" #elif defined(riscos) #define PATH_SEP "," diff --git a/dir.c b/dir.c index 065dacda81..779407131e 100644 --- a/dir.c +++ b/dir.c @@ -21,10 +21,10 @@ #include #endif -#if defined HAVE_DIRENT_H && !defined NT && !defined _WIN32_WCE +#if defined HAVE_DIRENT_H && !defined _WIN32 # include # define NAMLEN(dirent) strlen((dirent)->d_name) -#elif defined HAVE_DIRECT_H && !defined NT && !defined _WIN32_WCE +#elif defined HAVE_DIRECT_H && !defined _WIN32 # include # define NAMLEN(dirent) strlen((dirent)->d_name) #else @@ -39,7 +39,7 @@ # if HAVE_NDIR_H # include # endif -# if defined(NT) || defined(_WIN32_WCE) +# ifdef _WIN32 # include "win32/dir.h" # endif #endif @@ -79,10 +79,7 @@ char *strchr _((char*,char)); # define CharNext(p) ((p) + 1) # endif #endif -#ifdef _WIN32_WCE -#undef CharNext -#define CharNext CharNextA -#endif + #if defined DOSISH #define isdirsep(c) ((c) == '/' || (c) == '\\') static char * @@ -538,7 +535,7 @@ dir_s_mkdir(argc, argv, obj) SafeStringValue(path); rb_secure(2); -#if !defined(NT) && !defined(_WIN32_WCE) +#ifndef _WIN32 if (mkdir(RSTRING(path)->ptr, mode) == -1) rb_sys_fail(RSTRING(path)->ptr); #else @@ -607,7 +604,7 @@ extract_path(p, pend) alloc = ALLOC_N(char, len+1); memcpy(alloc, p, len); if (len > 1 && pend[-1] == '/' -#if defined DOSISH +#if defined DOSISH_DRIVE_LETTER && pend[-2] != ':' #endif ) { @@ -766,10 +763,10 @@ glob_helper(path, sub, flags, func, arg) break; } -#if defined DOSISH +#if defined DOSISH_DRIVE_LETTER #define BASE (*base && !((isdirsep(*base) && !base[1]) || (base[1] == ':' && isdirsep(base[2]) && !base[3]))) #else -#define BASE (*base && !(*base == '/' && !base[1])) +#define BASE (*base && !(isdirsep(*base) && !base[1])) #endif for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) { diff --git a/dln.c b/dln.c index a4034c6854..55b751223b 100644 --- a/dln.c +++ b/dln.c @@ -48,7 +48,7 @@ void *xrealloc(); #endif #include -#if defined(NT) || defined(__VMS) || defined(_WIN32_WCE) +#if defined(_WIN32) || defined(__VMS) #include "missing/file.h" #endif #include @@ -69,7 +69,7 @@ void *xrealloc(); # include #endif -#if !defined(NT) && !defined(_WIN32_WCE) +#ifndef _WIN32 char *getenv(); #endif @@ -1598,7 +1598,7 @@ dln_find_exe(fname, path) } if (!path) { -#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(__MACOS__) || defined(_WIN32_WCE) +#if defined(MSDOS) || defined(_WIN32) || defined(__human68k__) || defined(__MACOS__) path = "/usr/local/bin;/usr/ucb;/usr/bin;/bin;."; #else path = "/usr/local/bin:/usr/ucb:/usr/bin:/bin:."; @@ -1669,9 +1669,11 @@ dln_find_1(fname, path, exe_flag) if (strncmp("./", fname, 2) == 0 || strncmp("../", fname, 3) == 0) return fname; if (exe_flag && strchr(fname, '/')) return fname; -#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(__EMX__) || defined(_WIN32_WCE) +#ifdef DOSISH if (fname[0] == '\\') return fname; +# ifdef DOSISH_DRIVE_LETTER if (strlen(fname) > 2 && fname[1] == ':') return fname; +# endif if (strncmp(".\\", fname, 2) == 0 || strncmp("..\\", fname, 3) == 0) return fname; if (exe_flag && strchr(fname, '\\')) return fname; @@ -1701,7 +1703,7 @@ dln_find_1(fname, path, exe_flag) */ if (*dp == '~' && (l == 1 || -#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(__EMX__) || defined(_WIN32_WCE) +#if defined(DOSISH) dp[1] == '\\' || #endif dp[1] == '/')) { @@ -1759,7 +1761,7 @@ dln_find_1(fname, path, exe_flag) } } #endif -#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(__EMX__) || defined(_WIN32_WCE) +#if defined(DOSISH) if (exe_flag) { static const char *extension[] = { #if defined(MSDOS) @@ -1767,9 +1769,9 @@ dln_find_1(fname, path, exe_flag) #if defined(DJGPP) ".btm", ".sh", ".ksh", ".pl", ".sed", #endif -#elif defined(__EMX__) || defined(NT) || defined(_WIN32_WCE) +#elif defined(__EMX__) || defined(_WIN32) ".exe", ".com", ".cmd", ".bat", -/* end of __EMX__ or NT or WINCE */ +/* end of __EMX__ or _WIN32 */ #else ".r", ".R", ".x", ".X", ".bat", ".BAT", /* __human68k__ */ @@ -1795,7 +1797,7 @@ dln_find_1(fname, path, exe_flag) #endif } } -#endif /* MSDOS or NT or __human68k__ or __EMX__ */ +#endif /* MSDOS or _WIN32 or __human68k__ or __EMX__ */ /* if not, and no other alternatives, life is bleak */ if (*ep == '\0') { return NULL; diff --git a/error.c b/error.c index bd0b13c847..38b0514197 100644 --- a/error.c +++ b/error.c @@ -645,7 +645,7 @@ void rb_sys_fail(mesg) const char *mesg; { -#if !defined(NT) && !defined(__VMS) && !defined(_WIN32_WCE) +#if !defined(_WIN32) && !defined(__VMS) char *strerror(); #endif char *err; diff --git a/eval.c b/eval.c index b5d8f143ba..bfa7330999 100644 --- a/eval.c +++ b/eval.c @@ -1050,7 +1050,7 @@ error_print() #if defined(__APPLE__) #define environ (*_NSGetEnviron()) -#elif !defined(NT) && !defined(__MACOS__) +#elif !defined(_WIN32) && !defined(__MACOS__) || defined(_WIN32_WCE) extern char **environ; #endif char **rb_origenviron; diff --git a/ext/Win32API/Win32API.c b/ext/Win32API/Win32API.c index d61b9c7ac0..ee9a1e0569 100644 --- a/ext/Win32API/Win32API.c +++ b/ext/Win32API/Win32API.c @@ -2,7 +2,7 @@ Win32API - Ruby Win32 API Import Facility */ -#if !defined _MSC_VER && !defined NT +#if !defined _MSC_VER && !defined _WIN32 #define WIN32_LEAN_AND_MEAN #include #include diff --git a/ext/socket/getaddrinfo.c b/ext/socket/getaddrinfo.c index 06daa7cca2..a6c26a8f0f 100644 --- a/ext/socket/getaddrinfo.c +++ b/ext/socket/getaddrinfo.c @@ -40,7 +40,7 @@ #include "config.h" #include -#ifndef NT +#ifndef _WIN32 #include #if defined(__BEOS__) # include diff --git a/ext/socket/getnameinfo.c b/ext/socket/getnameinfo.c index b8a1e310a3..a1fa5d7908 100644 --- a/ext/socket/getnameinfo.c +++ b/ext/socket/getnameinfo.c @@ -36,7 +36,7 @@ #include "config.h" #include -#ifndef NT +#ifndef _WIN32 #if defined(__BEOS__) # include #else @@ -54,7 +54,7 @@ #include #endif #endif -#ifdef NT +#ifdef _WIN32 #include #include #define snprintf _snprintf diff --git a/ext/socket/socket.c b/ext/socket/socket.c index 54dbaaf5f2..8378368313 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -24,7 +24,7 @@ #include #endif -#ifndef NT +#ifndef _WIN32 #if defined(__BEOS__) # include #else @@ -903,7 +903,7 @@ init_inetsock_internal(arg) } arg->fd = fd; if (type == INET_SERVER) { -#ifndef NT +#ifndef _WIN32 status = 1; setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char*)&status, sizeof(status)); @@ -1816,7 +1816,7 @@ static VALUE sock_s_socketpair(klass, domain, type, protocol) VALUE klass, domain, type, protocol; { -#if !defined(NT) && !defined(__BEOS__) && !defined(__EMX__) && !defined(__QNXNTO__) +#if !defined(_WIN32) && !defined(__BEOS__) && !defined(__EMX__) && !defined(__QNXNTO__) int d, t, sp[2]; setup_domain_and_type(domain, &d, type, &t); diff --git a/ext/tcltklib/stubs.c b/ext/tcltklib/stubs.c index 80b8bd7167..f394d6fc74 100644 --- a/ext/tcltklib/stubs.c +++ b/ext/tcltklib/stubs.c @@ -41,7 +41,7 @@ ruby_tcltk_stubs() char tk_name[20]; ruby_tcl_dll = getenv("RUBY_TCL_DLL"); -#if defined NT +#if defined _WIN32 if (ruby_tcl_dll) ruby_tcl_dll = ruby_strdup(ruby_tcl_dll); #endif ruby_tk_dll = getenv("RUBY_TK_DLL"); @@ -62,7 +62,7 @@ ruby_tcltk_stubs() } } -#if defined NT +#if defined _WIN32 if (ruby_tcl_dll) ruby_xfree(ruby_tcl_dll); #endif diff --git a/file.c b/file.c index ea3b260bf3..49952a7da0 100644 --- a/file.c +++ b/file.c @@ -12,7 +12,7 @@ **********************************************************************/ -#if defined NT || defined _WIN32_WCE +#ifdef _WIN32 #include "missing/file.h" #endif @@ -40,21 +40,13 @@ int flock _((int, int)); #endif #include -#ifdef HAVE_SYS_TIME_H -# include -#else -#if !defined(NT) && !defined(_WIN32_WCE) -struct timeval { - long tv_sec; /* seconds */ - long tv_usec; /* and microseconds */ -}; -#endif /* NT, WINCE */ -#endif VALUE rb_time_new _((time_t, time_t)); #ifdef HAVE_UTIME_H #include +#elif defined HAVE_SYS_UTIME_H +#include #endif #ifdef HAVE_PWD_H @@ -76,11 +68,6 @@ char *strrchr _((const char*,const char)); #define lstat(path,st) stat(path,st) #endif -#ifdef _WIN32_WCE -#undef CharNext -#define CharNext CharNextA -#endif - VALUE rb_cFile; VALUE rb_mFileTest; static VALUE rb_cStat; @@ -115,10 +102,6 @@ rb_file_path(obj) return rb_str_new2(fptr->path); } -#if defined NT || defined _WIN32_WCE -#include "missing/file.h" -#endif - static VALUE stat_new_0(klass, st) VALUE klass; @@ -445,7 +428,7 @@ static int group_member(gid) GETGROUPS_T gid; { -#if !defined(NT) && !defined(_WIN32_WCE) +#ifndef _WIN32 if (getgid() == gid) return Qtrue; @@ -785,7 +768,7 @@ static VALUE test_grpowned(obj, fname) VALUE obj, fname; { -#if !defined(NT) && !defined(_WIN32_WCE) +#ifndef _WIN32 struct stat st; if (rb_stat(fname, &st) < 0) return Qfalse; @@ -1120,7 +1103,7 @@ rb_file_chown(obj, owner, group) rb_secure(2); GetOpenFile(obj, fptr); -#if defined(DJGPP) || defined(__CYGWIN32__) || defined(NT) || defined(__EMX__) || defined(_WIN32_WCE) +#if defined(DJGPP) || defined(__CYGWIN32__) || defined(_WIN32) || defined(__EMX__) if (!fptr->path) return Qnil; if (chown(fptr->path, NUM2INT(owner), NUM2INT(group)) == -1) rb_sys_fail(fptr->path); @@ -1212,22 +1195,11 @@ rb_file_s_utime(argc, argv) #else -#ifndef HAVE_UTIME_H -# if defined NT || defined _WIN32_WCE -# if defined(__BORLANDC__) -# include -# else -# include -# endif -# if defined(_MSC_VER) || defined __MINGW32__ -# define utimbuf _utimbuf -# endif -# else +#if !defined HAVE_UTIME_H && !defined HAVE_SYS_UTIME_H struct utimbuf { long actime; long modtime; }; -# endif #endif static void @@ -1474,7 +1446,7 @@ rb_file_s_expand_path(argc, argv) #endif } } -#if defined DOSISH || defined __CYGWIN__ +#if defined DOSISH_DRIVE_LETTER || defined __CYGWIN__ /* skip drive letter */ else if (ISALPHA(s[0]) && s[1] == ':' && isdirsep(s[2])) { b = s; @@ -1572,7 +1544,7 @@ rb_file_s_expand_path(argc, argv) memcpy(++p, b, s-b); p += s-b; } -#if defined DOSISH || defined __CYGWIN__ +#if defined DOSISH_DRIVE_LETTER || defined __CYGWIN__ else if (ISALPHA(buf[0]) && (buf[1] == ':') && isdirsep(buf[2])) { /* root directory needs a trailing backslash, otherwise it mean the current directory of the drive */ @@ -1716,7 +1688,7 @@ rb_file_s_truncate(klass, path, len) { int tmpfd; -# if defined(NT) || defined(_WIN32_WCE) +# ifdef _WIN32 if ((tmpfd = open(RSTRING(path)->ptr, O_RDWR)) < 0) { rb_sys_fail(RSTRING(path)->ptr); } @@ -2141,7 +2113,7 @@ static VALUE rb_stat_grpowned(obj) VALUE obj; { -#if !defined(NT) && !defined(_WIN32_WCE) +#ifndef _WIN32 if (get_stat(obj)->st_gid == getegid()) return Qtrue; #endif return Qfalse; @@ -2339,8 +2311,10 @@ static int is_absolute_path(path) const char *path; { -#if defined DOSISH || defined __CYGWIN__ +#if defined DOSISH_DRIVE_LETTER || defined __CYGWIN__ if (ISALPHA(path[0]) && path[1] == ':' && isdirsep(path[2])) return 1; +#endif +#if defined DOSISH || defined __CYGWIN__ if (isdirsep(path[0]) && isdirsep(path[1])) return 1; #endif #ifndef DOSISH diff --git a/hash.c b/hash.c index 89d7b16019..245ba53e5a 100644 --- a/hash.c +++ b/hash.c @@ -942,7 +942,7 @@ rb_hash_update(hash1, hash2) static int path_tainted = -1; static char **origenviron; -#if defined(NT) || defined(_WIN32_WCE) +#ifdef _WIN32 #define GET_ENVIRON(e) (e = rb_w32_get_environ()) #define FREE_ENVIRON(e) rb_w32_free_environ(e) static char **my_environ; diff --git a/io.c b/io.c index 65a69928c0..b9060773e1 100644 --- a/io.c +++ b/io.c @@ -24,11 +24,11 @@ #include #include -#if defined(MSDOS) || defined(__BOW__) || defined(__CYGWIN__) || defined(NT) || defined(__human68k__) || defined(__EMX__) || defined(__BEOS__) || defined(_WIN32_WCE) +#if defined(MSDOS) || defined(__BOW__) || defined(__CYGWIN__) || defined(_WIN32) || defined(__human68k__) || defined(__EMX__) || defined(__BEOS__) # define NO_SAFE_RENAME #endif -#if defined(MSDOS) || defined(__CYGWIN__) || defined(NT) +#if defined(MSDOS) || defined(__CYGWIN__) || defined(_WIN32) # define NO_LONG_FNAME #endif @@ -41,10 +41,10 @@ #endif #include -#if !defined(DJGPP) && !defined(NT) && !defined(__human68k__) && !defined(_WIN32_WCE) +#if !defined(DJGPP) && !defined(_WIN32) && !defined(__human68k__) #include #endif -#if defined(HAVE_FCNTL_H) || defined(NT) || defined(_WIN32_WCE) +#if defined(HAVE_FCNTL_H) || defined(_WIN32) #include #elif defined(HAVE_SYS_FCNTL_H) #include @@ -1561,7 +1561,7 @@ VALUE rb_io_binmode(io) VALUE io; { -#if defined(NT) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__) || defined(__EMX__) || defined(_WIN32_WCE) +#if defined(_WIN32) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__) || defined(__EMX__) OpenFile *fptr; GetOpenFile(io, fptr); @@ -1850,7 +1850,7 @@ rb_file_sysopen(fname, flags, mode) return rb_file_sysopen_internal(io, fname, flags, mode); } -#if defined (NT) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__) || defined(__VMS) || defined(_WIN32_WCE) +#if defined (_WIN32) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__) || defined(__VMS) static struct pipe_list { OpenFile *fptr; struct pipe_list *next; @@ -1892,7 +1892,7 @@ pipe_del_fptr(fptr) } } -#if defined (NT) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__) || defined(__VMS) || defined(_WIN32_WCE) +#if defined (_WIN32) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__) || defined(__VMS) static void pipe_atexit _((void)) { @@ -1913,7 +1913,7 @@ static void pipe_finalize(fptr) OpenFile *fptr; { -#if !defined (__CYGWIN__) && !defined(NT) && !defined(_WIN32_WCE) +#if !defined (__CYGWIN__) && !defined(_WIN32) extern VALUE rb_last_status; int status; if (fptr->f) { @@ -1976,7 +1976,7 @@ pipe_open(pname, mode) return (VALUE)port; } #else -#if defined(NT) || defined(_WIN32_WCE) +#ifdef _WIN32 int pid; FILE *fpr, *fpw; @@ -3494,7 +3494,7 @@ rb_io_s_pipe() int pipes[2]; VALUE r, w; -#if defined(NT) || defined(_WIN32_WCE) +#ifdef _WIN32 if (_pipe(pipes, 1024, O_BINARY) == -1) #else if (pipe(pipes) == -1) @@ -4054,7 +4054,7 @@ Init_IO() rb_define_virtual_variable("$-i", opt_i_get, opt_i_set); -#if defined (NT) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__) +#if defined (_WIN32) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__) atexit(pipe_atexit); #endif diff --git a/main.c b/main.c index 7330eb902d..7dd981e99f 100644 --- a/main.c +++ b/main.c @@ -38,7 +38,7 @@ main(argc, argv, envp) int argc; char **argv, **envp; { -#if defined(NT) || defined(_WIN32_WCE) +#ifdef _WIN32 NtInitialize(&argc, &argv); #endif #if defined(__MACOS__) && defined(__MWERKS__) diff --git a/missing.h b/missing.h index 25831c6ab5..877ee6bf7e 100644 --- a/missing.h +++ b/missing.h @@ -14,7 +14,7 @@ #if defined(HAVE_SYS_TIME_H) # include -#elif !defined(NT) && !defined(_WIN32_WCE) +#elif !defined(_WIN32) # define time_t long struct timeval { time_t tv_sec; /* seconds */ diff --git a/missing/flock.c b/missing/flock.c index c828fcc7ad..ed619f0e91 100644 --- a/missing/flock.c +++ b/missing/flock.c @@ -122,7 +122,7 @@ flock(fd, operation) return -1; } } -#elif !defined NT +#elif !defined _WIN32 int flock(fd, operation) int fd; diff --git a/missing/strftime.c b/missing/strftime.c index 77c41d5fc5..07d2ed10d9 100644 --- a/missing/strftime.c +++ b/missing/strftime.c @@ -53,7 +53,7 @@ #include #include #endif -#if defined(TM_IN_SYS_TIME) || ! defined(GAWK) +#if defined(TM_IN_SYS_TIME) || !defined(GAWK) && !defined(_WIN32_WCE) #include #include #endif diff --git a/process.c b/process.c index 31b6926c0e..0052846ca6 100644 --- a/process.c +++ b/process.c @@ -42,7 +42,7 @@ struct timeval rb_time_interval _((VALUE)); #include #endif -#if defined(HAVE_TIMES) || defined(NT) || defined(_WIN32_WCE) +#if defined(HAVE_TIMES) || defined(_WIN32) static VALUE S_Tms; #endif @@ -74,7 +74,7 @@ get_pid() static VALUE get_ppid() { -#if defined(NT) || defined(_WIN32_WCE) +#ifdef _WIN32 return INT2FIX(0); #else return INT2FIX(getppid()); @@ -712,7 +712,7 @@ static VALUE rb_f_fork(obj) VALUE obj; { -#if !defined(__human68k__) && !defined(NT) && !defined(__MACOS__) && !defined(__EMX__) && !defined(__VMS) && !defined(_WIN32_WCE) +#if !defined(__human68k__) && !defined(_WIN32) && !defined(__MACOS__) && !defined(__EMX__) && !defined(__VMS) int pid; rb_secure(2); @@ -805,7 +805,7 @@ rb_f_system(argc, argv) int argc; VALUE *argv; { -#if defined(NT) || defined(__EMX__) || defined(_WIN32_WCE) +#if defined(_WIN32) || defined(__EMX__) VALUE cmd; int status; @@ -1295,7 +1295,7 @@ Init_process() rb_mProcess = rb_define_module("Process"); -#if !defined(NT) && !defined(DJGPP) && !defined(_WIN32_WCE) +#if !defined(_WIN32) && !defined(DJGPP) #ifdef WNOHANG rb_define_const(rb_mProcess, "WNOHANG", INT2FIX(WNOHANG)); #else @@ -1371,7 +1371,7 @@ Init_process() rb_define_module_function(rb_mProcess, "times", rb_proc_times, 0); -#if defined(HAVE_TIMES) || defined(NT) || defined(_WIN32_WCE) +#if defined(HAVE_TIMES) || defined(_WIN32) S_Tms = rb_struct_define("Tms", "utime", "stime", "cutime", "cstime", 0); #endif } diff --git a/ruby.c b/ruby.c index 490b0ad114..e3c69c797d 100644 --- a/ruby.c +++ b/ruby.c @@ -15,6 +15,9 @@ #if defined _WIN32 || defined __CYGWIN__ #include #endif +#ifdef _WIN32_WCE +#include +#endif #include "ruby.h" #include "dln.h" #include "node.h" diff --git a/rubysig.h b/rubysig.h index 2c1e5f0e0c..f14e1b595d 100644 --- a/rubysig.h +++ b/rubysig.h @@ -13,7 +13,7 @@ #ifndef SIG_H #define SIG_H -#if defined(NT) || defined(_WIN32_WCE) +#ifdef _WIN32 typedef LONG rb_atomic_t; # define ATOMIC_TEST(var) InterlockedExchange(&(var), 0) diff --git a/signal.c b/signal.c index d9b5d9b5b4..44ada105dc 100644 --- a/signal.c +++ b/signal.c @@ -369,7 +369,7 @@ static RETSIGTYPE sighandler(sig) int sig; { -#if defined(NT) || defined(_WIN32_WCE) +#ifdef _WIN32 #define IN_MAIN_CONTEXT(f, a) (rb_w32_main_context(a, f) ? (void)0 : f(a)) #else #define IN_MAIN_CONTEXT(f, a) f(a) @@ -453,7 +453,7 @@ rb_trap_exec() } struct trap_arg { -#if !defined(NT) && !defined(_WIN32_WCE) +#ifndef _WIN32 # ifdef HAVE_SIGPROCMASK sigset_t mask; # else @@ -594,7 +594,7 @@ trap(arg) trap_list[sig] = command; /* enable at least specified signal. */ -#if !defined(NT) && !defined(_WIN32_WCE) +#ifndef _WIN32 #ifdef HAVE_SIGPROCMASK sigdelset(&arg->mask, sig); #else @@ -604,7 +604,7 @@ trap(arg) return old; } -#if !defined(NT) && !defined(_WIN32_WCE) +#ifndef _WIN32 static VALUE trap_ensure(arg) struct trap_arg *arg; @@ -623,7 +623,7 @@ trap_ensure(arg) void rb_trap_restore_mask() { -#if !defined(NT) && !defined(_WIN32_WCE) +#ifndef _WIN32 # ifdef HAVE_SIGPROCMASK sigprocmask(SIG_SETMASK, &trap_last_mask, NULL); # else @@ -655,7 +655,7 @@ sig_trap(argc, argv) if (OBJ_TAINTED(arg.cmd)) { rb_raise(rb_eSecurityError, "Insecure: tainted signal trap"); } -#if !defined(NT) && !defined(_WIN32_WCE) +#ifndef _WIN32 /* disable interrupt */ # ifdef HAVE_SIGPROCMASK sigfillset(&arg.mask); diff --git a/st.c b/st.c index 3d97eebd3b..85391cac80 100644 --- a/st.c +++ b/st.c @@ -7,7 +7,7 @@ #include #include "st.h" -#if defined(NT) || defined(_WIN32_WCE) +#ifdef _WIN32 #include #endif diff --git a/util.c b/util.c index 14e3c42622..345869e7ec 100644 --- a/util.c +++ b/util.c @@ -16,7 +16,7 @@ #include #include -#if defined(NT) || defined(_WIN32_WCE) +#ifdef _WIN32 #include "missing/file.h" #endif @@ -75,11 +75,11 @@ scan_hex(start, len, retlen) # define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR) #endif -#if defined(NT) || defined(_WIN32_WCE) +#ifdef _WIN32 #include "missing/file.h" #endif -#if defined(MSDOS) || defined(__CYGWIN32__) || defined(NT) || defined(_WIN32_WCE) +#if defined(MSDOS) || defined(__CYGWIN32__) || defined(_WIN32) /* * Copyright (c) 1993, Intergraph Corporation * @@ -173,7 +173,7 @@ ruby_add_suffix(str, suffix) rb_fatal("Cannot do inplace edit on long filename (%ld characters)", RSTRING(str)->len); -#if defined(DJGPP) || defined(__CYGWIN32__) || defined(NT) || defined(_WIN32_WCE) +#if defined(DJGPP) || defined(__CYGWIN32__) || defined(_WIN32) /* Style 0 */ slen = RSTRING(str)->len; rb_str_cat(str, suffix, extlen); @@ -229,7 +229,7 @@ fallback: memcpy(RSTRING(str)->ptr, buf, RSTRING(str)->len); } -#if defined(__CYGWIN32__) || defined(NT) || defined(_WIN32_WCE) +#if defined(__CYGWIN32__) || defined(_WIN32) static int valid_filename(char *s) { diff --git a/util.h b/util.h index 2fa098a594..f5aa28a8ad 100644 --- a/util.h +++ b/util.h @@ -39,7 +39,7 @@ unsigned long scan_oct _((const char*, int, int*)); #define scan_hex ruby_scan_hex unsigned long scan_hex _((const char*, int, int*)); -#if defined(MSDOS) || defined(__CYGWIN32__) || defined(NT) || defined(_WIN32_WCE) +#if defined(MSDOS) || defined(__CYGWIN32__) || defined(_WIN32) void ruby_add_suffix(); #define add_suffix ruby_add_suffix #endif diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 0164910437..269e32bc95 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -78,7 +78,7 @@ prefix = /usr DESTDIR = $(prefix) !endif !if !defined(CFLAGS) -CFLAGS = -MD -DNT=1 $(DEBUGFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG) +CFLAGS = -MD $(DEBUGFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG) !endif !if !defined(CPPFLAGS) CPPFLAGS = -I. -I$(srcdir) -I$(srcdir)/missing -DLIBRUBY_SO=\"$(LIBRUBY_SO)\" @@ -265,7 +265,6 @@ config.h: Makefile $(srcdir)/win32/Makefile.sub #define DEFAULT_KCODE KCODE_NONE #define DLEXT ".so" #define DLEXT2 ".dll" -#define NT 1 #define RUBY_LIB "/lib/ruby/1.7" #define RUBY_SITE_LIB "/lib/ruby/site_ruby" #define RUBY_SITE_LIB2 "/lib/ruby/site_ruby/1.7" diff --git a/win32/win32.h b/win32/win32.h index 67c054c3fd..41c3a40a2f 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -33,6 +33,14 @@ #include #undef OpenFile #endif + +#define NT 1 /* deprecated */ + +#ifdef _WIN32_WCE +#undef CharNext +#define CharNext CharNextA +#endif + // // We're not using Microsoft's "extensions" to C for // Structured Exception Handling (SEH) so we can nuke these diff --git a/wince/exe.mak b/wince/exe.mak index 2fb0d4237f..c39c0f7bc6 100644 --- a/wince/exe.mak +++ b/wince/exe.mak @@ -9,7 +9,7 @@ CFG=MIPS CESubsystem=windowsce,3.0 #!MESSAGE CESubsystem not specified. use windowsce,2.11. !MESSAGE CESubsystem not specified. use windowsce,3.0. -!ENDIF +!ENDIF !IF "$(CEVersion)" == "" #CEVersion=200 diff --git a/wince/mswince-ruby17.def b/wince/mswince-ruby17.def index 930a35b414..a5473496b1 100644 --- a/wince/mswince-ruby17.def +++ b/wince/mswince-ruby17.def @@ -470,7 +470,6 @@ rb_num_coerce_bin rb_num_zerodiv rb_obj_alloc rb_obj_as_string -rb_obj_become rb_obj_call_init rb_obj_class rb_obj_clone @@ -800,15 +799,15 @@ yyerrflag yygindex yylen yylhs -yyname -yynerrs -yyrindex -yyrule -yysindex -yyss -yyssp -yytable -yyval -yyvs -yyvsp -wce_SetCommandLine +yyname +yynerrs +yyrindex +yyrule +yysindex +yyss +yyssp +yytable +yyval +yyvs +yyvsp +wce_SetCommandLine -- cgit v1.2.3