* Fix incompatibilities with recent versions of libreadline by having
[ginac.git] / ginsh / ginsh_parser.yy
index b36e2ece3e0919779bc0f1e1ba0e79d6f223b644..ee4e4360c161eb17db53a43e8289c4e37da97506 100644 (file)
 
 // 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
        }
 }