]> Savannah Git Hosting - gnulib.git/commitdiff
Improve port of AC_C_RESTRICT to Oracle C++
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 19 Dec 2019 01:05:02 +0000 (17:05 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 19 Dec 2019 01:05:49 +0000 (17:05 -0800)
Problem reported by Christian Biesinger in:
https://lists.gnu.org/r/bug-gnulib/2019-12/msg00159.html
* m4/gnulib-common.m4 (AC_C_RESTRICT): Port better to
Oracle Developer Studio C++ 12.5 or later.

ChangeLog
m4/gnulib-common.m4

index 6bf4218275d4e63db4339740b952c4d30253d05e..1f0792e95aa5859b5866f0456f348f3034150509 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2019-12-18  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Improve port of AC_C_RESTRICT to Oracle C++
+       Problem reported by Christian Biesinger in:
+       https://lists.gnu.org/r/bug-gnulib/2019-12/msg00159.html
+       * m4/gnulib-common.m4 (AC_C_RESTRICT): Port better to
+       Oracle Developer Studio C++ 12.5 or later.
+
 2019-12-18  Bruno Haible  <bruno@clisp.org>
 
        wchar: Fix test failures on AIX and MSVC (regression from 2019-12-07).
index d8f0d3fb5662bb5c1660b2b52de067add90a29e1..96664855bdbe01541f8778ae19b1f67b420c6792 100644 (file)
@@ -415,12 +415,13 @@ 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 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
+/* Work around a bug in older versions of Sun C++, which did not
+   #define __restrict__ or support _Restrict or __restrict__
+   even though the corresponding Sun C compiler ended up with
+   "#define restrict _Restrict" or "#define restrict __restrict__"
+   in the previous line.  This workaround can be removed once
+   we assume Oracle Developer Studio 12.5 (2016) or later.  */
+#if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__
 # define _Restrict
 # define __restrict__
 #endif])