void
PerlIO_set_cnt(PerlIO *f, int cnt)
{
- if (cnt < -1 && ckWARN_s(WARN_INTERNAL))
+ dTHX;
+ if (cnt < -1 && ckWARN_d(WARN_INTERNAL))
Perl_warner(aTHX_ WARN_INTERNAL, "Setting cnt to %d\n",cnt);
#if defined(USE_STDIO_PTR) && defined(STDIO_CNT_LVALUE)
FILE_cnt(f) = cnt;
PerlIO_set_ptrcnt(PerlIO *f, STDCHAR *ptr, int cnt)
{
#ifdef FILE_bufsiz
+ dTHX;
STDCHAR *e = FILE_base(f) + FILE_bufsiz(f);
int ec = e - ptr;
- if (ptr > e + 1 && ckWARN_s(WARN_INTERNAL))
+ if (ptr > e + 1 && ckWARN_d(WARN_INTERNAL))
Perl_warner(aTHX_ WARN_INTERNAL, "Setting ptr %p > end+1 %p\n", ptr, e + 1);
- if (cnt != ec && ckWARN_s(WARN_INTERNAL))
+ if (cnt != ec && ckWARN_d(WARN_INTERNAL))
Perl_warner(aTHX_ WARN_INTERNAL, "Setting cnt to %d, ptr implies %d\n",cnt,ec);
#endif
#if defined(USE_STDIO_PTR) && defined(STDIO_PTR_LVALUE)
FILE_ptr(f) = ptr;
#else
+ dTHX;
Perl_croak(aTHX_ "Cannot set 'ptr' of FILE * on this system");
#endif
#if defined(USE_STDIO_PTR) && defined(STDIO_CNT_LVALUE)
FILE_cnt(f) = cnt;
#else
+ dTHX;
Perl_croak(aTHX_ "Cannot set 'cnt' of FILE * on this system");
#endif
}
#ifdef FILE_cnt
return FILE_cnt(f);
#else
+ dTHX;
Perl_croak(aTHX_ "Cannot get 'cnt' of FILE * on this system");
return -1;
#endif
#ifdef FILE_bufsiz
return FILE_bufsiz(f);
#else
+ dTHX;
Perl_croak(aTHX_ "Cannot get 'bufsiz' of FILE * on this system");
return -1;
#endif
#ifdef FILE_ptr
return FILE_ptr(f);
#else
+ dTHX;
Perl_croak(aTHX_ "Cannot get 'ptr' of FILE * on this system");
return NULL;
#endif
#ifdef FILE_base
return FILE_base(f);
#else
+ dTHX;
Perl_croak(aTHX_ "Cannot get 'base' of FILE * on this system");
return NULL;
#endif
#ifdef VMS
return fgetname(f,buf);
#else
+ dTHX;
Perl_croak(aTHX_ "Don't know how to get file name");
return NULL;
#endif