From 6c977786187b4287c53c3df1de2a20df89feab72 Mon Sep 17 00:00:00 2001 From: yugui Date: Wed, 12 Jan 2011 07:26:15 +0000 Subject: * ext/readline/extconf.rb: new checks for RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE. [ruby-core:34331] * ext/readline/readline.c: enables USE_INSERT_IGNORE_ESCAPE only if RL_PROMPT_{START,END}_IGNORE are available to get rid of compilation error with libedit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/readline/extconf.rb | 6 ++++++ ext/readline/readline.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'ext/readline') diff --git a/ext/readline/extconf.rb b/ext/readline/extconf.rb index efce64345a..59c2a8e95d 100644 --- a/ext/readline/extconf.rb +++ b/ext/readline/extconf.rb @@ -19,6 +19,10 @@ def have_readline_func(func) return have_func(func, $readline_headers) end +def have_readline_macro(macro) + return have_macro(macro, $readline_headers) +end + dir_config('curses') dir_config('ncurses') dir_config('termcap') @@ -79,4 +83,6 @@ have_readline_func("rl_emacs_editing_mode") have_readline_func("replace_history_entry") have_readline_func("remove_history") have_readline_func("clear_history") +have_readline_macro("RL_PROMPT_START_IGNORE") +have_readline_macro("RL_PROMPT_END_IGNORE") create_makefile("readline") diff --git a/ext/readline/readline.c b/ext/readline/readline.c index 4e530be194..8236d5a5f1 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -44,7 +44,7 @@ static VALUE mReadline; #define EDIT_LINE_LIBRARY_VERSION "EditLine wrapper" #ifndef USE_INSERT_IGNORE_ESCAPE -# ifndef HAVE_EDITLINE_READLINE_H +# if !defined(HAVE_EDITLINE_READLINE_H) && defined(HAVE_RL_PROMPT_START_IGNORE) && defined(HAVE_RL_PROMPT_END_IGNORE) # define USE_INSERT_IGNORE_ESCAPE 1 # else # define USE_INSERT_IGNORE_ESCAPE 0 -- cgit v1.2.3