summaryrefslogtreecommitdiff
path: root/gl/dirent.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'gl/dirent.in.h')
-rw-r--r--gl/dirent.in.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/gl/dirent.in.h b/gl/dirent.in.h
index 808b360856..cdbc5fd4fd 100644
--- a/gl/dirent.in.h
+++ b/gl/dirent.in.h
@@ -55,6 +55,14 @@ typedef struct gl_directory DIR;
# endif
#endif
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The attribute __pure__ was added in gcc 2.96. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
+#endif
+
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
@@ -229,6 +237,7 @@ _GL_WARN_ON_USE (scandir, "scandir is unportable - "
# if !@HAVE_ALPHASORT@
_GL_FUNCDECL_SYS (alphasort, int,
(const struct dirent **, const struct dirent **)
+ _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2)));
# endif
/* Need to cast, because on glibc systems, the parameters are