summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2014-07-01 22:31:47 +0100
committerBen Skeggs <bskeggs@redhat.com>2014-07-03 10:09:34 +1000
commitedd1608c397ebcf487b84948031f7807178e5e4d (patch)
treebab2df3a5174ca5ff2013bbcfa72c148de8542fb
parentf6c1c755d8230494c8115e2c7899a85663f5c176 (diff)
xorg_list: define the xorg_list* symbols
...when building against pre 1.12 x. The build will fail as earlier versions of X were missing the xorg_ prefix of the symbols - struct and util functions. Reported-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--configure.ac13
-rw-r--r--src/drmmode_display.c8
-rw-r--r--src/nv_driver.c5
3 files changed, 26 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 92e047a..2177c24 100644
--- a/configure.ac
+++ b/configure.ac
@@ -127,6 +127,19 @@ AC_SUBST([DRIVER_NAME])
XORG_MANPAGE_SECTIONS
XORG_RELEASE_VERSION
+AC_CHECK_HEADERS([list.h],
+ [have_list_h="yes"], [have_list_h="no"],
+ [#include <X11/Xdefs.h>
+ #include "xorg-server.h"])
+
+if test "x$have_list_h" = xyes; then
+ AC_CHECK_DECL(xorg_list_init,
+ [AC_DEFINE(HAVE_XORG_LIST, 1, [Have xorg_list API])], [],
+ [#include <X11/Xdefs.h>
+ #include "xorg-server.h"
+ #include "list.h"])
+fi
+
AC_MSG_CHECKING([whether to include GLAMOR support])
AC_COMPILE_IFELSE(AC_LANG_PROGRAM(
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 58b5e07..45225ad 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -126,6 +126,14 @@ drmmode_swap(ScrnInfoPtr scrn, uint32_t next, uint32_t *prev)
drmmode->fb_id = next;
}
+#if !HAVE_XORG_LIST
+#define xorg_list list
+#define xorg_list_for_each_entry list_for_each_entry
+#define xorg_list_for_each_entry_safe list_for_each_entry_safe
+#define xorg_list_append list_append
+#define xorg_list_del list_del
+#endif
+
struct drmmode_event {
struct xorg_list head;
drmmode_ptr drmmode;
diff --git a/src/nv_driver.c b/src/nv_driver.c
index 44a0963..2fa3802 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -37,6 +37,11 @@
#include "nouveau_present.h"
#include "nouveau_sync.h"
+#if !HAVE_XORG_LIST
+#define xorg_list_is_empty list_is_empty
+#define xorg_list_for_each_entry list_for_each_entry
+#endif
+
/*
* Forward definitions for the functions that make up the driver.
*/