|
|
@ -2,7 +2,7 @@ |
|
|
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|
|
|
# |
|
|
|
# Filename: package/.../util-linux/0001-replace-container_of.patch |
|
|
|
# Copyright (C) 2013 The OpenSDE Project |
|
|
|
# Copyright (C) 2015 The OpenSDE Project |
|
|
|
# |
|
|
|
# More information can be found in the files COPYING and README. |
|
|
|
# |
|
|
@ -14,29 +14,13 @@ |
|
|
|
# version. |
|
|
|
# --- SDE-COPYRIGHT-NOTE-END --- |
|
|
|
|
|
|
|
This patch is fixing build issues by using a more simple but reasonable |
|
|
|
container_of function without abusing __typeof__. |
|
|
|
Besides that it is removing code duplication because the list_entry function |
|
|
|
macro is the same as container_of. |
|
|
|
|
|
|
|
Without the patch we are getting following error: |
|
|
|
------------------------------------------------------------------------------
|
|
|
|
sys-utils/prlimit.c: In function 'show_limits': |
|
|
|
sys-utils/prlimit.c:299:25: error: expected declaration specifiers or '...' before '(' token |
|
|
|
sys-utils/prlimit.c:299:25: error: '__mptr' undeclared (first use in this function) |
|
|
|
sys-utils/prlimit.c:299:25: note: each undeclared identifier is reported only once for each function it appears in |
|
|
|
sys-utils/prlimit.c: In function 'do_prlimit': |
|
|
|
sys-utils/prlimit.c:336:25: error: expected declaration specifiers or '...' before '(' token |
|
|
|
sys-utils/prlimit.c:336:25: error: '__mptr' undeclared (first use in this function |
|
|
|
------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
--- util-linux-2.23.2/include/c.h.orig 2013-08-27 10:32:00.890399403 +0200
|
|
|
|
+++ util-linux-2.23.2/include/c.h 2013-08-27 10:41:56.872040920 +0200
|
|
|
|
@@ -115,9 +115,8 @@
|
|
|
|
--- 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) ({ \
|
|
|
|
-#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) \
|
|
|
@ -44,13 +28,13 @@ sys-utils/prlimit.c:336:25: error: '__mptr' undeclared (first use in this functi |
|
|
|
#endif |
|
|
|
|
|
|
|
#ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME |
|
|
|
--- util-linux-2.23.2/include/list.h.orig 2013-08-27 10:35:19.025606381 +0200
|
|
|
|
+++ util-linux-2.23.2/include/list.h 2013-08-27 10:36:09.172435338 +0200
|
|
|
|
--- 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) ({ \
|
|
|
|
-#define list_entry(ptr, type, member) __extension__ ({ \
|
|
|
|
- const typeof( ((type *)0)->member ) *__mptr = (ptr); \
|
|
|
|
- (type *)( (char *)__mptr - offsetof(type,member) );})
|
|
|
|
-
|
|
|
|