X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fhash-pjw.c;fp=lib%2Fhash-pjw.c;h=7df27ae1fc6ebe672b5c531abf28177a55156a64;hb=349d7fe0e307d59d508b3579317ee8d4eacfeb9c;hp=743bb576cca2d02b93503b9a988366b9e0b1d30a;hpb=d35ef05dc0564cf696408eae985444879a399e29;p=gnulib.git diff --git a/lib/hash-pjw.c b/lib/hash-pjw.c index 743bb576c..7df27ae1f 100644 --- a/lib/hash-pjw.c +++ b/lib/hash-pjw.c @@ -23,11 +23,19 @@ #define SIZE_BITS (sizeof (size_t) * CHAR_BIT) +/* 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 + /* A hash function for NUL-terminated char* strings using the method described by Bruno Haible. See http://www.haible.de/bruno/hashfunc.html. */ -size_t +size_t _GL_ATTRIBUTE_PURE hash_pjw (const void *x, size_t tablesize) { const char *s;