Define a sometimes-link-required function using ARGMATCH_DIE_DECL.
authorJim Meyering <meyering@redhat.com>
Wed, 14 Nov 2007 12:33:21 +0000 (13:33 +0100)
committerJim Meyering <meyering@redhat.com>
Wed, 14 Nov 2007 12:35:18 +0000 (13:35 +0100)
* tests/test-argmatch.c (ARGMATCH_DIE_DECL): When defined,
use this macro to create a function _definition_.
Remove useless "#undef ARGMATCH_DIE".

ChangeLog
tests/test-argmatch.c

index ac7bd11..9b33278 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index f6126f6..363033f 100644 (file)
 
 #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>
     }                                                                       \
   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,