aboutsummaryrefslogtreecommitdiffstats
path: root/libc/stdio/fileext.h
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stdio/fileext.h')
-rw-r--r--libc/stdio/fileext.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/libc/stdio/fileext.h b/libc/stdio/fileext.h
index 75230cda1..209815aee 100644
--- a/libc/stdio/fileext.h
+++ b/libc/stdio/fileext.h
@@ -47,7 +47,12 @@ struct __sfileext {
bool _stdio_handles_locking; /* __fsetlocking support */
};
+#if defined(__cplusplus)
+#define _EXT(fp) reinterpret_cast<__sfileext*>((fp)->_ext._base)
+#else
#define _EXT(fp) ((struct __sfileext *)((fp)->_ext._base))
+#endif
+
#define _UB(fp) _EXT(fp)->_ub
#define _FLOCK(fp) _EXT(fp)->_lock