Re: [Mingw-w64-public] WIN32_LEAN_AND_MEAN changes from runtime-8 to runtime-9

2021-08-29 Thread sisyphus
On Fri, Aug 27, 2021 at 3:56 PM Biswapriyo Nath 
wrote:

> I don't know what the issue is. But to compile perl with mingw-w64
> toolchain, I have to patch some files. You can see the changes here
> https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-perl.
>
>
I'm dealing with the issue that is addressed by
https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-perl/007-use-winsock-socket-functions.patch

My solution (
https://github.com/Perl/perl5/issues/18911#issuecomment-907797056) involves
less patching.
It works fine with runtime v9, and also with runtime v8 (and presumably
earlier versions, too.
However, I wouldn't be surprised if it's inferior to your approach. I'll do
some checking and testing.

Cheers,
Rob

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] WIN32_LEAN_AND_MEAN changes from runtime-8 to runtime-9

2021-08-26 Thread Biswapriyo Nath
I don't know what the issue is. But to compile perl with mingw-w64
toolchain, I have to patch some files. You can see the changes here
https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-perl.


___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] WIN32_LEAN_AND_MEAN changes from runtime-8 to runtime-9

2021-08-26 Thread sisyphus
On Thu, Aug 26, 2021 at 10:12 PM Biswapriyo Nath 
wrote:

> The output from v9 matches with the output of same code compiled with
> MSVC.
>

Thank you - I've since checked that, and found it to be so. (Not that I
doubted you ;-)

Interestingly, perl builds fine for me straight out of the box with MSVC
(Visual Studio-2019).
This indicates that MSVC and MinGW-w64 (runtime-v9) must be taking
different paths through this particular area of the perl source.
I think my best chance is therefore to make the MinGW-w64 (runtime-v9)
compilation follow the same path as the MSVC compilation - but, of course,
that's OT for this list.

Cheers,
Rob

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] WIN32_LEAN_AND_MEAN changes from runtime-8 to runtime-9

2021-08-26 Thread Biswapriyo Nath
The output from v9 matches with the output of same code compiled with
MSVC. To detect poll.h, curl does this
https://github.com/curl/curl/blob/master/lib/select.h


___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] WIN32_LEAN_AND_MEAN changes from runtime-8 to runtime-9

2021-08-25 Thread sisyphus
Hi,
The following script demonstrates a change between runtime version 8 and
runtime version 9.

/***/

#define WIN32_LEAN_AND_MEAN

#include 

#ifndef _WINSOCKAPI_
#define NO__WINSOCKAPI_YET
#  include 
#  include 
#endif

#include 

int main(void) {

#ifdef NO__WINSOCKAPI_YET
printf("_WINSOCKAPI_ not defined by windows.h\n");
#endif

#ifdef _WINSOCKAPI_
printf("_WINSOCKAPI_ now defined\n");
#endif

#ifdef POLLWRBAND
printf("POLLWRBAND defined\n");
#endif

return 0;
}

/***/

With 64-bit gcc-11.1.0, runtime version 8, it outputs:

_WINSOCKAPI_ not defined by windows.h
_WINSOCKAPI_ now defined

With 64-bit gcc-11.1.0, runtime version 9 (and 64-bit gcc-11.2.0, runtime
version 9) it outputs:

_WINSOCKAPI_ not defined by windows.h
_WINSOCKAPI_ now defined
POLLWRBAND defined

This seems odd to me.
Is that as expected and intended ?

I use the mingw-w64 ports provided by https://winlibs.com/

If I don't define WIN32_LEAN_AND_MEAN, then the outputs match - with
POLLWRBAND not being defined for both runtime versions.

This behaviour with v9 breaks builds of recent versions of perl, where we
hit source code like:

#if (defined(HAS_POLL) && defined(I_POLL)) || defined(POLLWRBAND)
#  include 

This breaks the perl build when POLLWRBAND is defined because there is no
file name poll.h to be found.

The obvious solution is to not define WIN32_LEAN_MEAN, and that's a
solution that works, but I just wanted to first check here that the failure
lies with the perl source and not with version 9.0.0 of the runtime.

There is also one other issue for perl being triggered by runtime-9 (and
for which I do already have a workaround), but I haven't yet worked out
exactly how it's triggered - so I won't ask about it until I have more
complete information.

Cheers,
Rob

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public