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

Commit 392c528

Browse files
WalterBrightdlang-bot
authored andcommitted
fix Issue 23067 - importC: offsetof macro assumes size_t is defined
1 parent 9631e0d commit 392c528

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/importc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@
5454
/****************************
5555
* Define it to do what other C compilers do.
5656
*/
57-
#define __builtin_offsetof(t,i) ((size_t)((char *)&((t *)0)->i - (char *)0))
57+
#define __builtin_offsetof(t,i) ((typeof(sizeof(0)))((char *)&((t *)0)->i - (char *)0))

0 commit comments

Comments
 (0)