summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-11-22 16:26:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-11-22 16:26:39 +0000
commitfff3548e046ec1625daec19cbdb644e8907f4280 (patch)
tree627508398d5732f322df2321749b2dd10cd9f55e /win32
parentd1f1aa820f6367af03686252ccb7c43f325e7b43 (diff)
* file.c (test_identical): test if two files are identical.
* file.c (rb_f_test): support DOSISH systems where st_ino is not reliable. fixed: [ruby-core:06672] * win32.h, win32.c (rb_w32_osid): check the running platform. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c28
-rw-r--r--win32/win32.h15
2 files changed, 21 insertions, 22 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 5ec3aea4af..530cada51f 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -47,12 +47,6 @@
#define bool int
#endif
-#ifdef _M_IX86
-# define WIN95 1
-#else
-# undef WIN95
-#endif
-
#if defined __BORLANDC__ || defined _WIN32_WCE
# define _filbuf _fgetc
# define _flsbuf _fputc
@@ -209,10 +203,10 @@ map_errno(DWORD winerr)
static char *NTLoginName;
#ifdef WIN95
-DWORD Win32System = (DWORD)-1;
+static DWORD Win32System = (DWORD)-1;
-static DWORD
-IdOS(void)
+DWORD
+rb_w32_osid(void)
{
static OSVERSIONINFO osver;
@@ -224,21 +218,11 @@ IdOS(void)
}
return (Win32System);
}
-
-static int
-IsWin95(void) {
- return (IdOS() == VER_PLATFORM_WIN32_WINDOWS);
-}
-
-static int
-IsWinNT(void) {
- return (IdOS() == VER_PLATFORM_WIN32_NT);
-}
-#else
-# define IsWinNT() TRUE
-# define IsWin95() FALSE
#endif
+#define IsWinNT() rb_w32_iswinnt()
+#define IsWin95() rb_w32_iswin95()
+
/* main thread constants */
static struct {
HANDLE handle;
diff --git a/win32/win32.h b/win32/win32.h
index 5a93f2d313..2d88de472a 100644
--- a/win32/win32.h
+++ b/win32/win32.h
@@ -74,6 +74,21 @@ extern "C++" {
}
#endif
+#ifdef _M_IX86
+# define WIN95 1
+#else
+# undef WIN95
+#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
#undef getc