X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=hivex%2Fhivex.c;h=85d6c7bee9c0097435a595ba5cd359914a98b260;hp=16be753b3c404c9a498f91a656021847b4634251;hb=a4e27cdf4d3b831792dd20d796dc98a5bc684290;hpb=e02f42cb1d7f60c9d2f020d7d8c1b5316fb61310 diff --git a/hivex/hivex.c b/hivex/hivex.c index 16be753..85d6c7b 100644 --- a/hivex/hivex.c +++ b/hivex/hivex.c @@ -18,11 +18,12 @@ * See file LICENSE for the full license. */ +#include + #include #include #include #include -#include #include #include #include @@ -30,6 +31,34 @@ #include #include #include +#ifdef HAVE_ENDIAN_H +#include +#endif +#ifdef HAVE_BYTESWAP_H +#include +#endif + +#if __BYTE_ORDER == __LITTLE_ENDIAN +#ifndef be32toh +#define be32toh(x) __bswap_32 (x) +#endif +#ifndef be64toh +#define be64toh(x) __bswap_64 (x) +#endif +#ifndef le32toh +#define le32toh(x) (x) +#endif +#else +#ifndef be32toh +#define be32toh(x) (x) +#endif +#ifndef be64toh +#define be64toh(x) (x) +#endif +#ifndef le32toh +#define le32toh(x) __bswap_32 (x) +#endif +#endif #include "hivex.h"