Skip to content

Commit 215a869

Browse files
committed
Merge pull request #15 from github/peff/readline
fix compilation against readline-6.3
2 parents ef85955 + 510aad5 commit 215a869

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

ext/readline/extconf.rb

+11
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ def readline.have_func(func)
1919
return super(func, headers)
2020
end
2121

22+
def readline.have_type(type)
23+
return super(type, headers)
24+
end
25+
2226
dir_config('curses')
2327
dir_config('ncurses')
2428
dir_config('termcap')
@@ -94,4 +98,11 @@ def readline.have_func(func)
9498
readline.have_func("rl_redisplay")
9599
readline.have_func("rl_insert_text")
96100
readline.have_func("rl_delete_text")
101+
unless readline.have_type("rl_hook_func_t*")
102+
# rl_hook_func_t is available since readline-4.2 (2001).
103+
# Function is removed at readline-6.3 (2014).
104+
# However, editline (NetBSD 6.1.3, 2014) doesn't have rl_hook_func_t.
105+
$defs << "-Drl_hook_func_t=Function"
106+
end
107+
97108
create_makefile("readline")

ext/readline/readline.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1974,7 +1974,7 @@ Init_readline()
19741974

19751975
rl_attempted_completion_function = readline_attempted_completion_function;
19761976
#if defined(HAVE_RL_PRE_INPUT_HOOK)
1977-
rl_pre_input_hook = (Function *)readline_pre_input_hook;
1977+
rl_pre_input_hook = (rl_hook_func_t *)readline_pre_input_hook;
19781978
#endif
19791979
#ifdef HAVE_RL_CATCH_SIGNALS
19801980
rl_catch_signals = 0;

0 commit comments

Comments
 (0)