diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-12-04 11:53:19 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-12-04 11:53:19 +0900 |
| commit | 1fea63429e83f3f9fa59152aa3a2cdbd8a8298d2 (patch) | |
| tree | 85189e1850f2fe2838a4dce74c9f42a3db9bae75 | |
| parent | 0b5d97ec4220c8a85eccfba427b6fb818a543b77 (diff) | |
| download | mruby-1fea63429e83f3f9fa59152aa3a2cdbd8a8298d2.tar.gz mruby-1fea63429e83f3f9fa59152aa3a2cdbd8a8298d2.zip | |
Some OS uses `libedit` that does not provide `rl_free()`.
`libedit` is a `readline` compatible library with BSD license.
| -rw-r--r-- | mrbgems/mruby-bin-mirb/tools/mirb/mirb.c | 5 |
1 files changed, 5 insertions, 0 deletions
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 <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() */ +#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() |
