[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] gnulib-common.m4: add _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE
From: |
Jim Meyering |
Subject: |
[PATCH] gnulib-common.m4: add _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE |
Date: |
Mon, 06 Jun 2011 10:31:55 +0200 |
FYI, as discussed, here are the definitions.
I'll be adding uses separately, in headers when possible.
>From dd36104845e77faa713653d1173623a20082cc76 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 24 Apr 2011 19:00:18 +0200
Subject: [PATCH] gnulib-common.m4: add _GL_ATTRIBUTE_CONST and
_GL_ATTRIBUTE_PURE
* m4/gnulib-common.m4 (gl_COMMON): Emit definitions of
_GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE.
---
ChangeLog | 6 ++++++
m4/gnulib-common.m4 | 16 +++++++++++++++-
2 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1190e1d..57d8da4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-06-06 Jim Meyering <address@hidden>
+
+ gnulib-common.m4: add _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE
+ * m4/gnulib-common.m4 (gl_COMMON): Emit definitions of
+ _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE.
+
2011-06-05 Bruno Haible <address@hidden>
ansi-c++-opt: Interoperability with libtool.
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index c4d7a20..8b73f1d 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 24
+# gnulib-common.m4 serial 25
dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -34,6 +34,20 @@ AC_DEFUN([gl_COMMON_BODY], [
/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
is a misnomer outside of parameter lists. */
#define _UNUSED_PARAMETER_ _GL_UNUSED
+
+/* The __pure__ attribute 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 __const__ attribute was added in gcc 2.95. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
+#else
+# define _GL_ATTRIBUTE_CONST /* empty */
+#endif
])
dnl Preparation for running test programs:
dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
--
1.7.6.rc0.254.gf37de
- [PATCH] gnulib-common.m4: add _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE,
Jim Meyering <=