Skip to content

Commit 3bb3220

Browse files
authored
Merge pull request #161 from pmhahn/readline
Fix build without readline
2 parents d68af0c + 20196bb commit 3bb3220

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

libdebugger/cmd.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ Boston, MA 02111-1307, USA. */
4646
/* The following line makes Solaris' gcc/cpp not puke. */
4747
#undef HAVE_READLINE_READLINE_H
4848
#include <readline/readline.h>
49+
#endif /* HAVE_LIBREADLINE */
4950

5051
/* From readline. ?? Should this be in configure? */
5152
#ifndef whitespace
5253
#define whitespace(c) (((c) == ' ') || ((c) == '\t'))
5354
#endif
54-
#endif /* HAVE_LIBREADLINE */
5555

5656
#include "cmd_initialize.h"
5757

@@ -79,8 +79,6 @@ char *psz_debugger_args;
7979

8080
debug_enter_reason_t last_stop_reason;
8181

82-
#ifdef HAVE_LIBREADLINE
83-
8482
short_cmd_t short_command[256] = { { NULL,
8583
(const char *) '\0',
8684
(const char *) '\0',
@@ -226,8 +224,6 @@ extern debug_return_t dbg_cmd_set_var (char *psz_args, int expand)
226224
return debug_readloop;
227225
}
228226

229-
#endif /* HAVE_LIBREADLINE */
230-
231227
#define PROMPT_LENGTH 300
232228

233229
#include <setjmp.h>
@@ -381,10 +377,14 @@ debug_return_t enter_debugger (target_stack_node_t *p,
381377

382378
if ( line ) {
383379
if ( *(s=stripwhite(line)) ) {
380+
#ifdef HAVE_LIBREADLINE
384381
add_history (s);
382+
#endif /* HAVE_LIBREADLINE */
385383
debug_return=execute_line(s);
386384
} else {
385+
#ifdef HAVE_LIBREADLINE
387386
add_history ("step");
387+
#endif /* HAVE_LIBREADLINE */
388388
debug_return=dbg_cmd_step((char *) "");
389389
}
390390
free (line);

libdebugger/command/set.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ Boston, MA 02111-1307, USA. */
4646
/* The following line makes Solaris' gcc/cpp not puke. */
4747
#undef HAVE_READLINE_READLINE_H
4848
#include <readline/readline.h>
49+
#endif /* HAVE_LIBREADLINE */
4950

5051
/* From readline. ?? Should this be in configure? */
5152
#ifndef whitespace
5253
#define whitespace(c) (((c) == ' ') || ((c) == '\t'))
5354
#endif
54-
#endif /* HAVE_LIBREADLINE */
5555

5656
subcommand_var_info_t set_subcommands[] = {
5757
{ "basename",

0 commit comments

Comments
 (0)