From de5a09039f3209ae777b77f331cd91837d54d06c Mon Sep 17 00:00:00 2001 From: Costa Vitor Date: Mon, 15 Jun 2009 14:59:50 -0500 Subject: [PATCH] no_readline patches avoid warnings in no_gmp world avoid complaining by Solaris --- C/cmppreds.c | 2 +- C/iopreds.c | 22 ++++++++++------------ C/sysbits.c | 11 +++++------ 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/C/cmppreds.c b/C/cmppreds.c index eb9e9ef89..a27496cbc 100644 --- a/C/cmppreds.c +++ b/C/cmppreds.c @@ -583,8 +583,8 @@ a_cmp(Term t1, Term t2) } else { return FALSE; } - } else if (IsBigIntTerm(t1)) { #ifdef USE_GMP + } else if (IsBigIntTerm(t1)) { { MP_INT *b1 = Yap_BigIntOfTerm(t1); t2 = Yap_Eval(t2); diff --git a/C/iopreds.c b/C/iopreds.c index 943d6afcc..7a319580e 100644 --- a/C/iopreds.c +++ b/C/iopreds.c @@ -117,7 +117,7 @@ STATIC_PROTO (int ConsolePipeGetc, (int)); STATIC_PROTO (int SocketGetc, (int)); STATIC_PROTO (int ConsoleSocketGetc, (int)); #endif -#if HAVE_LIBREADLINE +#if HAVE_LIBREADLINE && HAVE_READLINE_READLINE_H STATIC_PROTO (int ReadlineGetc, (int)); STATIC_PROTO (int ReadlinePutc, (int,int)); #endif @@ -247,7 +247,7 @@ Yap_GetFreeStreamDForReading(void) static int yap_fflush(int sno) { -#if HAVE_LIBREADLINE +#if HAVE_LIBREADLINE && HAVE_READLINE_READLINE_H if (Stream[sno].status & Tty_Stream_f && Stream[sno].status & Output_Stream_f) { if (ReadlinePos != ReadlineBuf) { @@ -349,7 +349,7 @@ p_always_prompt_user(void) s->stream_getc = ConsoleSocketGetc; } else #endif -#if HAVE_LIBREADLINE +#if HAVE_LIBREADLINE && HAVE_READLINE_READLINE_H if (s->status & Tty_Stream_f) { s->stream_getc = ReadlineGetc; if (Stream[0].status & Tty_Stream_f && @@ -412,7 +412,7 @@ InitFileIO(StreamDesc *s) s->stream_putc = ConsolePutc; s->stream_wputc = put_wchar; /* 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 (Stream[0].status & Tty_Stream_f && is_same_tty(s->u.file.file,Stream[0].u.file.file)) @@ -990,12 +990,10 @@ p_prompt (void) return (TRUE); } -#if HAVE_LIBREADLINE +#if HAVE_LIBREADLINE && HAVE_READLINE_READLINE_H -#if HAVE_READLINE_READLINE_H #include #include -#endif static char *ttyptr = NULL; @@ -1130,7 +1128,7 @@ ReadlineGetc(int sno) static Int p_has_readline(void) { -#if HAVE_LIBREADLINE +#if HAVE_LIBREADLINE && HAVE_READLINE_READLINE_H return TRUE; #else return FALSE; @@ -1142,7 +1140,7 @@ int Yap_GetCharForSIGINT(void) { int ch; -#if HAVE_LIBREADLINE +#if HAVE_LIBREADLINE && HAVE_READLINE_READLINE_H if ((Yap_PrologMode & ConsoleGetcMode) && myrl_line != (char *) NULL) { ch = myrl_line[0]; free(myrl_line); @@ -1209,7 +1207,7 @@ EOFGetc(int sno) } else if (s->status & Promptable_Stream_f) { s->stream_putc = ConsolePutc; s->stream_wputc = put_wchar; -#if HAVE_LIBREADLINE +#if HAVE_LIBREADLINE && HAVE_READLINE_READLINE_H if (s->status & Tty_Stream_f) { s->stream_getc = ReadlineGetc; if (Stream[0].status & Tty_Stream_f && @@ -1617,7 +1615,7 @@ PlUnGetc (int sno) } else if (s->status & Promptable_Stream_f) { s->stream_putc = ConsolePutc; s->stream_wputc = put_wchar; -#if HAVE_LIBREADLINE +#if HAVE_LIBREADLINE && HAVE_READLINE_READLINE_H if (s->status & Tty_Stream_f) { s->stream_getc = ReadlineGetc; if (Stream[0].status & Tty_Stream_f && @@ -6288,7 +6286,7 @@ Yap_InitIOPreds(void) Yap_InitSockets (); #endif InitPlIO (); -#if HAVE_LIBREADLINE +#if HAVE_LIBREADLINE && HAVE_READLINE_READLINE_H InitReadline(); #endif } diff --git a/C/sysbits.c b/C/sysbits.c index ae524c875..8bfd54337 100644 --- a/C/sysbits.c +++ b/C/sysbits.c @@ -81,7 +81,10 @@ static char SccsId[] = "%W% %G%"; #include #endif #endif -#if HAVE_LIBREADLINE +#if HAVE_FENV_H +#include +#endif +#if HAVE_READLINE_READLINE_H #include #endif @@ -1168,10 +1171,6 @@ STATIC_PROTO (void my_signal, (int, void (*)(int))); */ -#if HAVE_FENV_H -#include -#endif - static RETSIGTYPE HandleMatherr(int sig) { @@ -1520,7 +1519,7 @@ HandleSIGINT (int sig) } if (Yap_PrologMode & (CritMode|ConsoleGetcMode)) { Yap_PrologMode |= InterruptMode; -#if HAVE_LIBREADLINE +#if HAVE_LIBREADLINE && HAVE_READLINE_READLINE_H if (Yap_PrologMode & ConsoleGetcMode) { fprintf(stderr, "Action (h for help): "); rl_point = rl_end = 0;