diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-08-26 14:36:50 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-09-06 23:15:29 -0700 |
commit | c76d51423d6a6afe4f0c8fc6f863ba97d202184b (patch) | |
tree | e031fa3413ebd6ee528e99fe0e2a0ca31e18520e /Xfuncproto.h.in | |
parent | f1b8b4dd5e798b7e91da95eca997ec7236fcbc27 (diff) |
Bug 51009: _X_RESTRICT_KYWD fix for g++ 4.6 & later on Solaris
g++ 4.6 & later on Solaris set the __STDC_VERSION__ define to indicate
C99 mode to expose C99/Unix03 functions in the system headers, even
though they don't recognize the C99 restrict keyword, as explained in
http://gcc.gnu.org/ml/gcc-patches/2010-05/msg01308.html
Thus we avoid using the restrict keyword here if __cplusplus is also
defined, falling back to the __GNUC__ case using __restrict__ instead.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=51009
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Tested-by: Jonathan Perkin
Diffstat (limited to 'Xfuncproto.h.in')
-rw-r--r-- | Xfuncproto.h.in | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Xfuncproto.h.in b/Xfuncproto.h.in index dc913fa..3eac5d5 100644 --- a/Xfuncproto.h.in +++ b/Xfuncproto.h.in @@ -161,7 +161,8 @@ in this Software without prior written authorization from The Open Group. /* requires xproto >= 7.0.21 */ #ifndef _X_RESTRICT_KYWD # if defined(restrict) /* assume autoconf set it correctly */ || \ - (defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L)) /* C99 */ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) /* C99 */ \ + && !defined(__cplusplus)) /* Workaround g++ issue on Solaris */ # define _X_RESTRICT_KYWD restrict # elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc w/C89+extensions */ # define _X_RESTRICT_KYWD __restrict__ |