[前][次][番号順一覧][スレッド一覧]

ruby-changes:24291

From: usa <ko1@a...>
Date: Mon, 9 Jul 2012 17:25:18 +0900 (JST)
Subject: [ruby-changes:24291] usa:r36342 (trunk): * win32/configure.bat, win32/setup.mak, win32/Makefile.sub: omit Win9x

usa	2012-07-09 17:25:06 +0900 (Mon, 09 Jul 2012)

  New Revision: 36342

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=36342

  Log:
    * win32/configure.bat, win32/setup.mak, win32/Makefile.sub: omit Win9x
      support.  remove --enable/disable-win95 option.
    
    * include/ruby/win32.h, file.c, win32/win32.c: ditto.
    
    * win32/README.win32: ditto.

  Modified files:
    trunk/ChangeLog
    trunk/file.c
    trunk/include/ruby/win32.h
    trunk/win32/Makefile.sub
    trunk/win32/README.win32
    trunk/win32/configure.bat
    trunk/win32/setup.mak
    trunk/win32/win32.c

Index: include/ruby/win32.h
===================================================================
--- include/ruby/win32.h	(revision 36341)
+++ include/ruby/win32.h	(revision 36342)
@@ -105,14 +105,9 @@
 # include <unistd.h>
 #endif
 
-#ifdef WIN95
 extern DWORD rb_w32_osid(void);
 #define rb_w32_iswinnt()  (rb_w32_osid() == VER_PLATFORM_WIN32_NT)
 #define rb_w32_iswin95()  (rb_w32_osid() == VER_PLATFORM_WIN32_WINDOWS)
-#else
-#define rb_w32_iswinnt()  TRUE
-#define rb_w32_iswin95()  FALSE
-#endif
 
 #define WNOHANG -1
 
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 36341)
+++ ChangeLog	(revision 36342)
@@ -1,3 +1,12 @@
+Mon Jul  9 17:22:16 2012  NAKAMURA Usaku  <usa@r...>
+
+	* win32/configure.bat, win32/setup.mak, win32/Makefile.sub: omit Win9x
+	  support.  remove --enable/disable-win95 option.
+
+	* include/ruby/win32.h, file.c, win32/win32.c: ditto.
+
+	* win32/README.win32: ditto.
+
 Mon Jul  9 13:28:34 2012  Nobuyoshi Nakada  <nobu@r...>
 
 	* configure.in (DLDFLAGS): use TARGET_ENTRY to specify an entry point
Index: win32/win32.c
===================================================================
--- win32/win32.c	(revision 36341)
+++ win32/win32.c	(revision 36342)
@@ -271,14 +271,6 @@
     return osver.dwMajorVersion;
 }
 
-#define IsWinNT() rb_w32_iswinnt()
-#define IsWin95() rb_w32_iswin95()
-#ifdef WIN95
-#define IfWin95(win95, winnt) (IsWin95() ? (win95) : (winnt))
-#else
-#define IfWin95(win95, winnt) (winnt)
-#endif
-
 /* simulate flock by locking a range on the file */
 
 /* License: Artistic or GPL */
@@ -335,54 +327,13 @@
     return i;
 }
 
