mirror of
https://github.com/vlang/v.git
synced 2025-09-18 20:07:02 -04:00
cgen: don't subtract null ptr in __offsetof
, fix for v -cstrict -cc clang-14 cmd/tools/vpm.v
and other programs using import net.http
(fix #19222) (#19520)
This commit is contained in:
parent
aba38d167b
commit
1e89b0b0dd
@ -360,7 +360,7 @@ const c_common_macros = '
|
|||||||
|
|
||||||
// for __offset_of
|
// for __offset_of
|
||||||
#ifndef __offsetof
|
#ifndef __offsetof
|
||||||
#define __offsetof(PTYPE,FIELDNAME) ((size_t)((char *)&((PTYPE *)0)->FIELDNAME - (char *)0))
|
#define __offsetof(PTYPE,FIELDNAME) ((size_t)(&((PTYPE *)0)->FIELDNAME))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define OPTION_CAST(x) (x)
|
#define OPTION_CAST(x) (x)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user