Skip to content

Commit

Permalink
cgen: don't subtract null ptr in __offsetof
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Oct 6, 2023
1 parent 0bf85d0 commit f9f7a0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vlib/v/gen/c/cheaders.v
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ const c_common_macros = '
// for __offset_of
#ifndef __offsetof
#define __offsetof(PTYPE,FIELDNAME) ((size_t)((char *)&((PTYPE *)0)->FIELDNAME - (char *)0))
#define __offsetof(PTYPE,FIELDNAME) ((size_t)(&((PTYPE *)0)->FIELDNAME))
#endif
#define OPTION_CAST(x) (x)
Expand Down

0 comments on commit f9f7a0a

Please sign in to comment.