Nick Ing-Simmons wrote:
Steve Hay <[EMAIL PROTECTED]> writes:I added the following:
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:Under perl5.6 a PerlIO * _is_ a FILE * so PerlIO_importFILE
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?
can be a no-op macro (I think this is still true under PERL_IMPLICIT_SYS).
#if PERL_VERSION <= 6
# define PerlIO_importFILE(f, fl) (f)
#endif
to the head of my XS file, before the Perl headers are included, which at least got it linking OK, but I still had two compiler warnings:
warning C4133: '=' : incompatible types - from 'struct_iobuf *' to 'struct _PerlIO *'
warning C4133: 'function' : incompatible types - from 'struct _PerlIO *' to 'struct _iobuf *'
These related to a C function in the "top half" of my XS file in which one argument was a "PerlIO **", so I also added
# define PerlIO FILE
to the #if...#endif above, and now it all compiles and links cleanly under Perl 5.6.1 with and without PERL_IMPLICIT_SYS and also Perl 5.8.0 with and without PERL_IMPLICIT_SYS.
Thanks for all the help!
- Steve
