bs.fread((char*)(argp),(len),(nelem),bs.data)
#define BGET_FGETC() bs.fgetc(bs.data)
#else
-#define BGET_FREAD(argp, len, nelem) fread((argp), (len), (nelem), fp)
-#define BGET_FGETC() getc(fp)
+#define BGET_FREAD(argp, len, nelem) PerlIO_fread((argp), (len), (nelem), fp)
+#define BGET_FGETC() PerlIO_getc(fp)
#endif /* INDIRECT_BGET_MACROS */
#define BGET_U32(arg) \
BGET_U32(arg); \
if (arg) { \
New(666, pv.xpv_pv, arg, char); \
- fread(pv.xpv_pv, 1, arg, fp); \
+ PerlIO_fread(pv.xpv_pv, 1, arg, fp); \
pv.xpv_len = arg; \
pv.xpv_cur = arg - 1; \
} else { \