From 1fea63429e83f3f9fa59152aa3a2cdbd8a8298d2 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Mon, 4 Dec 2017 11:53:19 +0900 Subject: Some OS uses `libedit` that does not provide `rl_free()`. `libedit` is a `readline` compatible library with BSD license. --- mrbgems/mruby-bin-mirb/tools/mirb/mirb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c b/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c index 4d01c1696..cdadf93c4 100644 --- a/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +++ b/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c @@ -19,7 +19,12 @@ #include #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() */ +#define MIRB_LINE_FREE(line) free(line) +#else #define MIRB_LINE_FREE(line) rl_free(line) +#endif #define MIRB_WRITE_HISTORY(path) write_history(path) #define MIRB_READ_HISTORY(path) read_history(path) #define MIRB_USING_HISTORY() using_history() -- cgit v1.2.3