texinfo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using Perl's cc


From: Eli Zaretskii
Subject: Re: Using Perl's cc
Date: Sun, 05 Jul 2015 19:20:07 +0300

> Date: Sun, 5 Jul 2015 16:41:30 +0100
> From: Gavin Smith <address@hidden>
> Cc: address@hidden
> 
> On 5 July 2015 at 16:15, Eli Zaretskii <address@hidden> wrote:
> >> Date: Sun, 5 Jul 2015 15:50:01 +0100
> >> From: Gavin Smith <address@hidden>
> >> Cc: address@hidden
> >>
> >> It would be nice to be able to fall back to using alternative
> >> functions on other platforms as well, so I'd suggest not making it
> >> Windows-specific.
> >
> > Windows provides an API for converting from UTF-8 to UTF-16, and I
> > intended to use it.  Also, the functions that accept a wchar_t
> > argument need to be different depending on whether wchar_t is UCS-4 or
> > UTF-16.  I think this makes the code sufficiently different to warrant
> > separate implementations.
> 
> I thought you would have to write your own iswupper etc. so using the
> system's wchar_t doesn't gain you anything.

I probably will write some of them (iswspace, for example).  But
coming up with my own iswupper would need huge tables, an excerpt from
the Unicode character database, so using system APIs (and the system
wchar_t that goes with them) is a significant gain.

> If I was writing it myself, I'd convert a single UTF-8 codepoint
> into a 32-bit integer (I think that's UCS-4)

The basic code to produce a 32-bit Unicode codepoint from a valid
UTF-8 sequence is easy.  The problem, as always, is with corner cases,
like invalid sequences etc., so using existing APIs is still a gain.

> >> There's two big hurdles to running the extension module: one is
> >> building it, which it looks like you will manage to do; but the other
> >> is loading it from a running Perl instance, and I still don't know if
> >> that will succeed.
> 
> > What are the hurdles?  I'd expect Perl to be able to load a .dll file
> > on Windows exactly like it loads a .so file on Unix.  The only issue
> > might be telling Perl to look in the directory where Texinfo's "make
> > install" puts them, but I expect texi2any to take care of that
> > already, no?
> 
> If it wasn't compiled properly, e.g. with the wrong flags or header
> files. Perl may find the .dll file and load it and things may break
> afterwards when the code in the extension runs.

We shall see.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]