OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.8 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../util-linux/0001-replace-container_of.patch
  5. # Copyright (C) 2015 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. --- util-linux-2.27/include/c.h.orig 2015-08-04 13:29:05.000000000 +0200
  17. +++ util-linux-2.27/include/c.h 2015-09-30 22:29:02.679788072 +0200
  18. @@ -122,9 +122,8 @@
  19. #endif
  20. #ifndef container_of
  21. -#define container_of(ptr, type, member) __extension__ ({ \
  22. - const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \
  23. - (type *)( (char *)__mptr - offsetof(type,member) );})
  24. +#define container_of(ptr, type, member) \
  25. + ((type *)((char *)(ptr) - offsetof(type, member)))
  26. #endif
  27. #ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME
  28. --- util-linux-2.27/include/list.h.orig 2015-05-07 11:42:00.000000000 +0200
  29. +++ util-linux-2.27/include/list.h 2015-09-30 22:30:35.323788072 +0200
  30. @@ -166,10 +166,7 @@
  31. * @type: the type of the struct this is embedded in.
  32. * @member: the name of the list_struct within the struct.
  33. */
  34. -#define list_entry(ptr, type, member) __extension__ ({ \
  35. - const typeof( ((type *)0)->member ) *__mptr = (ptr); \
  36. - (type *)( (char *)__mptr - offsetof(type,member) );})
  37. -
  38. +#define list_entry container_of
  39. #define list_first_entry(head, type, member) \
  40. ((head) && (head)->next != (head) ? list_entry((head)->next, type, member) : NULL)