no_readline patches

avoid warnings in no_gmp world
avoid complaining by Solaris
This commit is contained in:
Costa Vitor 2009-06-15 14:59:50 -05:00
parent b7b3abb2c7
commit de5a09039f
3 changed files with 16 additions and 19 deletions

View File

@ -583,8 +583,8 @@ a_cmp(Term t1, Term t2)
} else { } else {
return FALSE; return FALSE;
} }
} else if (IsBigIntTerm(t1)) {
#ifdef USE_GMP #ifdef USE_GMP
} else if (IsBigIntTerm(t1)) {
{ {
MP_INT *b1 = Yap_BigIntOfTerm(t1); MP_INT *b1 = Yap_BigIntOfTerm(t1);
t2 = Yap_Eval(t2); t2 = Yap_Eval(t2);

View File

@ -117,7 +117,7 @@ STATIC_PROTO (int ConsolePipeGetc, (int));
STATIC_PROTO (int SocketGetc, (int)); STATIC_PROTO (int SocketGetc, (int));
STATIC_PROTO (int ConsoleSocketGetc, (int)); STATIC_PROTO (int ConsoleSocketGetc, (int));
#endif #endif
#if HAVE_LIBREADLINE #if HAVE_LIBREADLINE && HAVE_READLINE_READLINE_H
STATIC_PROTO (int ReadlineGetc, (int)); STATIC_PROTO (int ReadlineGetc, (int));
STATIC_PROTO (int ReadlinePutc, (int,int)); STATIC_PROTO (int ReadlinePutc, (int,int));
#endif #endif
@ -247,7 +247,7 @@ Yap_GetFreeStreamDForReading(void)
static int static int
yap_fflush(int sno) yap_fflush(int sno)
{ {
#if HAVE_LIBREADLINE #if HAVE_LIBREADLINE && HAVE_READLINE_READLINE_H
if (Stream[sno].status & Tty_Stream_f && if (Stream[sno].status & Tty_Stream_f &&
Stream[sno].status & Output_Stream_f) { Stream[sno].status & Output_Stream_f) {
if (ReadlinePos != ReadlineBuf) { if (ReadlinePos != ReadlineBuf) {
@ -349,7 +349,7 @@ p_always_prompt_user(void)
s->stream_getc = ConsoleSocketGetc; s->stream_getc = ConsoleSocketGetc;
} else } else
#endif #endif
#if HAVE_LIBREADLINE #if HAVE_LIBREADLINE && HAVE_READLINE_READLINE_H
if (s->status & Tty_Stream_f) { if (s->status & Tty_Stream_f) {
s->stream_getc = ReadlineGetc; s->stream_getc = ReadlineGetc;
if (Stream[0].status & Tty_Stream_f && if (Stream[0].status & Tty_Stream_f &&
@ -412,7 +412,7 @@ InitFileIO(StreamDesc *s)
s->stream_putc = ConsolePutc; s->stream_putc = ConsolePutc;
s->stream_wputc = put_wchar; s->stream_wputc = put_wchar;
/* if a tty have a special routine to call readline */ /* if a tty have a special routine to call readline */
#if HAVE_LIBREADLINE #if HAVE_LIBREADLINE && HAVE_READLINE_READLINE_H
if (s->status & Tty_Stream_f) { if (s->status & Tty_Stream_f) {
if (Stream[0].status & Tty_Stream_f && if (Stream[0].status & Tty_Stream_f &&
is_same_tty(s->u.file.file,Stream[0].u.file.file)) is_same_tty(s->u.file.file,Stream[0].u.file.file))
@ -990,12 +990,10 @@ p_prompt (void)
return (TRUE); return (TRUE);
} }
#if HAVE_LIBREADLINE #if HAVE_LIBREADLINE && HAVE_READLINE_READLINE_H
#if HAVE_READLINE_READLINE_H
#include <readline/readline.h> #include <readline/readline.h>
#include <readline/history.h> #include <readline/history.h>
#endif
static char *ttyptr = NULL; static char *ttyptr = NULL;
@ -1130,7 +1128,7 @@ ReadlineGetc(int sno)
static Int static Int
p_has_readline(void) p_has_readline(void)
{ {
#if HAVE_LIBREADLINE #if HAVE_LIBREADLINE && HAVE_READLINE_READLINE_H
return TRUE; return TRUE;
#else #else
return FALSE; return FALSE;
@ -1142,7 +1140,7 @@ int
Yap_GetCharForSIGINT(void) Yap_GetCharForSIGINT(void)
{ {
int ch; int ch;
#if HAVE_LIBREADLINE #if HAVE_LIBREADLINE && HAVE_READLINE_READLINE_H
if ((Yap_PrologMode & ConsoleGetcMode) && myrl_line != (char *) NULL) { if ((Yap_PrologMode & ConsoleGetcMode) && myrl_line != (char *) NULL) {
ch = myrl_line[0]; ch = myrl_line[0];
free(myrl_line); free(myrl_line);
@ -1209,7 +1207,7 @@ EOFGetc(int sno)
} else if (s->status & Promptable_Stream_f) { } else if (s->status & Promptable_Stream_f) {
s->stream_putc = ConsolePutc; s->stream_putc = ConsolePutc;
s->stream_wputc = put_wchar; s->stream_wputc = put_wchar;
#if HAVE_LIBREADLINE #if HAVE_LIBREADLINE && HAVE_READLINE_READLINE_H
if (s->status & Tty_Stream_f) { if (s->status & Tty_Stream_f) {
s->stream_getc = ReadlineGetc; s->stream_getc = ReadlineGetc;
if (Stream[0].status & Tty_Stream_f && if (Stream[0].status & Tty_Stream_f &&
@ -1617,7 +1615,7 @@ PlUnGetc (int sno)
} else if (s->status & Promptable_Stream_f) { } else if (s->status & Promptable_Stream_f) {
s->stream_putc = ConsolePutc; s->stream_putc = ConsolePutc;
s->stream_wputc = put_wchar; s->stream_wputc = put_wchar;
#if HAVE_LIBREADLINE #if HAVE_LIBREADLINE && HAVE_READLINE_READLINE_H
if (s->status & Tty_Stream_f) { if (s->status & Tty_Stream_f) {
s->stream_getc = ReadlineGetc; s->stream_getc = ReadlineGetc;
if (Stream[0].status & Tty_Stream_f && if (Stream[0].status & Tty_Stream_f &&
@ -6288,7 +6286,7 @@ Yap_InitIOPreds(void)
Yap_InitSockets (); Yap_InitSockets ();
#endif #endif
InitPlIO (); InitPlIO ();
#if HAVE_LIBREADLINE #if HAVE_LIBREADLINE && HAVE_READLINE_READLINE_H
InitReadline(); InitReadline();
#endif #endif
} }

View File

@ -81,7 +81,10 @@ static char SccsId[] = "%W% %G%";
#include <sys/param.h> #include <sys/param.h>
#endif #endif
#endif #endif
#if HAVE_LIBREADLINE #if HAVE_FENV_H
#include <fenv.h>
#endif
#if HAVE_READLINE_READLINE_H
#include <readline/readline.h> #include <readline/readline.h>
#endif #endif
@ -1168,10 +1171,6 @@ STATIC_PROTO (void my_signal, (int, void (*)(int)));
*/ */
#if HAVE_FENV_H
#include <fenv.h>
#endif
static RETSIGTYPE static RETSIGTYPE
HandleMatherr(int sig) HandleMatherr(int sig)
{ {
@ -1520,7 +1519,7 @@ HandleSIGINT (int sig)
} }
if (Yap_PrologMode & (CritMode|ConsoleGetcMode)) { if (Yap_PrologMode & (CritMode|ConsoleGetcMode)) {
Yap_PrologMode |= InterruptMode; Yap_PrologMode |= InterruptMode;
#if HAVE_LIBREADLINE #if HAVE_LIBREADLINE && HAVE_READLINE_READLINE_H
if (Yap_PrologMode & ConsoleGetcMode) { if (Yap_PrologMode & ConsoleGetcMode) {
fprintf(stderr, "Action (h for help): "); fprintf(stderr, "Action (h for help): ");
rl_point = rl_end = 0; rl_point = rl_end = 0;