Skip to content

Instantly share code, notes, and snippets.

@judofyr
Created April 22, 2014 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save judofyr/11175629 to your computer and use it in GitHub Desktop.
Save judofyr/11175629 to your computer and use it in GitHub Desktop.
Patch for Ruby 2.1.1
ruby-install -p https://gist.githubusercontent.com/judofyr/11175629/raw/2f22144e3ca261e9e989fcb9a205b473c208007f/patch.diff ruby 2.1.1
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -1974,7 +1974,7 @@
rl_attempted_completion_function = readline_attempted_completion_function;
#if defined(HAVE_RL_PRE_INPUT_HOOK)
- rl_pre_input_hook = (Function *)readline_pre_input_hook;
+ rl_pre_input_hook = (rl_hook_func_t *)readline_pre_input_hook;
#endif
#ifdef HAVE_RL_CATCH_SIGNALS
rl_catch_signals = 0;
diff --git a/ext/readline/extconf.rb b/ext/readline/extconf.rb
--- a/ext/readline/extconf.rb
+++ b/ext/readline/extconf.rb
@@ -19,6 +19,10 @@
return super(func, headers)
end
+def readline.have_type(type)
+ return super(type, headers)
+end
+
dir_config('curses')
dir_config('ncurses')
dir_config('termcap')
@@ -94,4 +98,8 @@
readline.have_func("rl_redisplay")
readline.have_func("rl_insert_text")
readline.have_func("rl_delete_text")
+unless readline.have_type("rl_hook_func_t")
+ $DEFS << "-Drl_hook_func_t=Function"
+end
+
create_makefile("readline")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment