[Xcb] [PATCH:util-cursor] Use LE_32 macro from <sys/byteorder.h> on Solaris versions without le32toh()

Alan Coopersmith alan.coopersmith at oracle.com
Sat Oct 5 21:32:28 PDT 2013


Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 configure.ac               |    3 ++-
 cursor/parse_cursor_file.c |    6 ++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 1510e51..55cc06d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,8 @@ XCB_UTIL_COMMON([1.4], [1.6])
 
 AM_MISSING_PROG([GPERF], [gperf])
 
-AC_CHECK_HEADERS([endian.h sys/endian.h], [break])
+AC_CHECK_HEADERS([endian.h sys/endian.h sys/byteorder.h], [break])
+AC_CHECK_FUNCS([le32toh])
 
 PKG_CHECK_MODULES(XCB_RENDER, xcb-render)
 PKG_CHECK_MODULES(XCB_RENDERUTIL, xcb-renderutil)
diff --git a/cursor/parse_cursor_file.c b/cursor/parse_cursor_file.c
index 8c52cfe..30f7df5 100644
--- a/cursor/parse_cursor_file.c
+++ b/cursor/parse_cursor_file.c
@@ -42,6 +42,12 @@
 #ifdef HAVE_SYS_ENDIAN_H
 #include <sys/endian.h>
 #endif
+#ifdef HAVE_SYS_BYTEORDER_H
+#include <sys/byteorder.h>
+# ifndef HAVE_LE32TOH
+#  define le32toh(x) LE_32(x)
+# endif
+#endif
 
 #include <xcb/xcb.h>
 
-- 
1.7.9.2



More information about the Xcb mailing list