aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-08-19 20:16:20 +0200
committerSverker Eriksson <[email protected]>2016-08-24 16:48:16 +0200
commit6cba7d35d3322db8acc25c45889c2b03f1b2f4c2 (patch)
treeb7d11a9232f37c786f3c53bccf8419c2ff69549f /erts/emulator
parent71894a879d6254693791585246ce340dd7414b82 (diff)
downloadotp-6cba7d35d3322db8acc25c45889c2b03f1b2f4c2.tar.gz
otp-6cba7d35d3322db8acc25c45889c2b03f1b2f4c2.tar.bz2
otp-6cba7d35d3322db8acc25c45889c2b03f1b2f4c2.zip
erts: Add ErtsContainerStruct_ for array members
that otherwise may produce warning from compilers that think T* and T[] are incompatible types (?).
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/sys.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h
index dfe82cab44..2d0628f70e 100644
--- a/erts/emulator/beam/sys.h
+++ b/erts/emulator/beam/sys.h
@@ -99,6 +99,10 @@
#define ErtsContainerStruct(ptr, type, member) \
((type *)((char *)(1 ? (ptr) : &((type *)0)->member) - offsetof(type, member)))
+/* Use this variant when the member is an array */
+#define ErtsContainerStruct_(ptr, type, memberv) \
+ ((type *)((char *)(1 ? (ptr) : ((type *)0)->memberv) - offsetof(type, memberv)))
+
#if defined (__WIN32__)
# include "erl_win_sys.h"
#else