зеркало из https://github.com/github/ruby.git
* win32/win32.c (rb_w32_putc): wrong condition to fill or flush on
bccwin32. [ruby-win32:408] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
31ab445fea
Коммит
1de50c518b
|
@ -1,3 +1,8 @@
|
|||
Sat Oct 12 23:44:11 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||
|
||||
* win32/win32.c (rb_w32_putc): wrong condition to fill or flush on
|
||||
bccwin32. [ruby-win32:408]
|
||||
|
||||
Fri Oct 11 06:05:30 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||
|
||||
* win32/win32.c (rb_w32_fclose, rb_w32_close): use closesocket()
|
||||
|
|
|
@ -51,7 +51,12 @@
|
|||
|
||||
#ifdef __BORLANDC__
|
||||
# define _filbuf _fgetc
|
||||
# define _flsbuf fputc
|
||||
# define _flsbuf _fputc
|
||||
# define enough_to_get(n) (--(n) >= 0)
|
||||
# define enough_to_put(n) (++(n) < 0)
|
||||
#else
|
||||
# define enough_to_get(n) (--(n) >= 0)
|
||||
# define enough_to_put(n) (--(n) >= 0)
|
||||
#endif
|
||||
|
||||
#if HAVE_WSAWAITFORMULTIPLEEVENTS
|
||||
|
@ -2788,7 +2793,7 @@ static void catch_interrupt(void)
|
|||
int rb_w32_getc(FILE* stream)
|
||||
{
|
||||
int c, trap_immediate = rb_trap_immediate;
|
||||
if (--stream->FILE_COUNT >= 0) {
|
||||
if (enough_to_get(stream->FILE_COUNT)) {
|
||||
c = (unsigned char)*stream->FILE_READPTR++;
|
||||
rb_trap_immediate = trap_immediate;
|
||||
}
|
||||
|
@ -2810,7 +2815,7 @@ int rb_w32_getc(FILE* stream)
|
|||
int rb_w32_putc(int c, FILE* stream)
|
||||
{
|
||||
int trap_immediate = rb_trap_immediate;
|
||||
if (--stream->FILE_COUNT >= 0) {
|
||||
if (enough_to_put(stream->FILE_COUNT)) {
|
||||
c = (unsigned char)(*stream->FILE_READPTR++ = (char)c);
|
||||
rb_trap_immediate = trap_immediate;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче