1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

compiler: __offsetof keyword for C offsetof() macro

This commit is contained in:
Emily Hudson
2019-12-21 21:46:09 +00:00
committed by Alexander Medvednikov
parent 31b7991a93
commit 8512c9fc9d
4 changed files with 23 additions and 2 deletions

View File

@ -20,6 +20,10 @@ const (
#define TCCSKIP(x)
#endif
// for __offset_of
#define __offsetof(s,memb) \\
((size_t)((char *)&((s *)0)->memb - (char *)0))
#define OPTION_CAST(x) (x)
'
c_headers = '