develooper Front page | perl.perl5.porters | Postings from April 2019

[perl #133974] [Win32] Latest devel release (5.29.9) won't build if_WIN32_WINNT >= 0x0600

Thread Next
From:
sisyphus
Date:
April 2, 2019 04:29
Subject:
[perl #133974] [Win32] Latest devel release (5.29.9) won't build if_WIN32_WINNT >= 0x0600
Message ID:
rt-4.0.24-23864-1554179390-1641.133974-75-0@perl.org
# New Ticket Created by  sisyphus 
# Please include the string:  [perl #133974]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=133974 >


This will affect more than perl-5.29.9 - it's just that perl-5.29.9 is the
first version of perl that I've tried to build using a new gcc-8.2.1
toolchain built by the MSYS2 project.

BTW, where is _WIN32_WINNT actually being defined ?
I couldn't find it - but with this 8.2.1 toolchain it's being defined to
0x0601, while earlier compilers set it to 0x0502.

When it's >= 0x0600, extra stuff gets defined in winsock2.h (including the
symbol POLLWRBAND), and that prevents dist/IO from compiling.

A similar thing also happens with cpan/Socket, though I'm not sure whether
that also traces back to winsock2.h or whether the problem arises
elsewhere. (I didn't check on that.)

My workaround was to insert:

#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0502

at the top of:

 dist/IO/IO.xs
 dist/IO/poll.c
 cpan/Socket/Socket.xs

and that enables the build of 5.29.9 to proceed normally.

But is that the correct approach to dealing with this issue ?
Or should we be looking at modifying the perl source such that it doesn't
need to reduce the value of  _WIN32_WINNT whenever it's >= 0x0600 ?

Cheers,
Rob


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