develooper Front page | perl.perl5.porters | Postings from July 2003

Re: Which platforms need symbols to export to be explicitly listed?

Thread Previous | Thread Next
From:
Randy Kobes
Date:
July 30, 2003 10:31
Subject:
Re: Which platforms need symbols to export to be explicitly listed?
Message ID:
Pine.LNX.4.56.0307300919140.7422@theoryx5.uwinnipeg.ca
On Wed, 30 Jul 2003, Steve Hay wrote:

> Stas Bekman wrote:
> >
> >> Can't you do it transparently?
> >>
> >> #ifndef PerlIO_isutf8
> >> #defined PerlIO_isutf8 whatever
> >> #endif
> >
> > s/defined/define/
>
> Yes - that's probably easiest, isn't it?  Why didn't I think of that?
>
> However, I don't know what to #define PerlIO_isutf8 to.  The
> definition of the real PerlIO_isutf8() in Perl's perlio.c,
> needless to say, uses various other bits and pieces that are
> not exported, so how does one go about defining a replacement
> PerlIO_isutf8() for those perl-5.8.0's that are missing it?
>
> Unless someone can figure that out, I'll just enclose the XS code that
> uses PerlIO_isutf8() inside
>
> #if PERL_VERSION >= 8 && defined(PerlIO_isutf8)
> ...
> #endif
>
> rather than
>
> #if PERL_VERSION >= 8 && ((!defined(WIN32) && ...) || PERL_SUBVERSION >= 1)
> ...
> #endif
>
> like I was going to do.  I could probably drop the "PERL_VERSION >= 8 &&
> " bit there as well (I don't think PerlIO_isutf8() was in 5.6 or
> earlier), but better safe than sorry.

I don't have access to my Win32 machine with a compiler at the
moment to test this, but using "defined(PerlIO_isutf8)" in this
way may depend on the order the Perl header files are included,
as well as on the perl version. I checked for a 5.6.1, and
PerlIO_isutf8 isn't in the Perl headers, so this should be OK in
that case.  However, in the 5.8.0 C:\Perl\lib\CORE\perlio.h
there's

#ifndef PerlIO_isutf8
extern int PerlIO_isutf8(PerlIO *);
#endif

So, if this has been seen already, PerlIO_isutf8 would be
defined, but then a link error would result if PerlIO_isutf8
wasn't in the library.

-- 
best regards,
randy kobes

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About