Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 571de3c

Browse files
WalterBrightdlang-bot
authored andcommitted
fix Issue 22756 - ImportC: no __builtin_offsetof
1 parent 6feed76 commit 571de3c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/importc.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,8 @@
4343
* when placed before an expression.
4444
*/
4545
#define __extension__ // ignore it, as ImportC doesn't do warnings
46+
47+
/****************************
48+
* Define it to do what other C compilers do.
49+
*/
50+
#define __builtin_offset(t,i) ((size_t)((char *)&((t *)0)->i - (char *)0))

0 commit comments

Comments
 (0)