[PATCH] Make library headers compatible with old server builds

Peter Hutterer peter.hutterer at who-t.net
Tue Nov 3 19:39:10 PST 2009


On Tue, Nov 03, 2009 at 02:43:49PM -0800, Keith Packard wrote:
> Old servers (1.6 and before) included the extension library headers
> instead of using separate server header files. This patch makes the
> library headers compatibile with the server by hiding the library
> definitions from the server build.
> 
> Signed-off-by: Keith Packard <keithp at keithp.com>
> ---
>  include/X11/extensions/XShm.h |    2 ++
>  include/X11/extensions/dpms.h |    2 ++
>  include/X11/extensions/sync.h |    6 ++++++
>  3 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/include/X11/extensions/XShm.h b/include/X11/extensions/XShm.h
> index b58ca63..44eaf0b 100644
> --- a/include/X11/extensions/XShm.h
> +++ b/include/X11/extensions/XShm.h
> @@ -35,6 +35,7 @@ in this Software without prior written authorization from The Open Group.
>  #include <X11/Xfuncproto.h>
>  #include <X11/extensions/shm.h>
>  
> +#ifndef _XSHM_SERVER_
>  typedef unsigned long ShmSeg;
>  
>  typedef struct {
> @@ -132,5 +133,6 @@ Pixmap XShmCreatePixmap(
>  );
>  
>  _XFUNCPROTOEND
> +#endif /* _XSHM_SERVER_ */
>  
>  #endif
> diff --git a/include/X11/extensions/dpms.h b/include/X11/extensions/dpms.h
> index db06d47..9091fdc 100644
> --- a/include/X11/extensions/dpms.h
> +++ b/include/X11/extensions/dpms.h
> @@ -35,6 +35,7 @@ Equipment Corporation.
>  #include <X11/Xmd.h>
>  #include <X11/extensions/dpmsconst.h>
>  
> +#ifndef DPMS_SERVER
>  _XFUNCPROTOBEGIN
>  
>  extern Bool DPMSQueryExtension(Display *, int *, int *);
> @@ -48,6 +49,7 @@ extern Status DPMSForceLevel(Display *, CARD16);
>  extern Status DPMSInfo(Display *, CARD16 *, BOOL *);
>  
>  _XFUNCPROTOEND
> +#endif
>  
>  #endif /* !_X11_EXTENSIONS_DPMS_H */
>  
> diff --git a/include/X11/extensions/sync.h b/include/X11/extensions/sync.h
> index 2de222a..b327f69 100644
> --- a/include/X11/extensions/sync.h
> +++ b/include/X11/extensions/sync.h
> @@ -56,6 +56,10 @@ PERFORMANCE OF THIS SOFTWARE.
>  #include <X11/Xfuncproto.h>
>  #include <X11/extensions/syncconst.h>
>  
> +#ifdef _SYNC_SERVER
> +#include <X11/extensions/syncproto.h>
> +#else
> +
>  _XFUNCPROTOBEGIN
>  /* get rid of macros so we can define corresponding functions */
>  #undef XSyncIntToValue
> @@ -335,4 +339,6 @@ extern Status XSyncGetPriority(
>  
>  _XFUNCPROTOEND
>  
> +#endif /* _SYNC_SERVER */
> +
>  #endif /* _SYNC_H_ */
> -- 
> 1.6.5
> 

Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

Cheers,
  Peter


More information about the xorg-devel mailing list