summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2006-03-09 17:26:16 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2006-03-09 17:26:16 +0000
commit7dd5f53f321a66ea6dc287c154e552814a9de7a6 (patch)
treef4b727c581971b20d58ba287a8fa5784ca08b191
parentdb33a4464437e23761ad91168e5f07bad74ac452 (diff)
Use GNU features only if defined in header
-rw-r--r--test/misc/tst-fnmatch.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/misc/tst-fnmatch.c b/test/misc/tst-fnmatch.c
index 74839bc6c..bb102c5bb 100644
--- a/test/misc/tst-fnmatch.c
+++ b/test/misc/tst-fnmatch.c
@@ -295,24 +295,30 @@ convert_flags (const char *str)
result |= FNM_PERIOD;
len = 6;
}
+#ifdef FNM_LEADING_DIR
else if (strncasecmp (str, "LEADING_DIR", 11) == 0
&& (str[11] == '|' || str[11] == '\0'))
{
result |= FNM_LEADING_DIR;
len = 11;
}
+#endif
+#ifdef FNM_CASEFOLD
else if (strncasecmp (str, "CASEFOLD", 8) == 0
&& (str[8] == '|' || str[8] == '\0'))
{
result |= FNM_CASEFOLD;
len = 8;
}
+#endif
+#ifdef FNM_EXTMATCH
else if (strncasecmp (str, "EXTMATCH", 8) == 0
&& (str[8] == '|' || str[8] == '\0'))
{
result |= FNM_EXTMATCH;
len = 8;
}
+#endif
else
return -1;
@@ -351,6 +357,7 @@ flag_output (int flags)
cp = stpcpy (cp, "FNM_PERIOD");
first = 0;
}
+#ifdef FNM_LEADING_DIR
if (flags & FNM_LEADING_DIR)
{
if (! first)
@@ -358,6 +365,8 @@ flag_output (int flags)
cp = stpcpy (cp, "FNM_LEADING_DIR");
first = 0;
}
+#endif
+#ifdef FNM_CASEFOLD
if (flags & FNM_CASEFOLD)
{
if (! first)
@@ -365,6 +374,8 @@ flag_output (int flags)
cp = stpcpy (cp, "FNM_CASEFOLD");
first = 0;
}
+#endif
+#ifdef FNM_EXTMATCH
if (flags & FNM_EXTMATCH)
{
if (! first)
@@ -372,6 +383,7 @@ flag_output (int flags)
cp = stpcpy (cp, "FNM_EXTMATCH");
first = 0;
}
+#endif
if (cp == buf)
*cp++ = '0';
*cp = '\0';