[PATCH:x11proto] Add comments to Xfuncproto.h noting required xproto versions for each macro

Jeremy Huddleston jeremyhu at apple.com
Mon May 23 17:25:22 PDT 2011


Helpful.

Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>

On May 23, 2011, at 4:04 PM, Alan Coopersmith wrote:

> Saves time trawling git logs to determine what to put in the call to
> PKG_CHECK_MODULES in configure.ac when you start using one of these.
> 
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
> ---
> Xfuncproto.h.in |   11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
> 
> diff --git a/Xfuncproto.h.in b/Xfuncproto.h.in
> index 39ca3b2..0d7b8b7 100644
> --- a/Xfuncproto.h.in
> +++ b/Xfuncproto.h.in
> @@ -75,12 +75,14 @@ in this Software without prior written authorization from The Open Group.
> #endif
> #endif /* _XFUNCPROTOBEGIN */
> 
> +/* Added in X11R6.9, so available in any version of modular xproto */
> #if 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__)
> # define _X_EXPORT      __attribute__((visibility("default")))
> # define _X_HIDDEN      __attribute__((visibility("hidden")))
> @@ -95,6 +97,7 @@ in this Software without prior written authorization from The Open Group.
> # define _X_INTERNAL
> #endif /* GNUC >= 4 */
> 
> +/* requires xproto >= 7.0.9 */
> #if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303)
> # define _X_LIKELY(x)   __builtin_expect(!!(x), 1)
> # define _X_UNLIKELY(x) __builtin_expect(!!(x), 0)
> @@ -103,12 +106,14 @@ in this Software without prior written authorization from The Open Group.
> # define _X_UNLIKELY(x) (x)
> #endif
> 
> +/* 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))
> #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))
> # define _X_NORETURN __attribute((noreturn))
> @@ -116,18 +121,21 @@ in this Software without prior written authorization from The Open Group.
> # 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)
> # define _X_ATTRIBUTE_PRINTF(x,y) __attribute__((__format__(__printf__,x,y)))
> #else /* not gcc >= 2.3 */
> # define _X_ATTRIBUTE_PRINTF(x,y)
> #endif
> 
> +/* requires xproto >= 7.0.22 */
> #if defined(__GNUC__) &&  ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303)
> #define _X_NONNULL(args...)  __attribute__((nonnull(args)))
> #else
> #define _X_NONNULL(...)  /* */
> #endif
> 
> +/* requires xproto >= 7.0.22 */
> #if defined(__GNUC__) &&  ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)
> #define _X_UNUSED  __attribute__((__unused__))
> #else
> @@ -135,6 +143,8 @@ in this Software without prior written authorization from The Open Group.
> #endif
> 
> /* C99 keyword "inline" or equivalent extensions in pre-C99 compilers */
> +/* requires xproto >= 7.0.9
> +   (introduced in 7.0.8 but didn't support all compilers until 7.0.9) */
> #if defined(inline) /* assume autoconf set it correctly */ || \
>    (defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L)) /* C99 */ || \
>    (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550))
> @@ -146,6 +156,7 @@ in this Software without prior written authorization from The Open Group.
> #endif
> 
> /* C99 keyword "restrict" or equivalent extensions in pre-C99 compilers */
> +/* 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 */
> -- 
> 1.7.3.2
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
> 



More information about the xorg-devel mailing list