From 089b72a0feab8c84df9d00c4c9f4072e36f2f129 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 14 Oct 2009 11:06:05 +0200 Subject: [PATCH] simplify some configury 2009-10-14 Paolo Bonzini * configure.ac: Remove obselete configure tests. * sed/fmt.c: Assume limits.h is always present. * sed/utils.c: Assume vfprintf is always present. --- ChangeLog | 6 ++++++ configure.ac | 13 +++++-------- sed/fmt.c | 13 +------------ sed/utils.c | 8 -------- 4 files changed, 12 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index 30d9fca..2f2d7f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-10-14 Paolo Bonzini + + * configure.ac: Remove obselete configure tests. + * sed/fmt.c: Assume limits.h is always present. + * sed/utils.c: Assume vfprintf is always present. + 2009-10-14 Yuri G. Kudryashov (tiny change) * testsuite/Makefile.tests: Override LC_ALL, not LANG. diff --git a/configure.ac b/configure.ac index 02548c9..fc1d3bd 100644 --- a/configure.ac +++ b/configure.ac @@ -43,25 +43,22 @@ if test "$sed_cv_libcp_needed" = yes; then LIBS="-lcP $LIBS" fi -AC_HEADER_DIRENT -AC_CHECK_HEADERS_ONCE(io.h limits.h locale.h stdarg.h alloca.h stddef.h - errno.h wchar.h wctype.h sys/file.h mcheck.h, [], [], - [AC_INCLUDES_DEFAULT]) +AC_CHECK_HEADERS_ONCE(locale.h errno.h wchar.h wctype.h mcheck.h, + [], [], [AC_INCLUDES_DEFAULT]) AC_C_CONST AC_TYPE_SIZE_T -AC_FUNC_VPRINTF AM_GNU_GETTEXT_VERSION(0.17) AM_GNU_GETTEXT([external]) -AC_CHECK_FUNCS_ONCE(isatty bcopy bzero isascii memcpy memset strchr strtoul +AC_CHECK_FUNCS_ONCE(isatty isascii memcpy strchr strtoul popen pathconf fchown fchmod setlocale) AC_ARG_ENABLE(i18n, [ --disable-i18n disable internationalization (default=enabled)], , enable_i18n=yes) if test "x$enable_i18n" = xno; then - ac_cv_func_wcscoll=false + ac_cv_func_wcscoll=no fi AC_ARG_ENABLE(regex-tests, @@ -85,7 +82,7 @@ if test "x$have_lstat" = xyes -a "x$have_readlink" = xyes; then fi # Determine whether we should run UTF-8 tests by checking if cyrillic -# letters are case-folded properly. The test for UTF-8 locales (bot +# letters are case-folded properly. The test for UTF-8 locales (both # in general and specifically for a Russian one) is a bit weak, but it # should match exactly what is done in the testsuite. In fact, sed's # logic is portable (though testing it requires care) so it is enough to diff --git a/sed/fmt.c b/sed/fmt.c index b2d2efb..2c1f250 100644 --- a/sed/fmt.c +++ b/sed/fmt.c @@ -23,18 +23,7 @@ #include #include #include - -#if HAVE_LIMITS_H -# include -#endif - -#ifndef UINT_MAX -# define UINT_MAX ((unsigned int) ~(unsigned int) 0) -#endif - -#ifndef INT_MAX -# define INT_MAX ((int) (UINT_MAX >> 1)) -#endif +#include /* The following parameters represent the program's idea of what is "best". Adjust to taste, subject to the caveats given. */ diff --git a/sed/utils.c b/sed/utils.c index 8c009e4..241ef1d 100644 --- a/sed/utils.c +++ b/sed/utils.c @@ -69,15 +69,7 @@ panic(const char *str, ...) fprintf(stderr, "%s: ", myname); va_start(ap, str); -#ifndef HAVE_VPRINTF -# ifndef HAVE_DOPRNT - fputs(str, stderr); /* not great, but perhaps better than nothing... */ -# else /* HAVE_DOPRNT */ - _doprnt(str, &ap, stderr); -# endif /* HAVE_DOPRNT */ -#else /* HAVE_VFPRINTF */ vfprintf(stderr, str, ap); -#endif /* HAVE_VFPRINTF */ va_end(ap); putc('\n', stderr);