Mercurial > gnulib
changeset 29167:6854c12d6398
Define a sometimes-link-required function using ARGMATCH_DIE_DECL.
* tests/test-argmatch.c (ARGMATCH_DIE_DECL): When defined,
use this macro to create a function _definition_.
Remove useless "#undef ARGMATCH_DIE".
author | Jim Meyering <meyering@redhat.com> |
---|---|
date | Wed, 14 Nov 2007 13:33:21 +0100 |
parents | 389c96ea8ac6 |
children | 3c62738a76e6 |
files | ChangeLog tests/test-argmatch.c |
diffstat | 2 files changed, 13 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Wed Nov 14 13:08:37 2007 +0100 +++ b/ChangeLog Wed Nov 14 13:33:21 2007 +0100 @@ -1,3 +1,10 @@ +2007-11-14 Jim Meyering <meyering@redhat.com> + + Define a sometimes-link-required function using ARGMATCH_DIE_DECL. + * tests/test-argmatch.c (ARGMATCH_DIE_DECL): When defined, + use this macro to create a function _definition_. + Remove useless "#undef ARGMATCH_DIE". + 2007-11-14 Bruno Haible <bruno@clisp.org> * lib/config.charset: Update for OpenBSD 4.1.
--- a/tests/test-argmatch.c Wed Nov 14 13:08:37 2007 +0100 +++ b/tests/test-argmatch.c Wed Nov 14 13:33:21 2007 +0100 @@ -19,10 +19,6 @@ #include <config.h> -/* Some packages define ARGMATCH_DIE in their <config.h>. Here we want to - assume the default definition of ARGMATCH_DIE. */ -#undef ARGMATCH_DIE - #include "argmatch.h" #include <stdio.h> @@ -41,6 +37,12 @@ } \ while (0) +/* Some packages define ARGMATCH_DIE and ARGMATCH_DIE_DECL in <config.h>, and + thus must link with a definition of that function. Provide it here. */ +#ifdef ARGMATCH_DIE_DECL +ARGMATCH_DIE_DECL { exit (1); } +#endif + enum backup_type { no_backups,