libelf portability
PATCH 1/1 libelf portability
Hi!
Attached patch adds support for OpenBSD and NetBSD to libelf in relation to tools/libxc.
Signed-off-by Christoph Egger <[email protected]>
Signature · 12 lines
AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Geschäftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplementär: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Geschäftsführer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy
xen/common/libelf/libelf-private.h +13 -1
@@ -33,8 +33,20 @@#define bswap_16 (x) BSWAP_16(x)#define bswap_32 (x) BSWAP_32(x)#define bswap_64 (x) BSWAP_64(x) +#elif defined(__NetBSD__) +#include <sys/bswap.h> +#define bswap_16 (x) bswap16(x) +#define bswap_32 (x) bswap32(x) +#define bswap_64 (x) bswap64(x) +#elif defined(__OpenBSD__) +#include <machine/endian.h> +#define bswap_16 (x) swap16(x) +#define bswap_32 (x) swap32(x) +#define bswap_64 (x) swap64(x) +#elif defined(__linux__) || defined(__Linux__) +#include <byteswap.h> #else -#include <byteswap.h> +#error Unsupported OS#endif #include <xen/elfnote.h> #include <xen/libelf.h>
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel