--- Term-ReadLine-Gnu-1.37/Gnu.xs 2021-02-10 14:43:45.000000000 +0000 +++ Term-ReadLine-Gnu-1.37/Gnu.xs 2021-02-10 14:52:23.067452779 +0000 @@ -29,6 +29,11 @@ #include #include +/* for tputs and tgetstr */ +#undef instr +#include +#include + /* * Perl 5.005 requires an ANSI C Compiler. Good news. * But I should still support legacy C compilers now. @@ -390,18 +395,17 @@ * utility/dummy functions */ /* from GNU Readline:xmalloc.h */ -#ifndef PTR_T -#ifdef __STDC__ -# define PTR_T void * -#else -# define PTR_T char * -#endif -#endif /* !PTR_T */ -/* from GNU Readline:xmalloc.c */ -extern PTR_T xmalloc PARAMS((int)); -extern char *tgetstr PARAMS((const char *, char **)); -extern int tputs PARAMS((const char *, int, int (*)(int))); +static void * +xmalloc(size_t n) +{ + void *p = malloc(n); + if (!p) { + perror("Term::ReadLine::Gnu: xmalloc"); + abort(); + } + return p; +} /* * Using xfree() in GNU Readline Library causes problem with Solaris @@ -410,13 +414,7 @@ * I choose this as default since some other OSs may have same problem. * usemymalloc=n is required. */ -static void -xfree (string) - PTR_T string; -{ - if (string) - free (string); -} +#define xfree(p) free(p) static char * dupstr(s) /* duplicate string */