mirror of
https://github.com/lua/lua.git
synced 2026-10-26 18:45:25 +00:00
Cast in 'rl_readline_name'
In Mac OS, 'rl_readline_name' is declared as 'char*', instead of 'const char*', so we cannot assign to it a string literal such as "lua".
This commit is contained in:
@@ -465,7 +465,8 @@ static int handle_luainit (lua_State *L) {
|
||||
#include <readline/readline.h>
|
||||
#include <readline/history.h>
|
||||
|
||||
#define lua_initreadline(L) ((void)L, rl_readline_name="lua")
|
||||
#define lua_initreadline(L) \
|
||||
((void)L, *cast(const char **, &rl_readline_name)="lua")
|
||||
#define lua_readline(buff,prompt) ((void)buff, readline(prompt))
|
||||
#define lua_saveline(line) add_history(line)
|
||||
#define lua_freeline(line) free(line)
|
||||
|
||||
Reference in New Issue
Block a user