Use `RL_READLINE_VERSION` to determine `rl_free` existence; fix #3875

parent e17092de
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment