use _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE
[gnulib.git] / lib / exclude.c
index df49714..fe74f36 100644 (file)
@@ -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 = "\\?*[]";