/* Test suite for exclude.
- Copyright (C) 2009 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
This file is part of the GNUlib Library.
This program is free software: you can redistribute it and/or modify
ARGMATCH_VERIFY (exclude_keywords, exclude_flags);
+/* 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
+
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
+# define _GL_ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
+# else
+# define _GL_ATTRIBUTE_NORETURN /* empty */
+# endif
+
+ARGMATCH_DIE_DECL _GL_ATTRIBUTE_NORETURN;
+ARGMATCH_DIE_DECL { exit (1); }
+
+#endif
+
int
main (int argc, char **argv)
{
{
char *opt = *++argv;
if (opt[0] == '-')
- {
- int neg = 0;
- int flag;
- char *s = opt + 1;
-
- if (opt[1] == '-' && opt[2] == 0)
- {
- argc--;
- break;
- }
- if (strlen (s) > 3 && memcmp (s, "no-", 3) == 0)
- {
- neg = 1;
- s += 3;
- }
- flag = XARGMATCH (opt, s, exclude_keywords, exclude_flags);
- if (neg)
- exclude_options &= ~flag;
- else
- exclude_options |= flag;
- }
+ {
+ int neg = 0;
+ int flag;
+ char *s = opt + 1;
+
+ if (opt[1] == '-' && opt[2] == 0)
+ {
+ argc--;
+ break;
+ }
+ if (strlen (s) > 3 && memcmp (s, "no-", 3) == 0)
+ {
+ neg = 1;
+ s += 3;
+ }
+ flag = XARGMATCH (opt, s, exclude_keywords, exclude_flags);
+ if (neg)
+ exclude_options &= ~flag;
+ else
+ exclude_options |= flag;
+ }
else if (add_exclude_file (add_exclude, exclude, opt,
- exclude_options, '\n') != 0)
- error (1, errno, "error loading %s", opt);
+ exclude_options, '\n') != 0)
+ error (1, errno, "error loading %s", opt);
}
for (; argc; --argc)