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