From 8b2de449c7c594ae9f2a9bdce7841976ec882579 Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Wed, 24 Feb 2010 21:52:45 +0000 Subject: [PATCH] define le32toh and htole32, this allow to compile against libc that doesn't provide these functions (like Debian Lenny) --- libfreefare/freefare_internal.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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;