diff options
author | jaortega <jaortega> | 2001-03-22 02:33:58 +0000 |
---|---|---|
committer | jaortega <jaortega> | 2001-03-22 02:33:58 +0000 |
commit | 2ca96c58673afb1df494ae5b5b00256c140ce3d6 (patch) | |
tree | 7e70b3fe75884c837b7e674a13d3e08e1268f233 /mixutils/mixvm_loop.c | |
parent | 92e00ea7d9a1aa5b202495e993c5e69915c4ffee (diff) | |
download | mdk-2ca96c58673afb1df494ae5b5b00256c140ce3d6.tar.gz mdk-2ca96c58673afb1df494ae5b5b00256c140ce3d6.tar.bz2 |
minor changes
Diffstat (limited to 'mixutils/mixvm_loop.c')
-rw-r--r-- | mixutils/mixvm_loop.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/mixutils/mixvm_loop.c b/mixutils/mixvm_loop.c index 8a571d8..a565832 100644 --- a/mixutils/mixvm_loop.c +++ b/mixutils/mixvm_loop.c @@ -20,13 +20,33 @@ */ +#define _GNU_SOURCE 1 +#include <stdio.h> #include <mixlib/mix.h> -#include <stdio.h> -#include <readline/readline.h> -#include <readline/history.h> #include "mixvm_command.h" +#ifdef HAVE_LIBHISTORY +# include <readline/history.h> +#else +# define add_history(x) ((void)0) +#endif + +#ifdef HAVE_LIBREADLINE +# include <readline/readline.h> +#else /* !HAVE_LIBREADLINE */ +static char * +readline (char *prompt) +{ + char *line = NULL; + size_t s = 0; + + printf ("%s", prompt); + getline (&line, &s, stdin); + return line; +} +#endif /* HAVE_LIBREADLINE */ + /* A static variable for holding the line. */ static char *line_read = (char *)NULL; static const char *PROMPT = N_("MIX > "); |