Merged the hostap_2.6 updates, and the Leap of Faith work, from the hostap_update...
[mech_eap.git] / libeap / src / utils / platform.h
diff --git a/libeap/src/utils/platform.h b/libeap/src/utils/platform.h
new file mode 100644 (file)
index 0000000..813987e
--- /dev/null
@@ -0,0 +1,21 @@
+#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 get_unaligned(p)                                       \
+({                                                             \
+       struct packed_dummy_struct {                            \
+               typeof(*(p)) __val;                             \
+       } __attribute__((packed)) *__ptr = (void *) (p);        \
+                                                               \
+       __ptr->__val;                                           \
+})
+#define get_unaligned_le16(p)  le16_to_cpu(get_unaligned((le16 *)(p)))
+#define get_unaligned_le32(p)  le32_to_cpu(get_unaligned((le32 *)(p)))
+
+#endif /* PLATFORM_H */