aboutsummaryrefslogtreecommitdiff
path: root/X11/Xfuncproto.h.in
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2015-02-22 14:57:50 +0100
committermarha <marha@users.sourceforge.net>2015-02-22 14:58:56 +0100
commit043c4d95bfec1ad4a8834c8606c73631e76ade09 (patch)
treea7a92bb17258869aa3f89b86b02d1bf9d69d57af /X11/Xfuncproto.h.in
parent7785694244cdfc5939ca4754cab4e08bd6980f99 (diff)
downloadvcxsrv-043c4d95bfec1ad4a8834c8606c73631e76ade09.tar.gz
vcxsrv-043c4d95bfec1ad4a8834c8606c73631e76ade09.tar.bz2
vcxsrv-043c4d95bfec1ad4a8834c8606c73631e76ade09.zip
Upgrade to xcalc-1.0.6 and xproto-7.0.27
Diffstat (limited to 'X11/Xfuncproto.h.in')
-rw-r--r--X11/Xfuncproto.h.in31
1 files changed, 22 insertions, 9 deletions
diff --git a/X11/Xfuncproto.h.in b/X11/Xfuncproto.h.in
index dac92291e..e9e5e7141 100644
--- a/X11/Xfuncproto.h.in
+++ b/X11/Xfuncproto.h.in
@@ -75,15 +75,21 @@ in this Software without prior written authorization from The Open Group.
#endif
#endif /* _XFUNCPROTOBEGIN */
+/* http://clang.llvm.org/docs/LanguageExtensions.html#has-attribute */
+#ifndef __has_attribute
+# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
+#endif
+
/* Added in X11R6.9, so available in any version of modular xproto */
-#if defined(__GNUC__) && (__GNUC__ >= 4)
+#if __has_attribute(__sentinel__) || (defined(__GNUC__) && (__GNUC__ >= 4))
# define _X_SENTINEL(x) __attribute__ ((__sentinel__(x)))
#else
# define _X_SENTINEL(x)
#endif /* GNUC >= 4 */
/* Added in X11R6.9, so available in any version of modular xproto */
-#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__CYGWIN__) && !defined(__MINGW32__)
+#if (__has_attribute(visibility) || (defined(__GNUC__) && (__GNUC__ >= 4))) \
+ && !defined(__CYGWIN__) && !defined(__MINGW32__)
# define _X_EXPORT __attribute__((visibility("default")))
# define _X_HIDDEN __attribute__((visibility("hidden")))
# define _X_INTERNAL __attribute__((visibility("internal")))
@@ -109,29 +115,34 @@ in this Software without prior written authorization from The Open Group.
/* Bulk branch prediction hints via marking error path functions as "cold" */
/* requires xproto >= 7.0.25 */
-#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 403) /* 4.3+ */
+#if __has_attribute(__cold__) || \
+ (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 403)) /* 4.3+ */
# define _X_COLD __attribute__((__cold__))
#else
# define _X_COLD /* nothing */
#endif
/* Added in X11R6.9, so available in any version of modular xproto */
-#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 301)
+#if __has_attribute(deprecated) \
+ || (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 301)) \
+ || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5130))
# define _X_DEPRECATED __attribute__((deprecated))
#else /* not gcc >= 3.1 */
# define _X_DEPRECATED
#endif
/* requires xproto >= 7.0.17 */
-#if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)) \
- || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+#if __has_attribute(noreturn) \
+ || (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)) \
+ || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
# define _X_NORETURN __attribute((noreturn))
#else
# define _X_NORETURN
#endif /* GNUC */
/* Added in X11R6.9, so available in any version of modular xproto */
-#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 203)
+#if __has_attribute(__format__) \
+ || defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 203)
# define _X_ATTRIBUTE_PRINTF(x,y) __attribute__((__format__(__printf__,x,y)))
#else /* not gcc >= 2.3 */
# define _X_ATTRIBUTE_PRINTF(x,y)
@@ -140,14 +151,16 @@ in this Software without prior written authorization from The Open Group.
/* requires xproto >= 7.0.22 - since this uses either gcc or C99 variable
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)
+#if __has_attribute(nonnull) \
+ || defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303)
#define _X_NONNULL(args...) __attribute__((nonnull(args)))
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) /* C99 */
#define _X_NONNULL(...) /* */
#endif
/* requires xproto >= 7.0.22 */
-#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)
+#if __has_attribute(__unused__) \
+ || defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)
#define _X_UNUSED __attribute__((__unused__))
#else
#define _X_UNUSED /* */