Nick Ing-Simmons wrote:

Steve Hay <[EMAIL PROTECTED]> writes:

I suspect the difference arises from the use/non-use of PERL_IMPLICIT_SYS, but I can't pin it down.

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.

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.)

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?

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?

Thanks again,

Steve Hay



Reply via email to