From: Bruno Haible Date: Sat, 9 May 2020 10:50:57 +0000 (+0200) Subject: dirent, stdlib, wchar, string: Don't redefine _GL_ATTRIBUTE_PURE. X-Git-Tag: v1.0~4116 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=dae13c0c738762e9522b100868364bd08a080321;p=gnulib.git dirent, stdlib, wchar, string: Don't redefine _GL_ATTRIBUTE_PURE. * lib/dirent.in.h (_GL_ATTRIBUTE_PURE): Don't override the definition that usually comes from m4/gnulib-common.m4. * lib/stdlib.in.h (_GL_ATTRIBUTE_PURE): Likewise. * lib/string.in.h (_GL_ATTRIBUTE_PURE): Likewise. * lib/wchar.in.h (_GL_ATTRIBUTE_PURE): Likewise. --- diff --git a/ChangeLog b/ChangeLog index 0d9ab5441b..065628f2bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2020-05-09 Bruno Haible + + dirent, stdlib, wchar, string: Don't redefine _GL_ATTRIBUTE_PURE. + * lib/dirent.in.h (_GL_ATTRIBUTE_PURE): Don't override the definition + that usually comes from m4/gnulib-common.m4. + * lib/stdlib.in.h (_GL_ATTRIBUTE_PURE): Likewise. + * lib/string.in.h (_GL_ATTRIBUTE_PURE): Likewise. + * lib/wchar.in.h (_GL_ATTRIBUTE_PURE): Likewise. + 2020-05-09 Bruno Haible uchar: Work around incorrect char16_t, char32_t types on Haiku 2020. diff --git a/lib/dirent.in.h b/lib/dirent.in.h index f7c2681015..6fa44f0d28 100644 --- a/lib/dirent.in.h +++ b/lib/dirent.in.h @@ -57,10 +57,12 @@ typedef struct gl_directory DIR; /* 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 */ +#ifndef _GL_ATTRIBUTE_PURE +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define _GL_ATTRIBUTE_PURE /* empty */ +# endif #endif /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index ec5f124a36..59f9e6c71d 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -101,10 +101,12 @@ struct random_data /* 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 */ +#ifndef _GL_ATTRIBUTE_PURE +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define _GL_ATTRIBUTE_PURE /* empty */ +# endif #endif /* The definition of _Noreturn is copied here. */ diff --git a/lib/string.in.h b/lib/string.in.h index 87155ca3f4..d601450315 100644 --- a/lib/string.in.h +++ b/lib/string.in.h @@ -54,10 +54,12 @@ /* 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 */ +#ifndef _GL_ATTRIBUTE_PURE +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define _GL_ATTRIBUTE_PURE /* empty */ +# endif #endif /* NetBSD 5.0 declares strsignal in , not in . */ diff --git a/lib/wchar.in.h b/lib/wchar.in.h index 040065a175..e1fa92f27b 100644 --- a/lib/wchar.in.h +++ b/lib/wchar.in.h @@ -94,10 +94,12 @@ /* 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 */ +#ifndef _GL_ATTRIBUTE_PURE +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define _GL_ATTRIBUTE_PURE /* empty */ +# endif #endif /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */