|
@@ -0,0 +1,31 @@
|
|
|
+http://permalink.gmane.org/gmane.linux.bluez.kernel/22306
|
|
|
+
|
|
|
+[Retrieved from:
|
|
|
+https://428282.bugs.gentoo.org/attachment.cgi?id=319374]
|
|
|
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
|
|
+
|
|
|
+diff --git a/lib/bluetooth.h b/lib/bluetooth.h
|
|
|
+index 0541842..5b2153d 100644
|
|
|
+--- a/lib/bluetooth.h
|
|
|
++++ b/lib/bluetooth.h
|
|
|
+@@ -140,16 +140,16 @@ enum {
|
|
|
+ #define bt_get_unaligned(ptr) \
|
|
|
+ ({ \
|
|
|
+ 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)
|
|
|
+
|