# HG changeset patch # User Jim Meyering # Date 1195043601 -3600 # Node ID b335ae52450d042599206e2846571040a93e843f # Parent 799b495c5bed9d7b44b620493087c7d4ace12c77 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". diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-11-14 Jim Meyering + + 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 * lib/config.charset: Update for OpenBSD 4.1. diff --git a/tests/test-argmatch.c b/tests/test-argmatch.c --- a/tests/test-argmatch.c +++ b/tests/test-argmatch.c @@ -19,10 +19,6 @@ #include -/* Some packages define ARGMATCH_DIE in their . Here we want to - assume the default definition of ARGMATCH_DIE. */ -#undef ARGMATCH_DIE - #include "argmatch.h" #include @@ -41,6 +37,12 @@ } \ while (0) +/* Some packages define ARGMATCH_DIE and ARGMATCH_DIE_DECL in , 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,