small fixes to compile in Windows again.
Trust _isatty
This commit is contained in:
parent
16d0f2e749
commit
0719b8a19d
0
.depend.in
Normal file
0
.depend.in
Normal file
@ -288,11 +288,7 @@ unix_upd_stream_info (StreamDesc * s)
|
|||||||
#if _MSC_VER || defined(__MINGW32__)
|
#if _MSC_VER || defined(__MINGW32__)
|
||||||
{
|
{
|
||||||
if (
|
if (
|
||||||
#ifdef __MINGW32__
|
|
||||||
TRUE /* we cannot trust _isatty in MINGW */
|
|
||||||
#else
|
|
||||||
_isatty(_fileno(s->u.file.file))
|
_isatty(_fileno(s->u.file.file))
|
||||||
#endif
|
|
||||||
) {
|
) {
|
||||||
s->status |= Tty_Stream_f|Reset_Eof_Stream_f|Promptable_Stream_f;
|
s->status |= Tty_Stream_f|Reset_Eof_Stream_f|Promptable_Stream_f;
|
||||||
/* make all console descriptors unbuffered */
|
/* make all console descriptors unbuffered */
|
||||||
@ -1310,7 +1306,7 @@ static int
|
|||||||
ConsoleSocketGetc(int sno)
|
ConsoleSocketGetc(int sno)
|
||||||
{
|
{
|
||||||
register StreamDesc *s = &Stream[sno];
|
register StreamDesc *s = &Stream[sno];
|
||||||
register int ch;
|
int ch;
|
||||||
Int c;
|
Int c;
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
@ -1327,7 +1323,7 @@ ConsoleSocketGetc(int sno)
|
|||||||
/* should be able to use a buffer */
|
/* should be able to use a buffer */
|
||||||
Yap_PrologMode |= ConsoleGetcMode;
|
Yap_PrologMode |= ConsoleGetcMode;
|
||||||
#if _MSC_VER || defined(__MINGW32__)
|
#if _MSC_VER || defined(__MINGW32__)
|
||||||
count = recv(s->u.socket.fd, &c, sizeof(char), 0);
|
count = recv(s->u.socket.fd, (void *)&c, sizeof(char), 0);
|
||||||
#else
|
#else
|
||||||
count = read(s->u.socket.fd, &c, sizeof(char));
|
count = read(s->u.socket.fd, &c, sizeof(char));
|
||||||
#endif
|
#endif
|
||||||
|
@ -24,6 +24,11 @@
|
|||||||
#include <gmp.h>
|
#include <gmp.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __WIN32__
|
||||||
|
/* Windows */
|
||||||
|
#include <fcntl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define BUF_SIZE 256
|
#define BUF_SIZE 256
|
||||||
#define TMP_BUF_SIZE 2*BUF_SIZE
|
#define TMP_BUF_SIZE 2*BUF_SIZE
|
||||||
#define BUF_RINGS 16
|
#define BUF_RINGS 16
|
||||||
|
Reference in New Issue
Block a user