X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginsh%2Fginsh_parser.yy;h=a93808e8a0c12838c0ed1e6ba12b235d5ec388e9;hp=447d70868b431c030741354f5e0a554d147bff92;hb=4b70436fd4b5d1059636b34844a5c3737af628b2;hpb=ba0b56c5ac76274c5d748eaa29fbd83cb1d4fb9e;ds=sidebyside diff --git a/ginsh/ginsh_parser.yy b/ginsh/ginsh_parser.yy index 447d7086..a93808e8 100644 --- a/ginsh/ginsh_parser.yy +++ b/ginsh/ginsh_parser.yy @@ -50,6 +50,12 @@ static char *orig_basic_word_break_characters; static const char *orig_basic_word_break_characters; #endif +#if (GINAC_RL_VERSION_MAJOR >= 5) +#define GINAC_RL_COMPLETER_CAST(a) const_cast((a)) +#else +#define GINAC_RL_COMPLETER_CAST(a) (a) +#endif + // Expression stack for %, %% and %%% static void push(const ex &e); static ex exstack[3]; @@ -817,7 +823,7 @@ static char **fcn_completion(const char *text, int start, int end) // For shell commands, revert back to filename completion rl_completion_append_character = orig_completion_append_character; rl_basic_word_break_characters = orig_basic_word_break_characters; - rl_completer_word_break_characters = rl_basic_word_break_characters; + rl_completer_word_break_characters = GINAC_RL_COMPLETER_CAST(rl_basic_word_break_characters); #if (GINAC_RL_VERSION_MAJOR < 4) || (GINAC_RL_VERSION_MAJOR == 4 && GINAC_RL_VERSION_MINOR < 2) return completion_matches(const_cast(text), (CPFunction *)filename_completion_function); #else @@ -827,7 +833,7 @@ static char **fcn_completion(const char *text, int start, int end) // Otherwise, complete function names rl_completion_append_character = '('; rl_basic_word_break_characters = " \t\n\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~"; - rl_completer_word_break_characters = rl_basic_word_break_characters; + rl_completer_word_break_characters = GINAC_RL_COMPLETER_CAST(rl_basic_word_break_characters); #if (GINAC_RL_VERSION_MAJOR < 4) || (GINAC_RL_VERSION_MAJOR == 4 && GINAC_RL_VERSION_MINOR < 2) return completion_matches(const_cast(text), (CPFunction *)fcn_generator); #else