* Fix incompatibilities with recent versions of libreadline by having
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Thu, 3 May 2001 23:50:51 +0000 (23:50 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Thu, 3 May 2001 23:50:51 +0000 (23:50 +0000)
  configure find out the version and then doing ugly things with #ifdef.

ginsh/ginsh_parser.yy

index b36e2ec..ee4e436 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
        }
 }