tests: avoid test failure on Solaris 10 due to lack of PATH export
[pspp] / tests / test-exclude.c
index a729bba3664b2fe9f613c1d78eb6af797b36d010..0b8f9534eb391e1bcc9671cbc7fe117c24a05c86 100644 (file)
@@ -1,5 +1,5 @@
 /* Test suite for exclude.
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
    This file is part of the GNUlib Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -63,6 +63,17 @@ 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
+#ifndef __attribute__
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
+#  define __attribute__(x) /* empty */
+# endif
+#endif
+
+#ifndef ATTRIBUTE_NORETURN
+# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
+#endif
+
+ARGMATCH_DIE_DECL ATTRIBUTE_NORETURN;
 ARGMATCH_DIE_DECL { exit (1); }
 #endif
 
@@ -81,30 +92,30 @@ 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)