diff --git a/lib/bluetooth.h b/lib/bluetooth.h
index 61c1f9a..f214d81 100644
--- a/lib/bluetooth.h
+++ b/lib/bluetooth.h
/* Bluetooth unaligned access */
#define bt_get_unaligned(ptr) \
-({ \
+__extension__ ({ \
struct __attribute__((packed)) { \
- typeof(*(ptr)) __v; \
- } *__p = (typeof(__p)) (ptr); \
+ __typeof__(*(ptr)) __v; \
+ } *__p = (__typeof__(__p)) (ptr); \
__p->__v; \
})
#define bt_put_unaligned(val, ptr) \
do { \
struct __attribute__((packed)) { \
- typeof(*(ptr)) __v; \
- } *__p = (typeof(__p)) (ptr); \
+ __typeof__(*(ptr)) __v; \
+ } *__p = (__typeof__(__p)) (ptr); \
__p->__v = (val); \
} while(0)