configuration changes to remove obsolete autoconf macros, and resultant changes to some source files

This commit is contained in:
Chet Ramey
2021-09-08 11:16:55 -04:00
parent 2208813a97
commit a67031fe11
20 changed files with 7303 additions and 5895 deletions
+15 -14
View File
@@ -26,9 +26,6 @@
#if defined (HAVE_CONFIG_H)
# if defined (HAVE_STRING_H)
# if ! defined (STDC_HEADERS) && defined (HAVE_MEMORY_H)
# include <memory.h>
# endif
# include <string.h>
# endif /* HAVE_STRING_H */
# if defined (HAVE_STRINGS_H)
@@ -66,22 +63,26 @@
#define UNMETA(c) ((c) & (~meta_character_bit))
#define UNCTRL(c) _rl_to_upper(((c)|control_character_bit))
#if defined STDC_HEADERS || (!defined (isascii) && !defined (HAVE_ISASCII))
#ifndef UCHAR_MAX
# define UCHAR_MAX 255
#endif
#ifndef CHAR_MAX
# define CHAR_MAX 127
#endif
/* use this as a proxy for C89 */
#if defined (HAVE_STDLIB_H) && defined (HAVE_STRING_H)
# define IN_CTYPE_DOMAIN(c) 1
# define NON_NEGATIVE(c) 1
#else
# define IN_CTYPE_DOMAIN(c) isascii(c)
# define IN_CTYPE_DOMAIN(c) ((c) >= 0 && (c) <= CHAR_MAX)
# define NON_NEGATIVE(c) ((unsigned char)(c) == (c))
#endif
#if !defined (isxdigit) && !defined (HAVE_ISXDIGIT) && !defined (__cplusplus)
# define isxdigit(c) (isdigit((unsigned char)(c)) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
#endif
#if defined (CTYPE_NON_ASCII)
# define NON_NEGATIVE(c) 1
#else
# define NON_NEGATIVE(c) ((unsigned char)(c) == (c))
#endif
/* Some systems define these; we want our definitions. */
#undef ISPRINT
@@ -99,12 +100,12 @@
#define _rl_uppercase_p(c) (NON_NEGATIVE(c) && ISUPPER(c))
#define _rl_digit_p(c) ((c) >= '0' && (c) <= '9')
#define _rl_alphabetic_p(c) (NON_NEGATIVE(c) && ISALNUM(c))
#define _rl_pure_alphabetic(c) (NON_NEGATIVE(c) && ISALPHA(c))
#define ALPHABETIC(c) (NON_NEGATIVE(c) && ISALNUM(c))
#ifndef _rl_to_upper
# define _rl_to_upper(c) (_rl_lowercase_p(c) ? toupper((unsigned char)c) : (c))
# define _rl_to_lower(c) (_rl_uppercase_p(c) ? tolower((unsigned char)c) : (c))
# define _rl_to_upper(c) (_rl_lowercase_p(c) ? toupper((unsigned char)(c)) : (c))
# define _rl_to_lower(c) (_rl_uppercase_p(c) ? tolower((unsigned char)(c)) : (c))
#endif
#ifndef _rl_digit_value
+8 -20
View File
@@ -48,23 +48,11 @@
#if defined (HANDLE_SIGNALS)
#if !defined (RETSIGTYPE)
# if defined (VOID_SIGHANDLER)
# define RETSIGTYPE void
# else
# define RETSIGTYPE int
# endif /* !VOID_SIGHANDLER */
#endif /* !RETSIGTYPE */
#if defined (VOID_SIGHANDLER)
# define SIGHANDLER_RETURN return
#else
# define SIGHANDLER_RETURN return (0)
#endif
#define SIGHANDLER_RETURN return
/* This typedef is equivalent to the one for Function; it allows us
to say SigHandler *foo = signal (SIGKILL, SIG_IGN); */
typedef RETSIGTYPE SigHandler (int);
typedef void SigHandler (int);
#if defined (HAVE_POSIX_SIGNALS)
typedef struct sigaction sighandler_cxt;
@@ -82,8 +70,8 @@ static SigHandler *rl_set_sighandler (int, SigHandler *, sighandler_cxt *);
static void rl_maybe_set_sighandler (int, SigHandler *, sighandler_cxt *);
static void rl_maybe_restore_sighandler (int, sighandler_cxt *);
static RETSIGTYPE rl_signal_handler (int);
static RETSIGTYPE _rl_handle_signal (int);
static void rl_signal_handler (int);
static void _rl_handle_signal (int);
/* Exported variables for use by applications. */
@@ -136,7 +124,7 @@ void *_rl_sigcleanarg;
/* Readline signal handler functions. */
/* Called from RL_CHECK_SIGNALS() macro to run signal handling code. */
RETSIGTYPE
void
_rl_signal_handler (int sig)
{
_rl_caught_signal = 0; /* XXX */
@@ -163,7 +151,7 @@ _rl_signal_handler (int sig)
SIGHANDLER_RETURN;
}
static RETSIGTYPE
static void
rl_signal_handler (int sig)
{
_rl_caught_signal = sig;
@@ -173,7 +161,7 @@ rl_signal_handler (int sig)
/* This is called to handle a signal when it is safe to do so (out of the
signal handler execution path). Called by _rl_signal_handler for all the
signals readline catches except SIGWINCH. */
static RETSIGTYPE
static void
_rl_handle_signal (int sig)
{
int block_sig;
@@ -315,7 +303,7 @@ _rl_handle_signal (int sig)
}
#if defined (SIGWINCH)
static RETSIGTYPE
static void
rl_sigwinch_handler (int sig)
{
SigHandler *oh;
+1 -1
View File
@@ -72,7 +72,7 @@ static const char * const pathname_alphabetic_chars = "/-_=~.#$";
int
rl_alphabetic (int c)
{
if (ALPHABETIC (c))
if (_rl_alphabetic_p (c))
return (1);
return (_rl_allow_pathname_alphabetic_chars &&
-5
View File
@@ -48,12 +48,7 @@ sh_setlinebuf (stream)
#endif
#if defined (HAVE_SETVBUF)
# if defined (SETVBUF_REVERSED)
return (setvbuf (stream, _IOLBF, local_linebuf, LBUF_BUFSIZE));
# else /* !SETVBUF_REVERSED */
return (setvbuf (stream, local_linebuf, _IOLBF, LBUF_BUFSIZE));
# endif /* !SETVBUF_REVERSED */
# else /* !HAVE_SETVBUF */
setlinebuf (stream);
+3 -6
View File
@@ -59,16 +59,13 @@
*/
#include <config.h>
#include <sys/types.h>
#include <stdio.h>
#include <ctype.h>
#include <time.h>
#include <posixtime.h>
#include <errno.h>
#if defined(TM_IN_SYS_TIME)
#include <sys/types.h>
#include <sys/time.h>
#endif
#include <stdlib.h>
#include <string.h>
+5 -2
View File
@@ -52,15 +52,18 @@ extern char *realloc ();
#else /* not HAVE_CONFIG_H */
#ifdef STDC_HEADERS
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#include <string.h>
#else
char *getenv ();
char *malloc ();
char *realloc ();
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
/* Do this after the include, in case string.h prototypes bcopy. */
#if (defined(HAVE_STRING_H) || defined(STDC_HEADERS)) && !defined(bcopy)
#define bcopy(s, d, n) memcpy ((d), (s), (n))