$NetBSD: patch-ad,v 1.5 2012/11/16 20:04:48 joerg Exp $

Patch from https://bugs.freedesktop.org/attachment.cgi?id=66181

--- Xfuncproto.h.in.orig	2012-03-16 06:11:44.000000000 +0000
+++ Xfuncproto.h.in
@@ -83,10 +83,10 @@ in this Software without prior written a
 #endif /* GNUC >= 4 */
 
 /* Added in X11R6.9, so available in any version of modular xproto */
-#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__CYGWIN__)
-# define _X_EXPORT      __attribute__((visibility("default")))
-# define _X_HIDDEN      __attribute__((visibility("hidden")))
-# define _X_INTERNAL    __attribute__((visibility("internal")))
+#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__CYGWIN__) && !defined(__sun)
+# define _X_EXPORT      __attribute__((__visibility__("default")))
+# define _X_HIDDEN      __attribute__((__visibility__("hidden")))
+# define _X_INTERNAL    __attribute__((__visibility__("internal")))
 #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
 # define _X_EXPORT      __global
 # define _X_HIDDEN      __hidden
@@ -108,7 +108,7 @@ in this Software without prior written a
 
 /* Added in X11R6.9, so available in any version of modular xproto */
 #if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 301)
-# define _X_DEPRECATED  __attribute__((deprecated))
+# define _X_DEPRECATED  __attribute__((__deprecated__))
 #else /* not gcc >= 3.1 */
 # define _X_DEPRECATED
 #endif
@@ -116,7 +116,7 @@ in this Software without prior written a
 /* requires xproto >= 7.0.17 */
 #if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)) \
 	|| (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
-# define _X_NORETURN __attribute((noreturn))
+# define _X_NORETURN __attribute((__noreturn__))
 #else
 # define _X_NORETURN
 #endif /* GNUC  */
@@ -132,7 +132,7 @@ in this Software without prior written a
    argument macros, must be only used inside #ifdef _X_NONNULL guards, as
    many legacy X clients are compiled in C89 mode still. */
 #if defined(__GNUC__) &&  ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303)
-#define _X_NONNULL(args...)  __attribute__((nonnull(args)))
+#define _X_NONNULL(args...)  __attribute__((__nonnull(args__)))
 #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) /* C99 */
 #define _X_NONNULL(...)  /* */
 #endif
@@ -161,7 +161,8 @@ in this Software without prior written a
 /* 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__
