develooper Front page | perl.perl5.porters | Postings from February 2018

Re: Windows doesn't recognize ssize_t XS typemap

Thread Previous | Thread Next
From:
ilmari
Date:
February 9, 2018 14:23
Subject:
Re: Windows doesn't recognize ssize_t XS typemap
Message ID:
d8j7ermw8cl.fsf@dalvik.ping.uio.no
ilmari@ilmari.org (Dagfinn Ilmari Mannsåker) writes:

> Karl Williamson <public@khwilliamson.com> writes:
>
>> The available typemaps displayed on Linux include ssize_t, but Windows
>> doesn't like it.  Any ideas, or should I file a ticket?
>
> The ssize_t type is not specified by ISO C (only POSIX) and is not
> provided by MSVC.  You should use the metaconfig-provided SSize_t
> instead.

However, the default typemap does not include Size_t or SSize_t.  I
propose adding these, so we can have portable signed sizes in XS.

I've pushed this, plus changing all ssize_t-s in the code to SSize_t to
the branch smoke-me/ilmari/SSize_t.

On the other hand, I don't understand the reasoning behind making the
parameter in XS::APITest::test_utf8_to_bytes() signed.  utf8_to_bytes()
takes a STRLEN*, so the ssize_t (or SSize_t) parameter causes a compiler
warning.  The commit message that made the change just says «For testing
purposes, this parameter should be signed when it comes from perl
space».

- ilmari
-- 
- Twitter seems more influential [than blogs] in the 'gets reported in
  the mainstream press' sense at least.               - Matt McLeod
- That'd be because the content of a tweet is easier to condense down
  to a mainstream media article.                      - Calle Dybedahl

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