Skip to content

Commit 8aa920a

Browse files
committed
Define typeof for C < 23
This prevents failures when compiling with --std=cVV for VV < 23. While this is still non-standard C, __typeof__ is supported very widely, probably wider than the platforms where R itself is ported to.
1 parent 0f166cb commit 8aa920a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/fread.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ static void Field(FieldParseContext *ctx);
117117
#define IGNORE_BUMP(x) abs(x)
118118
#define TOGGLE_BUMP(x) (-x)
119119

120+
#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311L
121+
# define typeof(x) __typeof__(x) // nonstandard but widely supported extension
122+
#endif
120123
#define OFFSET_POINTER(x, offset) ((typeof(x))((char*)x + (offset)))
121124

122125
//=================================================================================================

0 commit comments

Comments
 (0)