diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-02-27 12:21:49 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-02-27 12:21:49 +0000 |
commit | 3374832f922c8a9624f9d3c4b0e7bfbec9cf6d1a (patch) | |
tree | b8e76c248deb30334aceb543cbf3a60b8d741502 | |
parent | 22ea7b7fb9a2fa14c43b5556d59b45047d51c812 (diff) | |
download | ruby-3374832f922c8a9624f9d3c4b0e7bfbec9cf6d1a.tar.gz |
* win32/win32.c (set_pioinfo_extra): new function for VC++8 SP1
workaround. [ruby-core:10259]
* win32/win32.c (NtInitialize): call above function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@11909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | version.h | 8 | ||||
-rw-r--r-- | win32/win32.c | 30 |
3 files changed, 40 insertions, 5 deletions
@@ -1,3 +1,10 @@ +Tue Feb 27 21:19:35 2007 NAKAMURA Usaku <usa@ruby-lang.org> + + * win32/win32.c (set_pioinfo_extra): new function for VC++8 SP1 + workaround. [ruby-core:10259] + + * win32/win32.c (NtInitialize): call above function. + Mon Feb 26 09:57:58 2007 Yukihiro Matsumoto <matz@ruby-lang.org> * signal.c (ruby_signal): don't set SA_RESTART. a backport from @@ -1,15 +1,15 @@ #define RUBY_VERSION "1.8.5" -#define RUBY_RELEASE_DATE "2007-02-26" +#define RUBY_RELEASE_DATE "2007-02-27" #define RUBY_VERSION_CODE 185 -#define RUBY_RELEASE_CODE 20070226 -#define RUBY_PATCHLEVEL 21 +#define RUBY_RELEASE_CODE 20070227 +#define RUBY_PATCHLEVEL 22 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 #define RUBY_VERSION_TEENY 5 #define RUBY_RELEASE_YEAR 2007 #define RUBY_RELEASE_MONTH 2 -#define RUBY_RELEASE_DAY 26 +#define RUBY_RELEASE_DAY 27 RUBY_EXTERN const char ruby_version[]; RUBY_EXTERN const char ruby_release_date[]; diff --git a/win32/win32.c b/win32/win32.c index f12100d68d..d63e3ab172 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -395,7 +395,10 @@ NtInitialize(int *argc, char ***argv) int ret; #if _MSC_VER >= 1400 + static void set_pioinfo_extra(void); + _set_invalid_parameter_handler(invalid_parameter); + set_pioinfo_extra(); #endif // @@ -1668,11 +1671,36 @@ EXTERN_C _CRTIMP ioinfo * __pioinfo[]; #define IOINFO_L2E 5 #define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E) -#define _pioinfo(i) (__pioinfo[i >> IOINFO_L2E] + (i & (IOINFO_ARRAY_ELTS - 1))) +#define _pioinfo(i) ((ioinfo*)((char*)(__pioinfo[i >> IOINFO_L2E]) + (i & (IOINFO_ARRAY_ELTS - 1)) * (sizeof(ioinfo) + pioinfo_extra))) #define _osfhnd(i) (_pioinfo(i)->osfhnd) #define _osfile(i) (_pioinfo(i)->osfile) #define _pipech(i) (_pioinfo(i)->pipech) +#if _MSC_VER >= 1400 +static size_t pioinfo_extra = 0; /* workaround for VC++8 SP1 */ + +static void +set_pioinfo_extra(void) +{ + int fd; + + fd = open("NUL", O_RDONLY); + for (pioinfo_extra = 0; pioinfo_extra <= 64; pioinfo_extra += sizeof(void *)) { + if (_osfhnd(fd) == _get_osfhandle(fd)) { + break; + } + } + close(fd); + + if (pioinfo_extra > 64) { + /* not found, maybe something wrong... */ + pioinfo_extra = 0; + } +} +#else +#define pioinfo_extra 0 +#endif + #define _set_osfhnd(fh, osfh) (void)(_osfhnd(fh) = osfh) #define _set_osflags(fh, flags) (_osfile(fh) = (flags)) |