OSDN Git Service

Why can't everyone be standard? :(
authorMarc G. Fournier <scrappy@hub.org>
Sat, 25 Jan 1997 22:16:43 +0000 (22:16 +0000)
committerMarc G. Fournier <scrappy@hub.org>
Sat, 25 Jan 1997 22:16:43 +0000 (22:16 +0000)
Add some code to make psql happy with a system where there is *no*
history code available, but there is readline code...

src/bin/psql/psql.c
src/include/config.h

index 409705b..8df0998 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.51 1997/01/25 21:58:08 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.52 1997/01/25 22:16:36 scrappy Exp $
  *
  *-------------------------------------------------------------------------
  */
 #else
 # ifdef HAVE_READLINE_H
 #  include <readline.h>
-#  ifdef HAVE_HISTORY_H
+#  ifndef NO_HISTORY
 #   include <history.h>
 #  endif
 # else
 #  include <readline/readline.h>
-#  ifdef HAVE_READLINE_HISTORY_H
+#  ifndef NO_HISTORY
 #   include <readline/history.h>
 #  endif
 # endif
index fd74b27..f34189e 100644 (file)
 /* #undef HAVE_HISTORY_H */
 /* #undef HAVE_READLINE_HISTORY_H */
 
+/* this is meant to handle the condition where the system has readline
+ * capabilities, but no history.  Unfortunately, it isn't as simple as
+ * testing for the existance of -lhistory, since newer -lreadline seems to
+ * include the -lhistory library, but newer readline.h doesn't
+ */
+#if defined(HAVE_LIBREADLINE)
+# if !defined(HAVE_HISTORY_H) || !defined(HAVE_READLINE_HISTORY_H)
+#   define NO_HISTORY_H
+# endif
+#endif
 
 #define HAVE_SYS_SELECT_H
 #define HAVE_TERMIOS_H