summaryrefslogtreecommitdiff
path: root/lib/exclude.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-04-24 19:02:10 +0200
committerJim Meyering <meyering@redhat.com>2011-04-25 10:24:30 +0200
commit349d7fe0e307d59d508b3579317ee8d4eacfeb9c (patch)
tree97d92955127a8bf559e227fbe801987246c3a0d2 /lib/exclude.c
parentd35ef05dc0564cf696408eae985444879a399e29 (diff)
downloadgnulib-349d7fe0e307d59d508b3579317ee8d4eacfeb9c.tar.gz
use _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE
Diffstat (limited to 'lib/exclude.c')
-rw-r--r--lib/exclude.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/exclude.c b/lib/exclude.c
index df49714a6b..fe74f361c6 100644
--- a/lib/exclude.c
+++ b/lib/exclude.c
@@ -60,6 +60,14 @@ verify (((EXCLUDE_ANCHORED | EXCLUDE_INCLUDE | EXCLUDE_WILDCARDS)
| FNM_CASEFOLD | FNM_EXTMATCH))
== 0);
+/* The attribute __pure__ was added in gcc 2.96. */
+#undef _GL_ATTRIBUTE_PURE
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
+#endif
+
/* Exclusion patterns are grouped into a singly-linked list of
"exclusion segments". Each segment represents a set of patterns
@@ -111,7 +119,7 @@ struct exclude
};
/* Return true if str has wildcard characters */
-bool
+bool _GL_ATTRIBUTE_PURE
fnmatch_pattern_has_wildcards (const char *str, int options)
{
const char *cset = "\\?*[]";