1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

*bcc32 fix for win9x.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
H_Konishi 2002-06-14 12:21:50 +00:00
parent 9e1473541d
commit 42c59aa317
4 changed files with 31 additions and 40 deletions

View file

@ -1,3 +1,11 @@
Fri Jun 14 21:01:48 2002 KONISHI Hiromasa <konishih@fd6.so-net.ne.jp>
* bcc32/mkexports.rb: insert sleep(1) for win9x.
* bcc32/configure.bat: change return code LF -> CRLF fo win9x.
* win32/win32.c: fix rb_w32_open_osfhandle()
Fri Jun 14 15:22:19 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* parse.y (read_escape): deny zero-width hexadecimal character.

View file

@ -1,11 +1,11 @@
@echo off
::: Don't set environment variable in batch file other than autoexec.bat
::: to avoid "Out of environment space" problem on Windows 95/98.
::: set TMPMAKE=~tmp~.mak
echo> ~tmp~.mak ####
echo>> ~tmp~.mak conf = %0
echo>> ~tmp~.mak $(conf:\=/): nul
echo>> ~tmp~.mak @del ~tmp~.mak
echo>> ~tmp~.mak make -Dbcc32dir="$(@D)" -f$(@D)/setup.mak %1
make -f ~tmp~.mak
@echo off
::: Don't set environment variable in batch file other than autoexec.bat
::: to avoid "Out of environment space" problem on Windows 95/98.
::: set TMPMAKE=~tmp~.mak
echo> ~tmp~.mak ####
echo>> ~tmp~.mak conf = %0
echo>> ~tmp~.mak $(conf:\=/): nul
echo>> ~tmp~.mak @del ~tmp~.mak
echo>> ~tmp~.mak make -Dbcc32dir="$(@D)" -f$(@D)/setup.mak %1
make -f ~tmp~.mak

View file

@ -3,7 +3,7 @@
SYM = {}
objs = ARGV.collect {|s| s.tr('/', '\\')}
system("tdump -oiPUBDEF -oiPUBD32 #{objs.join(' ')} > pub.def")
sleep(1)
IO.foreach('pub.def'){|l|
next unless /(PUBDEF|PUBD32)/ =~ l
/'(.*?)'/ =~ l

View file

@ -1323,7 +1323,7 @@ EXTERN_C void __cdecl _lock_fhandle(int);
EXTERN_C void __cdecl _unlock_fhandle(int);
EXTERN_C void __cdecl _unlock(int);
#if defined _MT || defined __MSVCRT__
#if (defined _MT || defined __MSVCRT__) && !defined __BORLANDC__
#define MSVCRT_THREADS
#endif
#ifdef MSVCRT_THREADS
@ -1360,6 +1360,15 @@ EXTERN_C _CRTIMP ioinfo * __pioinfo[];
#define _osfhnd(i) (_pioinfo(i)->osfhnd)
#define _osfile(i) (_pioinfo(i)->osfile)
#define _pipech(i) (_pioinfo(i)->pipech)
#define _set_osfhnd(fh, osfh) (void)(_osfhnd(fh) = osfh)
#define _set_osflags(fh, flags) (_osfile(fh) = (flags))
#else
#define _set_osfhnd(fh, osfh) (void)((fh), (osfh))
#define _set_osflags(fh, flags) (void)((fh), (flags))
#endif
#define FOPEN 0x01 /* file handle open */
@ -1368,8 +1377,6 @@ EXTERN_C _CRTIMP ioinfo * __pioinfo[];
#define FDEV 0x40 /* file handle refers to device */
#define FTEXT 0x80 /* file handle is in text mode */
#define _set_osfhnd(fh, osfh) (void)(_osfhnd(fh) = osfh)
static int
rb_w32_open_osfhandle(long osfhandle, int flags)
{
@ -1388,29 +1395,6 @@ rb_w32_open_osfhandle(long osfhandle, int flags)
if (flags & O_NOINHERIT)
fileflags |= FNOINHERIT;
#ifdef __BORLANDC__
{
/* attempt to allocate a C Runtime file handle */
HANDLE hF = CreateFile("NUL", 0, 0, NULL, OPEN_ALWAYS, 0, NULL);
fh = _open_osfhandle((long)hF, 0);
CloseHandle(hF);
if (fh == -1) {
errno = EMFILE; /* too many open files */
_doserrno = 0L; /* not an OS error */
}
else {
MTHREAD_ONLY(EnterCriticalSection(&(_pioinfo(fh)->lock)));
/* the file is open. now, set the info in _osfhnd array */
//_set_osfhnd(fh, osfhandle);
fileflags |= FOPEN; /* mark as open */
//_osfile(fh) = fileflags; /* set osfile entry */
MTHREAD_ONLY(LeaveCriticalSection(&_pioinfo(fh)->lock));
}
}
#else
RUBY_CRITICAL({
/* attempt to allocate a C Runtime file handle */
HANDLE hF = CreateFile("NUL", 0, 0, NULL, OPEN_ALWAYS, 0, NULL);
@ -1428,11 +1412,10 @@ rb_w32_open_osfhandle(long osfhandle, int flags)
fileflags |= FOPEN; /* mark as open */
_osfile(fh) = fileflags; /* set osfile entry */
_set_osflags(fh, fileflags); /* set osfile entry */
MTHREAD_ONLY(LeaveCriticalSection(&_pioinfo(fh)->lock));
}
});
#endif
return fh; /* return handle */
}