Steve Hay <[EMAIL PROTECTED]> writes:
>>Yes that is it. You need to use PerlSIO_fxxxxx() for Standard IO under 
>>PERL_IMPLICIT_SYS.
>>  
>>
>Thanks for the reply.  That fixed it straight away.  Perhaps somebody 
>could do a DOC PATCH for Perl about this if it hasn't already been done. 
> My Perl 5.8.0 POD documents refer to lots of PerlIO_*() functions, but 
>grep()ing the entire POD sources for PerlSIO_*() I see no mention of 
>them at all.

The whole PERL_IMPLICIT_SYS thing is really an ActiveState invention
and PerlSIO_* should really be documented along with PerlLIO_*()
PerlProc_*() and various others.

I think I understand how they work, but in general for PERL_IMPLICIT_SYS
HowTo questions it is probably best to ask ActiveState.

>
>Two more questions about this:
>
>1) Am I right in thinking that these PerlSIO_*() functions do the "right 
>thing" where PERL_IMPLICIT_SYS is not defined?  (It appears to from 
>repeating the build with "my" (non-ActivePerl) Perl.)

Yes they do.

>
>2) What's the best way to go about getting my XS to build under both 
>Perl 5.8.0 and Perl 5.6.x as well?  The PerlSIO_*() functions don't 
>appear to be in those older versions.  Is it simply by way of #if/#else 
>statements making use of the #define's in patchlevel.h that specify the 
>Perl revision/version/subversion?

Perl5.8 introduced _real_ PerlIO *.
The things that are now PerlSIO_xxxx() used to be PerlIO_xxxx()
for PERL_IMPLICIT_SYS - but that got in the way of using stdio under
PerlIO. 


>
>Also, under Perl 5.6.1/PERL_IMPLICIT_SYS the compiler is happy about 
>fclose(), but seems to have a problem with the PerlIO_importFILE() function:
>
>warning C4047: 'function' : 'int ' differs in levels of indirection from 
>'const char *'
>warning C4024: 'PerlIO_importFILE' : different types for formal and 
>actual parameter 2
>warning C4133: 'function' : incompatible types - from 'struct _PerlIO *' 
>to 'struct _iobuf *'
>
>The first two warnings here seem to stem from the odd prototype that is 
>given in the "extern" declaration in iperlsys.h under PERL_IMPLICIT_SYS:
>
>extern PerlIO *    PerlIO_importFILE    (FILE *,int);
>
>(I was expecting (FILE *, const char *) here, which is what it now is 
>under Perl 5.8.0 [in perlio.h] -- was that just a bug in Perl 5.6.x?)
>
>The last warning looks similar to problem that I had with fclose() under 
>Perl 5.8.0/PERL_IMPLICIT_SYS.  The linker also bombs out with:
>
>error LNK2001: unresolved external symbol _PerlIO_importFILE
>
>Where is this "extern" PerlIO_importFILE() supposed to come from?

Under perl5.6 a PerlIO * _is_ a FILE * so PerlIO_importFILE
can be a no-op macro (I think this is still true under 
PERL_IMPLICIT_SYS).




-- 
Nick Ing-Simmons
http://www.ni-s.u-net.com/

Reply via email to