bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix handling of restrict keyword for newer Sun Studio C++.


From: Joel E. Denny
Subject: [PATCH] Fix handling of restrict keyword for newer Sun Studio C++.
Date: Sat, 10 Apr 2010 03:05:43 -0400 (EDT)
User-agent: Alpine 1.00 (DEB 882 2007-12-20)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ok to apply this patch?

>From 44e7c72451c66c1a429bfd24afeabe5b9a9cca64 Mon Sep 17 00:00:00 2001
From: Joel E. Denny <address@hidden>
Date: Sat, 10 Apr 2010 02:10:51 -0400
Subject: [PATCH] Fix handling of restrict keyword for newer Sun Studio C++.

* m4/gnulib-common.m4 (AC_C_RESTRICT): Import fix from Autoconf
2.64 and later.
- ---
 ChangeLog           |    6 ++++++
 m4/gnulib-common.m4 |   15 ++++++++-------
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e89c108..d40656c 100644
- --- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-10  Joel E. Denny  <address@hidden>
+
+       Fix handling of restrict keyword for newer Sun Studio C++.
+       * m4/gnulib-common.m4 (AC_C_RESTRICT): Import fix from Autoconf
+       2.64 and later.
+
 2010-04-08  James Youngman  <address@hidden>
 
        * doc/manywarnings.texi (manywarnings): Add missing parenthesis in
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index 9cc519e..ab0c16c 100644
- --- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -128,10 +128,10 @@ m4_ifdef([AC_PROG_MKDIR_P], [
      AC_SUBST([MKDIR_P])])])
 
 # AC_C_RESTRICT
- -# This definition overrides the AC_C_RESTRICT macro from autoconf 2.60..2.61,
+# This definition overrides the AC_C_RESTRICT macro from autoconf 2.60..2.63,
 # so that mixed use of GNU C and GNU C++ and mixed use of Sun C and Sun C++
 # works.
- -# This definition can be removed once autoconf >= 2.62 can be assumed.
+# This definition can be removed once autoconf >= 2.64 can be assumed.
 AC_DEFUN([AC_C_RESTRICT],
 [AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict],
   [ac_cv_c_restrict=no
@@ -155,13 +155,14 @@ AC_DEFUN([AC_C_RESTRICT],
    nothing if this is not supported.  Do not define if restrict is
    supported directly.  */
 #undef restrict
- -/* Work around a bug in Sun C++: it does not support _Restrict, even
- -   though the corresponding Sun C compiler does, which causes
- -   "#define restrict _Restrict" in the previous line.  Perhaps some future
- -   version of Sun C++ will work with _Restrict; if so, it'll probably
- -   define __RESTRICT, just as Sun C does.  */
+/* Work around a bug in Sun C++: it does not support _Restrict or
+   __restrict__, even though the corresponding Sun C compiler ends up with
+   "#define restrict _Restrict" or "#define restrict __restrict__" in the
+   previous line.  Perhaps some future version of Sun C++ will work with
+   restrict; if so, hopefully it defines __RESTRICT like Sun C does.  */
 #if defined __SUNPRO_CC && !defined __RESTRICT
 # define _Restrict
+# define __restrict__
 #endif])
  case $ac_cv_c_restrict in
    restrict) ;;
- -- 
1.5.4.3

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFLwCNMwtx3rSY98oARAnZPAJ48zpKks4n8dW52SNjIh1wAlcsWkwCgitLl
i0nlyNN8JFyB8F1bernvZoE=
=eqgv
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]