From: Bruno Haible Date: Wed, 12 Jan 2005 12:58:56 +0000 (+0000) Subject: Update 'error' module from gnulib. X-Git-Tag: v0.14.2~169 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b1f56d44bdd167ca4fcb19981d8af90663cf556;p=thirdparty%2Fgettext.git Update 'error' module from gnulib. --- diff --git a/gettext-runtime/ChangeLog b/gettext-runtime/ChangeLog index 8e9dd40fc..58aa37b90 100644 --- a/gettext-runtime/ChangeLog +++ b/gettext-runtime/ChangeLog @@ -1,3 +1,9 @@ +2005-01-06 Bruno Haible + + * configure.ac: Invoke gl_ERROR instead of gt_FUNC_ERROR_AT_LINE. + * Makefile.am (config.h_vms, config.h.msvc): Remove setting of + HAVE_DECL_STRERROR. + 2005-01-06 Bruno Haible * configure.ac: Invoke gl_GETOPT. diff --git a/gettext-runtime/Makefile.am b/gettext-runtime/Makefile.am index 3f4d93f7f..23f10e036 100644 --- a/gettext-runtime/Makefile.am +++ b/gettext-runtime/Makefile.am @@ -48,7 +48,6 @@ config.h_vms: config.h.in ../version.sh (echo '#define KEEP_CRTL_SETLOCALE 1'; echo '#include '; echo '#undef realpath'; \ sed -e 's/#undef ENABLE_NLS$$/#define ENABLE_NLS 1/' \ -e 's/#undef HAVE_ALLOCA$$/#define HAVE_ALLOCA 1/' \ - -e 's/#undef HAVE_DECL_STRERROR$$/#define HAVE_DECL_STRERROR 1/' \ -e 's/#undef HAVE_DLFCN_H$$/#define HAVE_DLFCN_H 1/' \ -e 's/#undef HAVE_ERRNO_DECL$$/#define HAVE_ERRNO_DECL 1/' \ -e 's/#undef HAVE_GETCWD$$/#define HAVE_GETCWD 1/' \ diff --git a/gettext-runtime/configure.ac b/gettext-runtime/configure.ac index b3ca8068c..2a6296304 100644 --- a/gettext-runtime/configure.ac +++ b/gettext-runtime/configure.ac @@ -90,7 +90,7 @@ gl_GETOPT gt_FUNC_SETENV gl_FUNC_STRERROR gl_FUNC_GLIBC_UNLOCKED_IO -gt_FUNC_ERROR_AT_LINE +gl_ERROR gl_PATHMAX gl_FUNC_READLINK gl_XREADLINK diff --git a/gettext-runtime/lib/ChangeLog b/gettext-runtime/lib/ChangeLog index c6f22f3d9..eb1a68aaf 100644 --- a/gettext-runtime/lib/ChangeLog +++ b/gettext-runtime/lib/ChangeLog @@ -1,3 +1,10 @@ +2005-01-06 Bruno Haible + + * Makefile.am (libgrt_a_SOURCES): Remove error.h, error.c. + (LIBADD_SOURCE): Add error.h, error.c here. + * error.h: New file. + * error.c: New file. + 2005-01-06 Bruno Haible * Makefile.am (libgrt_a_SOURCES): Remove getopt files. diff --git a/gettext-runtime/lib/Makefile.am b/gettext-runtime/lib/Makefile.am index 87e4de8f4..56c902d54 100644 --- a/gettext-runtime/lib/Makefile.am +++ b/gettext-runtime/lib/Makefile.am @@ -29,7 +29,6 @@ noinst_LIBRARIES = libgrt.a libgrt_a_SOURCES = \ ../../gettext-tools/lib/basename.h ../../gettext-tools/lib/basename.c \ ../../gettext-tools/lib/closeout.h ../../gettext-tools/lib/closeout.c \ - ../../gettext-tools/lib/error.h ../../gettext-tools/lib/error.c \ ../../gettext-tools/lib/exit.h \ ../../gettext-tools/lib/fwriteerror.h ../../gettext-tools/lib/fwriteerror.c \ ../../gettext-tools/lib/pathmax.h \ @@ -44,6 +43,7 @@ libgrt_a_SOURCES = \ LIBADD_SOURCE = \ atexit.c \ ../../gettext-tools/lib/canonicalize.h canonicalize.c \ + error.h error.c \ getopt.c getopt1.c ../../gettext-tools/lib/getopt_int.h \ memmove.c \ readlink.c \ diff --git a/gettext-tools/ChangeLog b/gettext-tools/ChangeLog index b78085806..86abc0bcc 100644 --- a/gettext-tools/ChangeLog +++ b/gettext-tools/ChangeLog @@ -1,3 +1,9 @@ +2005-01-06 Bruno Haible + + * configure.ac: Invoke gl_ERROR instead of gt_FUNC_ERROR_AT_LINE. + * Makefile.am (config.h_vms, config.h.msvc): Remove setting of + HAVE_DECL_STRERROR. + 2005-01-06 Bruno Haible * configure.ac: Invoke gl_QUOTE. diff --git a/gettext-tools/Makefile.am b/gettext-tools/Makefile.am index 3c44e5470..caa7b6f1b 100644 --- a/gettext-tools/Makefile.am +++ b/gettext-tools/Makefile.am @@ -48,7 +48,6 @@ config.h_vms: config.h.in ../version.sh -e 's/#undef HAVE_BTOWC$$/#define HAVE_BTOWC 1/' \ -e 's/#undef HAVE_CHOWN$$/#define HAVE_CHOWN 1/' \ -e 's/#undef HAVE_DECL_GETENV$$/#define HAVE_DECL_GETENV 1/' \ - -e 's/#undef HAVE_DECL_STRERROR$$/#define HAVE_DECL_STRERROR 1/' \ -e 's/#undef HAVE_DECL_WCWIDTH$$/#define HAVE_DECL_WCWIDTH 1/' \ -e 's/#undef HAVE_DIRENT_H$$/#define HAVE_DIRENT_H 1/' \ -e 's/#undef HAVE_DLFCN_H$$/#define HAVE_DLFCN_H 1/' \ diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac index a094db3cf..0b574cc48 100644 --- a/gettext-tools/configure.ac +++ b/gettext-tools/configure.ac @@ -142,7 +142,7 @@ gt_SIGINFO gt_FUNC_SETENV gl_FUNC_STRERROR gl_FUNC_GLIBC_UNLOCKED_IO -gt_FUNC_ERROR_AT_LINE +gl_ERROR gl_QUOTEARG gl_QUOTE gl_PATHMAX diff --git a/gettext-tools/lib/ChangeLog b/gettext-tools/lib/ChangeLog index dda3cc554..166e032fe 100644 --- a/gettext-tools/lib/ChangeLog +++ b/gettext-tools/lib/ChangeLog @@ -1,3 +1,12 @@ +2005-01-06 Bruno Haible + + * error.h: Update from gnulib. + * error.c: Update from gnulib. + * Makefile.am (libgettextlib_la_SOURCES): Remove error.h, error.c. + (LIBADD_SOURCE): Add error.h, error.c here. + * Makefile.msvc: Update. + * Makefile.vms: Update. + 2005-01-06 Bruno Haible * argmatch.h: Update from gnulib, with DLL_VARIABLE modifications. diff --git a/gettext-tools/lib/Makefile.am b/gettext-tools/lib/Makefile.am index ffa08123b..8e60915af 100644 --- a/gettext-tools/lib/Makefile.am +++ b/gettext-tools/lib/Makefile.am @@ -43,7 +43,6 @@ libgettextlib_la_SOURCES = \ copy-file.h copy-file.c \ csharpcomp.h csharpcomp.c \ csharpexec.h csharpexec.c \ - error.h error.c \ error-progname.h error-progname.c \ execute.h execute.c w32spawn.h \ exit.h \ @@ -88,6 +87,7 @@ libgettextlib_la_SOURCES = \ LIBADD_SOURCE = \ atexit.c \ canonicalize.h canonicalize.c \ + error.h error.c \ fnmatch.c \ getline.h getline.c \ getndelim2.h getndelim2.c \ diff --git a/gettext-tools/lib/Makefile.msvc b/gettext-tools/lib/Makefile.msvc index 3ad625913..812f13e4c 100644 --- a/gettext-tools/lib/Makefile.msvc +++ b/gettext-tools/lib/Makefile.msvc @@ -90,7 +90,6 @@ OBJECTS = \ copy-file.obj \ csharpcomp.obj \ csharpexec.obj \ - error.obj \ error-progname.obj \ execute.obj \ exitfail.obj \ @@ -123,6 +122,7 @@ OBJECTS = \ xerror.obj \ xsetenv.obj \ \ + error.obj \ fnmatch.obj \ getline.obj \ getndelim2.obj \ @@ -171,9 +171,6 @@ csharpcomp.obj : csharpcomp.c csharpexec.obj : csharpexec.c $(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c csharpexec.c -error.obj : error.c - $(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c error.c - error-progname.obj : error-progname.c $(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c error-progname.c @@ -273,6 +270,9 @@ xerror.obj : xerror.c xsetenv.obj : xsetenv.c $(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c xsetenv.c +error.obj : error.c + $(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c error.c + fnmatch.obj : fnmatch.c $(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c fnmatch.c diff --git a/gettext-tools/lib/Makefile.vms b/gettext-tools/lib/Makefile.vms index 4b7cd4d02..96a02d5ad 100644 --- a/gettext-tools/lib/Makefile.vms +++ b/gettext-tools/lib/Makefile.vms @@ -48,7 +48,6 @@ OBJECTS = \ copy-file.obj, \ csharpcomp.obj, \ csharpexec.obj, \ - error.obj, \ error-progname.obj, \ execute.obj, \ exitfail.obj, \ @@ -81,6 +80,7 @@ OBJECTS = \ xerror.obj, \ xsetenv.obj, \ \ + error.obj, \ fnmatch.obj, \ getline.obj, \ getndelim2.obj, \ @@ -132,9 +132,6 @@ csharpcomp.obj : csharpcomp.c,alloca.h csharpexec.obj : csharpexec.c,alloca.h $(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) csharpexec.c -error.obj : error.c - $(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) error.c - error-progname.obj : error-progname.c $(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) error-progname.c @@ -234,6 +231,9 @@ xerror.obj : xerror.c xsetenv.obj : xsetenv.c $(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) xsetenv.c +error.obj : error.c + $(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) error.c + fnmatch.obj : fnmatch.c fnmatch.h fnmatch_loop.c $(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) fnmatch.c diff --git a/gettext-tools/lib/error.c b/gettext-tools/lib/error.c index 2c8845769..6b3662d61 100644 --- a/gettext-tools/lib/error.c +++ b/gettext-tools/lib/error.c @@ -1,5 +1,7 @@ /* Error handler for noninteractive utilities - Copyright (C) 1990-1998, 2000-2003 Free Software Foundation, Inc. + Copyright (C) 1990-1998, 2000-2003, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) @@ -20,13 +22,14 @@ # include #endif -#include +#include "error.h" -#if !HAVE_ERROR_AT_LINE +#include +#include +#include +#include -#ifdef _LIBC -# include -#else +#if !_LIBC && ENABLE_NLS # include "gettext.h" #endif @@ -35,29 +38,7 @@ # define mbsrtowcs __mbsrtowcs #endif -#if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC -# if __STDC__ || defined _MSC_VER -# include -# define VA_START(args, lastarg) va_start(args, lastarg) -# else -# include -# define VA_START(args, lastarg) va_start(args) -# endif -#else -# define va_alist a1, a2, a3, a4, a5, a6, a7, a8 -# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8; -#endif - -#if STDC_HEADERS || _LIBC -# include -# include -#else -void exit (); -#endif - -#include "error.h" - -#if !_LIBC +#if USE_UNLOCKED_IO # include "unlocked-io.h" #endif @@ -68,11 +49,7 @@ void exit (); /* If NULL, error will flush stdout, then print on stderr the program name, a colon and a space. Otherwise, error will call this function without parameters instead. */ -void (*error_print_progname) ( -#if __STDC__ - 0 - void -#endif - ); +void (*error_print_progname) (void); /* This variable is incremented each time `error' is called. */ unsigned int error_message_count; @@ -95,12 +72,12 @@ extern void __error_at_line (int status, int errnum, const char *file_name, # define error __error # define error_at_line __error_at_line -# ifdef USE_IN_LIBIO -# include -# define fflush(s) INTUSE(_IO_fflush) (s) -# undef putc -# define putc(c, fp) INTUSE(_IO_putc) (c, fp) -# endif +# include +# define fflush(s) INTUSE(_IO_fflush) (s) +# undef putc +# define putc(c, fp) INTUSE(_IO_putc) (c, fp) + +# include #else /* not _LIBC */ @@ -111,40 +88,23 @@ extern void __error_at_line (int status, int errnum, const char *file_name, char *strerror_r (); # endif +# ifndef SIZE_MAX +# define SIZE_MAX ((size_t) -1) +# endif + /* The calling program should define program_name and set it to the name of the executing program. */ extern char *program_name; # if HAVE_STRERROR_R || defined strerror_r # define __strerror_r strerror_r -# else -# if HAVE_STRERROR -# ifndef HAVE_DECL_STRERROR -"this configure-time declaration test was not run" -# endif -# if !HAVE_DECL_STRERROR -char *strerror (); -# endif -# else -static char * -private_strerror (int errnum) -{ - extern char *sys_errlist[]; - extern int sys_nerr; - - if (errnum > 0 && errnum <= sys_nerr) - return _(sys_errlist[errnum]); - return _("Unknown system error"); -} -# define strerror private_strerror -# endif /* HAVE_STRERROR */ -# endif /* HAVE_STRERROR_R || defined strerror_r */ +# endif #endif /* not _LIBC */ static void print_errno_message (int errnum) { - char const *s; + char const *s = NULL; #if defined HAVE_STRERROR_R || _LIBC char errbuf[1024]; @@ -153,19 +113,15 @@ print_errno_message (int errnum) # else if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0) s = errbuf; - else - s = 0; # endif -#else - s = strerror (errnum); #endif #if !_LIBC - if (! s) + if (! s && ! (s = strerror (errnum))) s = _("Unknown system error"); #endif -#if _LIBC && USE_IN_LIBIO +#if _LIBC if (_IO_fwide (stderr, 0) > 0) { __fwprintf (stderr, L": %s", s); @@ -176,108 +132,81 @@ print_errno_message (int errnum) fprintf (stderr, ": %s", s); } -#ifdef VA_START static void error_tail (int status, int errnum, const char *message, va_list args) { -# if HAVE_VPRINTF || _LIBC -# if _LIBC && USE_IN_LIBIO +#if _LIBC if (_IO_fwide (stderr, 0) > 0) { -# define ALLOCA_LIMIT 2000 +# define ALLOCA_LIMIT 2000 size_t len = strlen (message) + 1; - wchar_t *wmessage = NULL; - mbstate_t st; - size_t res; - const char *tmp; - - do + const wchar_t *wmessage = L"out of memory"; + wchar_t *wbuf = (len < ALLOCA_LIMIT + ? alloca (len * sizeof *wbuf) + : len <= SIZE_MAX / sizeof *wbuf + ? malloc (len * sizeof *wbuf) + : NULL); + + if (wbuf) { - if (len < ALLOCA_LIMIT) - wmessage = (wchar_t *) alloca (len * sizeof (wchar_t)); - else - { - if (wmessage != NULL && len / 2 < ALLOCA_LIMIT) - wmessage = NULL; - - wmessage = (wchar_t *) realloc (wmessage, - len * sizeof (wchar_t)); - - if (wmessage == NULL) - { - fputws_unlocked (L"out of memory\n", stderr); - return; - } - } - + size_t res; + mbstate_t st; + const char *tmp = message; memset (&st, '\0', sizeof (st)); - tmp =message; + res = mbsrtowcs (wbuf, &tmp, len, &st); + wmessage = res == (size_t) -1 ? L"???" : wbuf; } - while ((res = mbsrtowcs (wmessage, &tmp, len, &st)) == len); - - if (res == (size_t) -1) - /* The string cannot be converted. */ - wmessage = (wchar_t *) L"???"; __vfwprintf (stderr, wmessage, args); + if (! (len < ALLOCA_LIMIT)) + free (wbuf); } else -# endif +#endif vfprintf (stderr, message, args); -# else - _doprnt (message, args, stderr); -# endif va_end (args); ++error_message_count; if (errnum) print_errno_message (errnum); -# if _LIBC && USE_IN_LIBIO +#if _LIBC if (_IO_fwide (stderr, 0) > 0) putwc (L'\n', stderr); else -# endif +#endif putc ('\n', stderr); fflush (stderr); if (status) exit (status); } -#endif /* Print the program name and error message MESSAGE, which is a printf-style format string with optional args. If ERRNUM is nonzero, print its corresponding system error message. Exit with status STATUS if it is nonzero. */ -/* VARARGS */ void -#if defined VA_START && (__STDC__ || defined _MSC_VER) error (int status, int errnum, const char *message, ...) -#else -error (status, errnum, message, va_alist) - int status; - int errnum; - char *message; - va_dcl -#endif { -#ifdef VA_START va_list args; + +#if defined _LIBC && defined __libc_ptf_call + /* We do not want this call to be cut short by a thread + cancellation. Therefore disable cancellation for now. */ + int state = PTHREAD_CANCEL_ENABLE; + __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state), + 0); #endif fflush (stdout); #ifdef _LIBC -# ifdef USE_IN_LIBIO _IO_flockfile (stderr); -# else - __flockfile (stderr); -# endif #endif if (error_print_progname) (*error_print_progname) (); else { -#if _LIBC && USE_IN_LIBIO +#if _LIBC if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s: ", program_name); else @@ -285,26 +214,13 @@ error (status, errnum, message, va_alist) fprintf (stderr, "%s: ", program_name); } -#ifdef VA_START - VA_START (args, message); + va_start (args, message); error_tail (status, errnum, message, args); -#else - fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8); - - ++error_message_count; - if (errnum) - print_errno_message (errnum); - putc ('\n', stderr); - fflush (stderr); - if (status) - exit (status); -#endif #ifdef _LIBC -# ifdef USE_IN_LIBIO _IO_funlockfile (stderr); -# else - __funlockfile (stderr); +# ifdef __libc_ptf_call + __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0); # endif #endif } @@ -314,22 +230,10 @@ error (status, errnum, message, va_alist) int error_one_per_line; void -#if defined VA_START && (__STDC__ || defined _MSC_VER) error_at_line (int status, int errnum, const char *file_name, unsigned int line_number, const char *message, ...) -#else -error_at_line (status, errnum, file_name, line_number, message, va_alist) - int status; - int errnum; - const char *file_name; - unsigned int line_number; - char *message; - va_dcl -#endif { -#ifdef VA_START va_list args; -#endif if (error_one_per_line) { @@ -346,19 +250,23 @@ error_at_line (status, errnum, file_name, line_number, message, va_alist) old_line_number = line_number; } +#if defined _LIBC && defined __libc_ptf_call + /* We do not want this call to be cut short by a thread + cancellation. Therefore disable cancellation for now. */ + int state = PTHREAD_CANCEL_ENABLE; + __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state), + 0); +#endif + fflush (stdout); #ifdef _LIBC -# ifdef USE_IN_LIBIO _IO_flockfile (stderr); -# else - __flockfile (stderr); -# endif #endif if (error_print_progname) (*error_print_progname) (); else { -#if _LIBC && USE_IN_LIBIO +#if _LIBC if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s: ", program_name); else @@ -368,7 +276,7 @@ error_at_line (status, errnum, file_name, line_number, message, va_alist) if (file_name != NULL) { -#if _LIBC && USE_IN_LIBIO +#if _LIBC if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s:%d: ", file_name, line_number); else @@ -376,26 +284,13 @@ error_at_line (status, errnum, file_name, line_number, message, va_alist) fprintf (stderr, "%s:%d: ", file_name, line_number); } -#ifdef VA_START - VA_START (args, message); + va_start (args, message); error_tail (status, errnum, message, args); -#else - fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8); - - ++error_message_count; - if (errnum) - print_errno_message (errnum); - putc ('\n', stderr); - fflush (stderr); - if (status) - exit (status); -#endif #ifdef _LIBC -# ifdef USE_IN_LIBIO _IO_funlockfile (stderr); -# else - __funlockfile (stderr); +# ifdef __libc_ptf_call + __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0); # endif #endif } @@ -407,5 +302,3 @@ error_at_line (status, errnum, file_name, line_number, message, va_alist) weak_alias (__error, error) weak_alias (__error_at_line, error_at_line) #endif - -#endif diff --git a/gettext-tools/lib/error.h b/gettext-tools/lib/error.h index 5feacd020..f1b47cec4 100644 --- a/gettext-tools/lib/error.h +++ b/gettext-tools/lib/error.h @@ -1,31 +1,27 @@ /* Declaration for error-reporting function Copyright (C) 1995, 1996, 1997, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. - - NOTE: The canonical source of this file is maintained with the GNU C Library. - Bugs can be reported to bug-glibc@gnu.org. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - USA. */ + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _ERROR_H #define _ERROR_H 1 #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) # define __attribute__(Spec) /* empty */ # endif /* The __-protected variants of `format' and `printf' attributes @@ -40,17 +36,15 @@ extern "C" { #endif -#if (defined (__STDC__) && __STDC__) || defined _MSC_VER - /* Print a message with `fprintf (stderr, FORMAT, ...)'; if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). If STATUS is nonzero, terminate the program with `exit (STATUS)'. */ -extern void error (int status, int errnum, const char *format, ...) +extern void error (int __status, int __errnum, const char *__format, ...) __attribute__ ((__format__ (__printf__, 3, 4))); -extern void error_at_line (int status, int errnum, const char *fname, - unsigned int lineno, const char *format, ...) +extern void error_at_line (int __status, int __errnum, const char *__fname, + unsigned int __lineno, const char *__format, ...) __attribute__ ((__format__ (__printf__, 5, 6))); /* If NULL, error will flush stdout, then print on stderr the program @@ -58,12 +52,6 @@ extern void error_at_line (int status, int errnum, const char *fname, function without parameters instead. */ extern DLL_VARIABLE void (*error_print_progname) (void); -#else -void error (); -void error_at_line (); -extern DLL_VARIABLE void (*error_print_progname) (); -#endif - /* This variable is incremented each time `error' is called. */ extern DLL_VARIABLE unsigned int error_message_count; diff --git a/gettext-tools/m4/ChangeLog b/gettext-tools/m4/ChangeLog index 4cab5d624..dbab0f22c 100644 --- a/gettext-tools/m4/ChangeLog +++ b/gettext-tools/m4/ChangeLog @@ -1,3 +1,7 @@ +2005-01-06 Bruno Haible + + * error.m4: Upgrade from gnulib. + 2005-01-06 Bruno Haible * quote.m4: New file, from gnulib. diff --git a/gettext-tools/m4/error.m4 b/gettext-tools/m4/error.m4 index caeb47d1d..6c1091886 100644 --- a/gettext-tools/m4/error.m4 +++ b/gettext-tools/m4/error.m4 @@ -1,4 +1,4 @@ -# error.m4 serial 3 (gettext-0.14.2) +# error.m4 serial 10 (gettext-0.14.2) dnl Copyright (C) 2002-2005 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General @@ -6,28 +6,16 @@ dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. -# A modified version of AM_FUNC_ERROR_AT_LINE that triggers HAVE_ERROR_AT_LINE -# in config.h instead of modifying LIBOBJS. -AC_DEFUN([gt_FUNC_ERROR_AT_LINE], +AC_DEFUN([gl_ERROR], [ - AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line, - [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");], - am_cv_lib_error_at_line=yes, - am_cv_lib_error_at_line=no)]) - if test $am_cv_lib_error_at_line = yes; then - AC_DEFINE(HAVE_ERROR_AT_LINE, 1, - [Define to 1 if you have the functions error() and error_at_line().]) - else - gl_PREREQ_ERROR - fi + AC_FUNC_ERROR_AT_LINE + dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]). + gl_PREREQ_ERROR ]) # Prerequisites of lib/error.c. AC_DEFUN([gl_PREREQ_ERROR], [ - AC_REQUIRE([AC_HEADER_STDC]) - AC_REQUIRE([AC_FUNC_VPRINTF]) - AC_CHECK_FUNCS(strerror) - AC_CHECK_DECLS([strerror]) - AC_FUNC_STRERROR_R + AC_REQUIRE([AC_FUNC_STRERROR_R]) + : ])