diff --git a/libfreefare/freefare_internal.h b/libfreefare/freefare_internal.h index a247c72..4a9f5f8 100644 --- a/libfreefare/freefare_internal.h +++ b/libfreefare/freefare_internal.h @@ -20,6 +20,18 @@ #ifndef __FREEFARE_INTERNAL_H__ #define __FREEFARE_INTERNAL_H__ +#if !defined(le32toh) || !defined(htole32) + #include + #if BYTE_ORDER == LITTLE_ENDIAN + #define le32toh(x) (x) + #define htole32(x) bswap_32(x) + #else + #define le32toh(x) bswap_32(x) + #define htole32(x) (x) + #endif +#endif + + struct mad_sector_0x00; struct mad_sector_0x10;