From 82efc8fb2cf07dd570ebbbf8126d9dd49f5631e7 Mon Sep 17 00:00:00 2001 From: vsc Date: Fri, 22 Aug 2008 01:59:48 +0000 Subject: [PATCH] small fixes to compile in Windows again. Trust _isatty git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2311 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- .depend.in | 0 C/iopreds.c | 8 ++------ configure.in | 2 +- library/yap2swi/yap2swi.c | 5 +++++ 4 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 .depend.in diff --git a/.depend.in b/.depend.in new file mode 100644 index 000000000..e69de29bb diff --git a/C/iopreds.c b/C/iopreds.c index 5cce80a91..0b2f269cf 100644 --- a/C/iopreds.c +++ b/C/iopreds.c @@ -288,11 +288,7 @@ unix_upd_stream_info (StreamDesc * s) #if _MSC_VER || defined(__MINGW32__) { if ( -#ifdef __MINGW32__ - TRUE /* we cannot trust _isatty in MINGW */ -#else _isatty(_fileno(s->u.file.file)) -#endif ) { s->status |= Tty_Stream_f|Reset_Eof_Stream_f|Promptable_Stream_f; /* make all console descriptors unbuffered */ @@ -1310,7 +1306,7 @@ static int ConsoleSocketGetc(int sno) { register StreamDesc *s = &Stream[sno]; - register int ch; + int ch; Int c; int count; @@ -1327,7 +1323,7 @@ ConsoleSocketGetc(int sno) /* should be able to use a buffer */ Yap_PrologMode |= ConsoleGetcMode; #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 count = read(s->u.socket.fd, &c, sizeof(char)); #endif diff --git a/configure.in b/configure.in index c96990731..2ecc19be8 100644 --- a/configure.in +++ b/configure.in @@ -1438,7 +1438,7 @@ mkdir -p GPL/clpqr mkdir -p GPL/http mkdir -p cplint -AC_OUTPUT(Makefile library/matrix/Makefile library/matlab/Makefile library/regex/Makefile library/system/Makefile library/random/Makefile library/yap2swi/Makefile library/mpi/Makefile .depend library/Makefile LGPL/Makefile LGPL/chr/Makefile LGPL/chr/chr_swi_bootstrap.yap CLPBN/Makefile LGPL/clp/Makefile GPL/clpqr/Makefile library/lammpi/Makefile library/tries/Makefile library/rltree/Makefile LGPL/swi_console/Makefile LGPL/JPL/Makefile LGPL/JPL/src/Makefile LGPL/JPL/java/Makefile LGPL/JPL/jpl_paths.yap GPL/http/Makefile GPL/Makefile cplint/Makefile) +AC_OUTPUT(Makefile library/matrix/Makefile library/matlab/Makefile library/regex/Makefile library/system/Makefile library/random/Makefile library/yap2swi/Makefile library/mpi/Makefile .depend library/Makefile LGPL/Makefile LGPL/chr/Makefile LGPL/chr/chr_swi_bootstrap.yap CLPBN/Makefile LGPL/clp/Makefile GPL/clpqr/Makefile library/lammpi/Makefile library/tries/Makefile library/rltree/Makefile LGPL/swi_console/Makefile LGPL/JPL/Makefile LGPL/JPL/src/Makefile LGPL/JPL/java/Makefile LGPL/JPL/jpl_paths.yap GPL/http/Makefile GPL/Makefile cplint/Makefile) make depend diff --git a/library/yap2swi/yap2swi.c b/library/yap2swi/yap2swi.c index 222093677..17a944211 100644 --- a/library/yap2swi/yap2swi.c +++ b/library/yap2swi/yap2swi.c @@ -24,6 +24,11 @@ #include #endif +#ifdef __WIN32__ +/* Windows */ +#include +#endif + #define BUF_SIZE 256 #define TMP_BUF_SIZE 2*BUF_SIZE #define BUF_RINGS 16