-#ifdef WIN95
-/* License: Artistic or GPL */
-static uintptr_t
-flock_win95(uintptr_t self, int argc, uintptr_t* argv)
-{
-    int i = -1;
-    const HANDLE fh = (HANDLE)self;
-    const int oper = argc;
-
-    switch(oper) {
-      case LOCK_EX:
-	do {
-	    LK_ERR(LockFile(fh, 0, 0, LK_LEN, LK_LEN), i);
-	} while (i && errno == EWOULDBLOCK);
-	break;
-      case LOCK_EX|LOCK_NB:
-	LK_ERR(LockFile(fh, 0, 0, LK_LEN, LK_LEN), i);
-	break;
-      case LOCK_UN:
-      case LOCK_UN|LOCK_NB:
-	LK_ERR(UnlockFile(fh, 0, 0, LK_LEN, LK_LEN), i);
-	break;
-      default:
-	errno = EINVAL;
-	break;
-    }
-    return i;
-}
-#endif
-
 #undef LK_ERR
 
 /* License: Artistic or GPL */
 int
 flock(int fd, int oper)
 {
-#ifdef WIN95
-    static asynchronous_func_t locker = NULL;
-
-    if (!locker) {
-	if (IsWinNT())
-	    locker = flock_winnt;
-	else
-	    locker = flock_win95;
-    }
-#else
     const asynchronous_func_t locker = flock_winnt;
-#endif
 
     return rb_w32_asynchronize(locker,
 			      (VALUE)_get_osfhandle(fd), oper, NULL,
@@ -1194,11 +1145,6 @@
     child->hProcess = aProcessInformation.hProcess;
     child->pid = (rb_pid_t)aProcessInformation.dwProcessId;
 
-    if (!IsWinNT()) {
-	/* On Win9x, make pid positive similarly to cygwin and perl */
-	child->pid = -child->pid;
-    }
-
     return child;
 }
 
@@ -4116,7 +4062,6 @@
 	return -1;
     }
 
-    (void)IfWin95(pid = -pid, 0);
     if ((unsigned int)pid == GetCurrentProcessId() &&
 	(sig != 0 && sig != SIGKILL)) {
 	if ((ret = raise(sig)) != 0) {
@@ -4382,20 +4327,8 @@
 	    switch (GetLastError()) {
 	      case ERROR_ALREADY_EXISTS:
 	      case ERROR_FILE_EXISTS:
-		if (IsWinNT()) {
-		    if (MoveFileExW(oldpath, newpath, MOVEFILE_REPLACE_EXISTING))
-			res = 0;
-		}
-		else {
-		    for (;;) {
-			if (!DeleteFileW(newpath) && GetLastError() != ERROR_FILE_NOT_FOUND)
-			    break;
-			else if (MoveFileW(oldpath, newpath)) {
-			    res = 0;
-			    break;
-			}
-		    }
-		}
+		if (MoveFileExW(oldpath, newpath, MOVEFILE_REPLACE_EXISTING))
+		    res = 0;
 	    }
 	}
 
@@ -4662,22 +4595,7 @@
 
     return 0;
 }
-
-#ifdef WIN95
-/* License: Ruby's */
-static int
-win95_stat(const WCHAR *path, struct stati64 *st)
-{
-    int ret = _wstati64(path, st);
-    if (ret) return ret;
-    if (st->st_mode & S_IFDIR) {
-	return check_valid_dir(path);
-    }
-    return 0;
-}
-#else
 #define win95_stat(path, st) -1
-#endif
 
 /* License: Ruby's */
 int
@@ -4729,7 +4647,7 @@
     else if (*end == L'\\' || (buf1 + 1 == end && *end == L':'))
 	lstrcatW(buf1, L".");
 
-    ret = IsWinNT() ? winnt_stat(buf1, st) : win95_stat(buf1, st);
+    ret = winnt_stat(buf1, st);
     if (ret == 0) {
 	st->st_mode &= ~(S_IWGRP | S_IWOTH);
     }
