From dcdce14741c613f64b0d94810c20961d134baa8b Mon Sep 17 00:00:00 2001 From: Ilan Peer Date: Thu, 24 Apr 2014 08:45:34 +0300 Subject: [PATCH] radiotap: Fix compilation for systems without le16toh/le32toh These functions are not standard and do not exist in all systems, e.g., variants of Android. Instead use the macros defined in common.h. Signed-off-by: Ilan Peer --- src/utils/platform.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/utils/platform.h b/src/utils/platform.h index 9ab734b95..46cfe785e 100644 --- a/src/utils/platform.h +++ b/src/utils/platform.h @@ -1,12 +1,12 @@ -#include -#include -#ifndef _BSD_SOURCE -#define _BSD_SOURCE -#endif -#include +#ifndef PLATFORM_H +#define PLATFORM_H + +#include "includes.h" +#include "common.h" + +#define le16_to_cpu le_to_host16 +#define le32_to_cpu le_to_host32 -#define le16_to_cpu le16toh -#define le32_to_cpu le32toh #define get_unaligned(p) \ ({ \ struct packed_dummy_struct { \ @@ -17,3 +17,5 @@ }) #define get_unaligned_le16(p) le16_to_cpu(get_unaligned((uint16_t *)(p))) #define get_unaligned_le32(p) le32_to_cpu(get_unaligned((uint32_t *)(p))) + +#endif /* PLATFORM_H */