Guest User

Untitled

a guest
May 22nd, 2018
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. xszyjan@uw000558:~/bluez_upstream$ git show
  2. commit ffc335a4c2edd7a95509005c78e345f8b310d102
  3. Author: Szymon Janc <szymon.janc@tieto.com>
  4. Date: Fri Jan 13 08:44:08 2012 +0100
  5.  
  6. Fix compilation of C++ programs that include <bluetooth/bluetooth.h>
  7.  
  8. diff --git a/lib/bluetooth.h b/lib/bluetooth.h
  9. index 5bd4f03..b4891ef 100644
  10. --- a/lib/bluetooth.h
  11. +++ b/lib/bluetooth.h
  12. @@ -111,17 +111,19 @@ enum {
  13. /* Bluetooth unaligned access */
  14. #define bt_get_unaligned(ptr) \
  15. ({ \
  16. - struct __attribute__((packed)) { \
  17. + struct __s { \
  18. typeof(*(ptr)) __v; \
  19. - } *__p = (void *) (ptr); \
  20. + } __attribute__((packed)) ; \
  21. + struct __s *__p = (struct __s *) (ptr); \
  22. __p->__v; \
  23. })
  24.  
  25. #define bt_put_unaligned(val, ptr) \
  26. do { \
  27. - struct __attribute__((packed)) { \
  28. + struct __s { \
  29. typeof(*(ptr)) __v; \
  30. - } *__p = (void *) (ptr); \
  31. + }__attribute__((packed)) ; \
  32. + struct __s *__p = (struct __s *) (ptr); \
  33. __p->__v = (val); \
  34. } while(0)
Add Comment
Please, Sign In to add comment