@@ -4832,17 +4750,6 @@
 {
     HANDLE h;
     int ret;
-#ifdef WIN95
-    if (IsWin95()) {
-	int fd = open(path, O_WRONLY), e = 0;
-	if (fd == -1) return -1;
-	ret = chsize(fd, (unsigned long)length);
-	if (ret == -1) e = errno;
-	close(fd);
-	if (ret == -1) errno = e;
-	return ret;
-    }
-#endif
     h = CreateFile(path, GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
     if (h == INVALID_HANDLE_VALUE) {
 	errno = map_errno(GetLastError());
@@ -4859,11 +4766,6 @@
 {
     HANDLE h;
 
-#ifdef WIN95
-    if (IsWin95()) {
-	return chsize(fd, (unsigned long)length);
-    }
-#endif
     h = (HANDLE)_get_osfhandle(fd);
     if (h == (HANDLE)-1) return -1;
     return rb_chsize(h, length);
@@ -5177,13 +5079,7 @@
 rb_pid_t
 rb_w32_getpid(void)
 {
-    rb_pid_t pid;
-
-    pid = GetCurrentProcessId();
-
-    (void)IfWin95(pid = -pid, 0);
-
-    return pid;
+    return GetCurrentProcessId();
 }
 
 
@@ -5195,7 +5091,7 @@
     static query_func *pNtQueryInformationProcess = NULL;
     rb_pid_t ppid = 0;
 
-    if (!IsWin95() && rb_w32_osver() >= 5) {
+    if (rb_w32_osver() >= 5) {
 	if (!pNtQueryInformationProcess)
 	    pNtQueryInformationProcess = (query_func *)get_proc_address("ntdll.dll", "NtQueryInformationProcess", NULL);
 	if (pNtQueryInformationProcess) {
@@ -6291,7 +6187,7 @@
 	if (attr != (DWORD)-1 && (attr & FILE_ATTRIBUTE_READONLY))
 	    SetFileAttributesW(path, attr & ~FILE_ATTRIBUTE_READONLY);
 	hFile = CreateFileW(path, GENERIC_WRITE, 0, 0, OPEN_EXISTING,
-			    IsWin95() ? 0 : FILE_FLAG_BACKUP_SEMANTICS, 0);
+			    FILE_FLAG_BACKUP_SEMANTICS, 0);
 	if (hFile == INVALID_HANDLE_VALUE) {
 	    errno = map_errno(GetLastError());
 	    ret = -1;
Index: win32/configure.bat
===================================================================
--- win32/configure.bat	(revision 36341)
+++ win32/configure.bat	(revision 36342)
@@ -23,8 +23,6 @@
 if "%1" == "--so-name" goto :soname
 if "%1" == "--enable-install-doc" goto :enable-rdoc
 if "%1" == "--disable-install-doc" goto :disable-rdoc
-if "%1" == "--enable-win95" goto :enable-win95
-if "%1" == "--disable-win95" goto :disable-win95
 if "%1" == "--enable-debug-env" goto :enable-debug-env
 if "%1" == "--disable-debug-env" goto :disable-debug-env
 if "%1" == "--enable-rubygems" goto :enable-rubygems
@@ -106,16 +104,6 @@
   echo>>confargs.tmp %1 \
   shift
 goto :loop
-:enable-win95
-  echo>> ~tmp~.mak 	"ENABLE_WIN95=yes" \
-  echo>>confargs.tmp %1 \
-  shift
-goto :loop
-:disable-win95
-  echo>> ~tmp~.mak 	"ENABLE_WIN95=no" \
-  echo>>confargs.tmp %1 \
-  shift
-goto :loop
 :enable-debug-env
   echo>> ~tmp~.mak 	"ENABLE_DEBUG_ENV=yes" \
   echo>>confargs.tmp %1 \
Index: win32/README.win32
===================================================================
--- win32/README.win32	(revision 36341)
+++ win32/README.win32	(revision 36342)
@@ -4,9 +4,9 @@
 
 == Requirement
 
-(1) Windows 2000 or later (NT based kernel).
+(1) Windows XP or later.
 
-(2) Visual C++ 6.0 or later.
+(2) Visual C++ 6.0 or later. (strongly recommended VC++ 10)
 
     Note: if you want to build x64 or ia64 version, use native compiler for
           x64/ia64.
@@ -29,10 +29,6 @@
     of cmd.exe.  If you want to enable it explicitly, run cmd.exe with /E:ON
     option.
 
-(6) If you want built binaries to run on Windows 95 series (including
-    98 and Me), you need unicows.lib at compile time, and unicows.dll
-    at run time.
-
 == How to compile and install
 
 (1) Execute win32\configure.bat on your build directory.
Index: win32/Makefile.sub
===================================================================
--- win32/Makefile.sub	(revision 36341)
+++ win32/Makefile.sub	(revision 36342)
@@ -228,9 +228,6 @@
 !if !defined(LIBS)
 LIBS = oldnames.lib user32.lib advapi32.lib shell32.lib ws2_32.lib imagehlp.lib $(EXTLIBS)
 !endif
-!if "$(ENABLE_WIN95)" == "yes"
-LIBS = unicows.lib $(LIBS)
-!endif
 !if !defined(MISSING)
 MISSING = acosh.obj cbrt.obj crypt.obj erf.obj ffs.obj langinfo.obj lgamma_r.obj strlcat.obj strlcpy.obj tgamma.obj win32/win32.obj win32/file.obj setproctitle.obj
 !endif
@@ -477,9 +474,6 @@
 #if _MSC_VER != $(MSC_VER)
 #error MSC version unmatch: _MSC_VER: $(MSC_VER) is expected.
 #endif
-!if "$(ENABLE_WIN95)" == "yes" && "$(MACHINE)" == "x86"
-#define WIN95 1
-!endif
 #define RUBY_MSVCRT_VERSION $(RT_VER)
 #define STDC_HEADERS 1
 #define HAVE_SYS_TYPES_H 1
Index: win32/setup.mak
===================================================================
--- win32/setup.mak	(revision 36341)
+++ win32/setup.mak	(revision 36342)
@@ -70,9 +70,9 @@
 	@echo !endif>> $(MAKEFILE)
 !endif
 
--system-vars-: -runtime- -unicows-
+-system-vars-: -runtime-
 
--system-vars32-: -osname32- -runtime- -unicows-
+-system-vars32-: -osname32- -runtime-
 
 -system-vars64-: -osname64- -runtime-
 
@@ -154,21 +154,6 @@
 	@.\rtname >>$(MAKEFILE)
 	@del rtname.*
 
--unicows-: nul
-!if "$(ENABLE_WIN95)" == ""
-	@echo Checking unicows.lib
-	@$(CC) -MD <<conftest.c unicows.lib user32.lib > nul && echo>>$(MAKEFILE) ENABLE_WIN95 = yes || rem
-#include <windows.h>
-int main()
-{
-    return GetEnvironmentVariableW(0, 0, 0) == 0;
-}
-<<
-	@del conftest.*
-!else if "$(ENABLE_WIN95)" == "yes"
-	@echo>>$(MAKEFILE) ENABLE_WIN95 = yes
-!endif
-
 -version-: nul
 	@$(APPEND)
 	@$(CPP) -I$(srcdir) -I$(srcdir)/include <<"Creating $(MAKEFILE)" | findstr "=" >>$(MAKEFILE)
Index: file.c
===================================================================
--- file.c	(revision 36341)
+++ file.c	(revision 36342)
@@ -857,8 +857,7 @@
 	MultiByteToWideChar(CP_UTF8, 0, RSTRING_PTR(tmp), -1, ptr, len);
 	f = CreateFileW(ptr, 0,
 			FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
-			rb_w32_iswin95() ? 0 : FILE_FLAG_BACKUP_SEMANTICS,
-			NULL);
+			FILE_FLAG_BACKUP_SEMANTICS, NULL);
 	ALLOCV_END(v);
 	if (f == INVALID_HANDLE_VALUE) return f;
 	ret = f;
@@ -1672,7 +1671,6 @@
 	st1.nFileIndexLow == st2.nFileIndexLow)
 	return Qtrue;
     if (!f1 || !f2) return Qfalse;
-    if (rb_w32_iswin95()) return Qfalse;
 # else
     FilePathValue(fname1);
     fname1 = rb_str_new4(fname1);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]