1From d1f061dee88d2ea01601d6d2742635c66985ca61 Mon Sep 17 00:00:00 2001
2From: Michael Forney <mforney@mforney.org>
3Date: Sun, 16 Jun 2019 12:16:18 -0700
4Subject: [PATCH] Don't use statement expressions on non-GNU compilers
5
6---
7 include/list.h | 5 +++++
8 1 file changed, 5 insertions(+)
9
10diff --git a/include/list.h b/include/list.h
11index 5d86b131..7108cea7 100644
12--- a/include/list.h
13+++ b/include/list.h
14@@ -5,9 +5,14 @@
15
16 #include <stddef.h>
17
18+#ifdef __GNUC__
19 #define container_of(ptr, type, member) ({ \
20 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
21 (type *)( (char *)__mptr - offsetof(type,member) );})
22+#else
23+#define container_of(ptr, type, member) ( \
24+ (type *)( (char *)(ptr) - offsetof(type,member) ))
25+#endif
26
27 struct list_head {
28 struct list_head *next, *prev;
29--
302.20.1
31