summaryrefslogtreecommitdiff
path: root/lib/c-strncasecmp.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/c-strncasecmp.c
parentd35ef05dc0564cf696408eae985444879a399e29 (diff)
downloadgnulib-349d7fe0e307d59d508b3579317ee8d4eacfeb9c.tar.gz
use _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE
Diffstat (limited to 'lib/c-strncasecmp.c')
-rw-r--r--lib/c-strncasecmp.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/c-strncasecmp.c b/lib/c-strncasecmp.c
index 0085185ab2..280f09b5ab 100644
--- a/lib/c-strncasecmp.c
+++ b/lib/c-strncasecmp.c
@@ -24,7 +24,15 @@
#include "c-ctype.h"
-int
+/* 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
+
+int _GL_ATTRIBUTE_PURE
c_strncasecmp (const char *s1, const char *s2, size_t n)
{
register const unsigned char *p1 = (const unsigned char *) s1;