Re: [Mingw-w64-public] Patch WS2 Inline Functions

2021-07-13 Thread Martin Storsjö
On Tue, 13 Jul 2021, Jonathan Marler wrote: I think the ideal solution would allow programs to take the address of these functions since MSVC allows it. Well even with static inline, their address can be taken just fine, it's just not identical across all translation units. I don't see that a

Re: [Mingw-w64-public] Increasing the stack programmatically on mingw32

2021-07-13 Thread Jeremy Drake via Mingw-w64-public
On Tue, 13 Jul 2021, Tempelaar E. (Erik) wrote: > For this to work correctly the stack size was increased somewhere in the > past; on Unix using setrlimit, in mingw32 with 'LDFLAGS += > -Wl,--stack,0x0200' (32MiB) > I've seen the "processthreadsapi" and noticed that it has a 'dwStackSize'

Re: [Mingw-w64-public] Patch WS2 Inline Functions

2021-07-13 Thread Jonathan Marler
I think the ideal solution would allow programs to take the address of these functions since MSVC allows it. For this we could either find a version of inline attributes that allows emission and doesn't cause duplicate symbol errors during link, or, keep the headers as they are and provide the the

[Mingw-w64-public] [PATCH] headers: Import propvarutil.h from wine

2021-07-13 Thread Biswapriyo Nath
From ad16f9d5f67e64860b09541a7f285e10434c4884 Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Tue, 13 Jul 2021 21:03:36 +0530 Subject: [PATCH] headers: Import propvarutil.h from wine This reverts d603db2c1544a26c7e1153208b660f1c0f0f21d7 commit. The added functions are required for qt6-multi

[Mingw-w64-public] Increasing the stack programmatically on mingw32

2021-07-13 Thread Tempelaar E. (Erik)
Hello all, The 32-bit application I work on needs to able to validate a long string in XML against a complex regular expression in the XSD (using xerces-c) For this to work correctly the stack size was increased somewhere in the past; on Unix using setrlimit, in mingw32 with 'LDFLAGS += -Wl,--st

Re: [Mingw-w64-public] Patch WS2 Inline Functions

2021-07-13 Thread LIU Hao
在 7/13/21 6:33 PM, Martin Storsjö 写道: It appears to fix the issue yes.  Here's a patch with that solution: `static inline` looks the safest solution, as long as the address of those functions aren't taken. -- Best regards, LIU Hao OpenPGP_signature Description: OpenPGP digital signatur

Re: [Mingw-w64-public] Patch WS2 Inline Functions

2021-07-13 Thread Martin Storsjö
On Tue, 13 Jul 2021, Jonathan Marler wrote: I highly suggest you not play with this inline stuff. It's something very fragile that works by accident; any tiny change could be catastrophic. Yeah this whole inline thing is a complete mess. But the headers are currently broken with Clang, using

Re: [Mingw-w64-public] Patch WS2 Inline Functions

2021-07-13 Thread Jonathan Marler
> I highly suggest you not play with this inline stuff. It's something very fragile that works by accident; any tiny change could be catastrophic. Yeah this whole inline thing is a complete mess. But the headers are currently broken with Clang, using any of those WS2TCP_INLINE functions with clan

Re: [Mingw-w64-public] Patch WS2 Inline Functions

2021-07-13 Thread Martin Storsjö
On Tue, 13 Jul 2021, LIU Hao wrote: 在 7/13/21 5:02 PM, Jonathan Marler 写道: Thanks for the convenient info.  However, when I try to use __attribute__((__weak__)) I get a compiler warning from GCC, i.e.     extern __inline__ __attribute__((__weak__))     void foo(void) {}     int main(int a

Re: [Mingw-w64-public] Patch WS2 Inline Functions

2021-07-13 Thread LIU Hao
在 7/13/21 5:02 PM, Jonathan Marler 写道: Thanks for the convenient info.  However, when I try to use __attribute__((__weak__)) I get a compiler warning from GCC, i.e.     extern __inline__ __attribute__((__weak__))     void foo(void) {}     int main(int argc, char *argv[])     {         foo

[Mingw-w64-public] [PATCH] crt: Fix printf formatting of %a on arm/aarch64 with __USE_MINGW_ANSI_STDIO

2021-07-13 Thread Martin Storsjö
The mingw_pformat.c code converts all input floats to an 80 bit float representation and analyzes that struct when printing the float. This was already fixed in ceb4c4fd4b696e96bbe174ce4abc065d43e9ac87, but one case in was missed. Factorize the conversion from 64 to 80 bit floats to a function use

Re: [Mingw-w64-public] Patch WS2 Inline Functions

2021-07-13 Thread LIU Hao
在 7/13/21 3:05 PM, Jonathan Marler 写道: +# if ((__MINGW_GNUC_PREREQ(4, 3) || defined(__clang__)) && __STDC_VERSION__ >= 199901L) +# define __MSVC_INLINE extern inline +# else No this is not correct. MSVC `__inline` is the C++ `inline`, which is equivalent to `extern __inline__ __attribute__((_

Re: [Mingw-w64-public] Patch WS2 Inline Functions

2021-07-13 Thread Jonathan Marler
That is a good point. Thanks for your help/guidance with this. Here's a new patch where I've copied __CRT_INLINE and created a new __MSVC_INLINE which is meant to behave like the origin MSVC inline From fb39d994898b00ae52106b72f6c835821ae2b455 Mon Sep 17 00:00:00 2001 From: Jonathan Marler Date