summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-bin-mirb
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-12-08 21:49:12 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-12-08 21:49:12 +0900
commit550c8782162d319edcbaec3bfdeec2d269dfbdfc (patch)
tree73a4c385327b34e91933480a26faa609c4fbeb53 /mrbgems/mruby-bin-mirb
parente17092debda8eecb652916b8ba2a314e799dd96f (diff)
downloadmruby-550c8782162d319edcbaec3bfdeec2d269dfbdfc.tar.gz
mruby-550c8782162d319edcbaec3bfdeec2d269dfbdfc.zip
Use `RL_READLINE_VERSION` to determine `rl_free` existence; fix #3875
Diffstat (limited to 'mrbgems/mruby-bin-mirb')
-rw-r--r--mrbgems/mruby-bin-mirb/tools/mirb/mirb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c b/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
index cdadf93c4..2447601aa 100644
--- a/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
+++ b/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
@@ -19,8 +19,8 @@
#include <readline/history.h>
#define MIRB_ADD_HISTORY(line) add_history(line)
#define MIRB_READLINE(ch) readline(ch)
-#if defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__)
-/* libedit does not have rl_free() */
+#if !defined(RL_READLINE_VERSION) || RL_READLINE_VERSION < 0x600
+/* libedit & older readline do not have rl_free() */
#define MIRB_LINE_FREE(line) free(line)
#else
#define MIRB_LINE_FREE(line) rl_free(line)