mirror of
https://gitlab.freedesktop.org/xorg/proto/xorgproto.git
synced 2026-05-09 07:08:08 +02:00
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
This commit is contained in:
parent
f1b8b4dd5e
commit
c76d51423d
1 changed files with 2 additions and 1 deletions
|
|
@ -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__
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue