From: Bruno Haible Date: Sat, 22 Jul 2006 13:59:01 +0000 (+0000) Subject: Update from gnulib. X-Git-Tag: 0.16.x-branchpoint~361 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28ebae4d1976240d8f8074bfcb21e972670e2b71;p=thirdparty%2Fgettext.git Update from gnulib. --- diff --git a/gettext-tools/lib/ChangeLog b/gettext-tools/lib/ChangeLog index 1e88d54f4..3d560672f 100644 --- a/gettext-tools/lib/ChangeLog +++ b/gettext-tools/lib/ChangeLog @@ -1,3 +1,11 @@ +2006-07-22 Bruno Haible + + * atexit.c: Update from gnulib. + + * verify.h: New file, from gnulib. + * argmatch.h: Update from gnulib, keeping DLL_VARIABLE annotation. + * Makefile.am (libgettextlib_la_SOURCES): Add verify.h. + 2006-07-21 Bruno Haible * gettext-0.15 released. diff --git a/gettext-tools/lib/argmatch.c b/gettext-tools/lib/argmatch.c index 38ec7a80d..36d5845ac 100644 --- a/gettext-tools/lib/argmatch.c +++ b/gettext-tools/lib/argmatch.c @@ -1,6 +1,7 @@ /* argmatch.c -- find a match for a string in an array - Copyright (C) 1990, 1998-1999, 2001-2005 Free Software Foundation, Inc. + Copyright (C) 1990, 1998, 1999, 2001, 2002, 2003, 2004, 2005 Free + Software Foundation, Inc. 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 @@ -72,7 +73,7 @@ argmatch_exit_fn argmatch_die = __argmatch_die; /* If ARG is an unambiguous match for an element of the - null-terminated array ARGLIST, return the index in ARGLIST + NULL-terminated array ARGLIST, return the index in ARGLIST of the matched element, else -1 if it does not match any element or -2 if it is ambiguous (is a prefix of more than one element). diff --git a/gettext-tools/lib/argmatch.h b/gettext-tools/lib/argmatch.h index 30d1139fa..d82929cc6 100644 --- a/gettext-tools/lib/argmatch.h +++ b/gettext-tools/lib/argmatch.h @@ -1,6 +1,6 @@ /* argmatch.h -- definitions and prototypes for argmatch.c - Copyright (C) 1990, 1998, 1999, 2001, 2002, 2004 Free Software + Copyright (C) 1990, 1998, 1999, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -25,24 +25,15 @@ # include -# define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array)) +# include "verify.h" -# define ARGMATCH_CONSTRAINT(Arglist, Vallist) \ - (ARRAY_CARDINALITY (Arglist) == ARRAY_CARDINALITY (Vallist) + 1) +# define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array)) /* Assert there are as many real arguments as there are values - (argument list ends with a NULL guard). ARGMATCH_VERIFY is - preferred, since it is guaranteed to be checked at compile-time. - ARGMATCH_ASSERT is for backward compatibility only. */ - -# define ARGMATCH_VERIFY(Arglist, Vallist) \ - struct argmatch_verify \ - { \ - char argmatch_verify[ARGMATCH_CONSTRAINT(Arglist, Vallist) ? 1 : -1]; \ - } - -# define ARGMATCH_ASSERT(Arglist, Vallist) \ - assert (ARGMATCH_CONSTRAINT (Arglist, Vallist)) + (argument list ends with a NULL guard). */ + +# define ARGMATCH_VERIFY(Arglist, Vallist) \ + verify (ARRAY_CARDINALITY (Arglist) == ARRAY_CARDINALITY (Vallist) + 1) /* Return the index of the element of ARGLIST (NULL terminated) that matches with ARG. If VALLIST is not NULL, then use it to resolve diff --git a/gettext-tools/lib/atexit.c b/gettext-tools/lib/atexit.c index a401b2ff8..f4873c9ee 100644 --- a/gettext-tools/lib/atexit.c +++ b/gettext-tools/lib/atexit.c @@ -1,7 +1,9 @@ /* Wrapper to implement ANSI C's atexit using SunOS's on_exit. */ /* This function is in the public domain. --Mike Stump. */ -#include "config.h" +#ifdef HAVE_CONFIG_H +# include +#endif int atexit (void (*f) (void))