From: Richard Kreckel Date: Thu, 3 May 2001 23:50:51 +0000 (+0000) Subject: * Fix incompatibilities with recent versions of libreadline by having X-Git-Tag: release_0-8-3~28 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=commitdiff_plain;h=965e7b0e744625df9b99d846194ff420faa92593;hp=0481215b4a7e4b6585033c98d52ce1e7e53fe954 * Fix incompatibilities with recent versions of libreadline by having configure find out the version and then doing ugly things with #ifdef. --- diff --git a/ginsh/ginsh_parser.yy b/ginsh/ginsh_parser.yy index b36e2ece..ee4e4360 100644 --- a/ginsh/ginsh_parser.yy +++ b/ginsh/ginsh_parser.yy @@ -44,7 +44,11 @@ // Original readline settings static int orig_completion_append_character; +#if (GINAC_RLVERSION_MAJOR < 4) || (GINAC_RLVERSION_MAJOR == 4 && GINAC_RLVERSION_MINOR < 2) static char *orig_basic_word_break_characters; +#else +static const char *orig_basic_word_break_characters; +#endif // Expression stack for ", "" and """ static void push(const ex &e); @@ -702,13 +706,21 @@ static char **fcn_completion(char *text, int start, int end) 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; +#if (GINAC_RLVERSION_MAJOR < 4) || (GINAC_RLVERSION_MAJOR == 4 && GINAC_RLVERSION_MINOR < 2) return completion_matches(text, (CPFunction *)filename_completion_function); +#else + return rl_completion_matches(text, (CPFunction *)rl_filename_completion_function); +#endif } else { // 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; +#if (GINAC_RLVERSION_MAJOR < 4) || (GINAC_RLVERSION_MAJOR == 4 && GINAC_RLVERSION_MINOR < 2) return completion_matches(text, (CPFunction *)fcn_generator); +#else + return rl_completion_matches(text, (CPFunction *)fcn_generator); +#endif } }