[PATCH] Make sure X_BYTE_ORDER is defined for servermd.h
Michel Dänzer
michel at daenzer.net
Wed Jul 30 01:26:06 PDT 2014
On 29.07.2014 05:02, Keith Packard wrote:
> Use dix-config.h when present, otherwise use xorg-server.h
>
> Signed-off-by: Keith Packard <keithp at keithp.com>
> ---
> include/servermd.h | 4 ++++
> include/xorg-server.h.in | 3 +++
> 2 files changed, 7 insertions(+)
>
> diff --git a/include/servermd.h b/include/servermd.h
> index 0132d67..b3fe6df 100644
> --- a/include/servermd.h
> +++ b/include/servermd.h
> @@ -47,7 +47,11 @@ SOFTWARE.
> #ifndef SERVERMD_H
> #define SERVERMD_H 1
>
> +#ifdef HAVE_DIX_CONFIG_H
> #include "dix-config.h"
> +#else
> +#include "xorg-server.h"
> +#endif
This works, but how about this on top:
diff --git a/include/servermd.h b/include/servermd.h
index b3fe6df..c88a542 100644
--- a/include/servermd.h
+++ b/include/servermd.h
@@ -47,10 +47,9 @@ SOFTWARE.
#ifndef SERVERMD_H
#define SERVERMD_H 1
-#ifdef HAVE_DIX_CONFIG_H
-#include "dix-config.h"
-#else
-#include "xorg-server.h"
+#if !defined(_DIX_CONFIG_H_) && !defined(_XORG_SERVER_H_)
+#error Drivers must include xorg-server.h before any other xserver headers
+#error xserver code must include dix-config.h before any other headers
#endif
#if X_BYTE_ORDER == X_LITTLE_ENDIAN
The same check could be added to other server headers.
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
More information about the xorg-devel
mailing list