From 5c32e7960569ddeaa2ff5b847652d38ae6a1c07a Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Fri, 30 Dec 2016 09:45:08 -0800 Subject: [PATCH] Fix libpciaccess compilation on non-Linux systems Both gcc and clang have __builtin_bswap16 and __builtin_bswap32. --- xorg/X11R7.6/libpciaccess-0.12.0.patch | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 xorg/X11R7.6/libpciaccess-0.12.0.patch diff --git a/xorg/X11R7.6/libpciaccess-0.12.0.patch b/xorg/X11R7.6/libpciaccess-0.12.0.patch new file mode 100644 index 00000000..7d45d0b2 --- /dev/null +++ b/xorg/X11R7.6/libpciaccess-0.12.0.patch @@ -0,0 +1,24 @@ +diff -ur a/src/common_interface.c b/src/common_interface.c +--- a/src/common_interface.c ++++ b/src/common_interface.c +@@ -51,6 +51,20 @@ + # define HTOLE_32(x) (x) + #endif /* linux */ + ++#elif defined(__GNUC__) || defined(__clang__) ++ ++#if __BYTE_ORDER == __BIG_ENDIAN ++# define LETOH_16(x) __builtin_bswap16(x) ++# define HTOLE_16(x) __builtin_bswap16(x) ++# define LETOH_32(x) __builtin_bswap32(x) ++# define HTOLE_32(x) __builtin_bswap32(x) ++#else ++# define LETOH_16(x) (x) ++# define HTOLE_16(x) (x) ++# define LETOH_32(x) (x) ++# define HTOLE_32(x) (x) ++#endif /* gcc or clang */ ++ + #elif defined(__sun) + + #include