svn commit: r246189 - user/adrian/ath_radar_stuff/lib/libradarpkt
Adrian Chadd
adrian at FreeBSD.org
Fri Feb 1 01:35:00 UTC 2013
Author: adrian
Date: Fri Feb 1 01:34:59 2013
New Revision: 246189
URL: http://svnweb.freebsd.org/changeset/base/246189
Log:
Oops, add missing file.
Added:
user/adrian/ath_radar_stuff/lib/libradarpkt/platform.h
Added: user/adrian/ath_radar_stuff/lib/libradarpkt/platform.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ user/adrian/ath_radar_stuff/lib/libradarpkt/platform.h Fri Feb 1 01:34:59 2013 (r246189)
@@ -0,0 +1,19 @@
+#include <stddef.h>
+#include <errno.h>
+#ifndef _BSD_SOURCE
+#define _BSD_SOURCE
+#endif
+#include <sys/endian.h>
+
+#define le16_to_cpu le16toh
+#define le32_to_cpu le32toh
+#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((uint16_t *)(p)))
+#define get_unaligned_le32(p) le32_to_cpu(get_unaligned((uint32_t *)(p)))
More information about the svn-src-user
mailing list