Re: [Mingw-w64-public] interface macro conflicts with interface variable

2022-12-21 Thread Biswapriyo Nath
The 'interface' name as a macro is used in many headers and idl files. undef'd it may not be a perfect solution for all use cases. One thing I am curious about how projects use 'interface' name as a macro and successfully compiled it with msvc, whereas a simple example code in my OP fails with msvc

Re: [Mingw-w64-public] interface macro conflicts with interface variable

2022-12-21 Thread LIU Hao
在 2022/12/21 13:05, Biswapriyo Nath 写道: In various headers, the name 'interface' is a macro which is defined to 'struct' keyword. But that causes problem in code where 'interface' is used as a variable name. Here are the list of headers in mingw-w64 The `interface` macro is used to make decla

Re: [Mingw-w64-public] interface macro conflicts with interface variable

2022-12-21 Thread Alvin Wong via Mingw-w64-public
On 21/12/2022 16:45, LIU Hao wrote: If you define `WIN32_LEAN_AND_MEAN` (either `#define` it or pass `-DWIN32_LEAN_AND_MEAN` to GCC) before inclusion of , then the error will go away. This seems to be yet another reason why `WIN32_LEAN_AND_MEAN` should be preferred. ...which only works if yo

[Mingw-w64-public] [PATCH] widl: Avoid conflicting definitions of fastfail from Wine's winnt.h

2022-12-21 Thread Martin Storsjö
Widl uses a subset of Wine headers, on top of the host's platform headers (either Unix or Windows ones). When building widl for a Windows target, the included Wine headers end up being preferred over the toolchain's own platform headers. Wine defines the __fastfail function in the winnt.h header (

Re: [Mingw-w64-public] interface macro conflicts with interface variable

2022-12-21 Thread Biswapriyo Nath
Thanks, defining `WIN32_LEAN_AND_MEAN` fixes the issue in the android-tools project. Though I am not sure if it works for all cases. ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mi

Re: [Mingw-w64-public] interface macro conflicts with interface variable

2022-12-21 Thread LIU Hao
在 2022/12/21 17:06, Alvin Wong via Mingw-w64-public 写道: On 21/12/2022 16:45, LIU Hao wrote: If you define `WIN32_LEAN_AND_MEAN` (either `#define` it or pass `-DWIN32_LEAN_AND_MEAN` to GCC) before inclusion of , then the error will go away. This seems to be yet another reason why `WIN32_LEAN_AND

Re: [Mingw-w64-public] interface macro conflicts with interface variable

2022-12-21 Thread Biswapriyo Nath
> Isn't the person who has done that supposed to have acknowledged that > `interface` is a macro which shouldn't be used for variables? It does not occur with a single project. In my original post, the project is system/core repository for Android. I have seen this issue with another project name

Re: [Mingw-w64-public] interface macro conflicts with interface variable

2022-12-21 Thread LIU Hao
在 2022/12/21 17:56, Biswapriyo Nath 写道: Thanks, defining `WIN32_LEAN_AND_MEAN` fixes the issue in the android-tools project. Though I am not sure if it works for all cases. I am not sure what others typically do though - probably `WIN32_LEAN_AND_MEAN` should always be defined, so code that doe

Re: [Mingw-w64-public] [PATCH] widl: Avoid conflicting definitions of fastfail from Wine's winnt.h

2022-12-21 Thread Jacek Caban via Mingw-w64-public
Hi Martin, On 12/21/22 10:37, Martin Storsjö wrote: Widl uses a subset of Wine headers, on top of the host's platform headers (either Unix or Windows ones). When building widl for a Windows target, the included Wine headers end up being preferred over the toolchain's own platform headers. Wine

Re: [Mingw-w64-public] #ifdef _MSVCRT_

2022-12-21 Thread Martin Storsjö
On Sat, 17 Dec 2022, LIU Hao wrote: 在 2022-12-17 20:01, Pali Rohár 写道: It would be nice if somebody who understand these patterns write some comment what is the real purpose of the first __pctype_func() definition because for me it looks like a dead code. And this pattern is repeated multiple t

Re: [Mingw-w64-public] [PATCH] crt: Fix building LTO version of mingw-w64 crt libraries

2022-12-21 Thread Martin Storsjö
On Sat, 17 Dec 2022, LIU Hao wrote: 在 2022-12-17 22:22, Pali Rohár 写道: Currently when linking target application with LTO builds of mingw-w64 libraries, it is needed to manually specify entry point of mingw-w64 crt startup function via linker flag -Wl,-e,_mainCRTStartup (for console executables

[Mingw-w64-public] [PATCH] genstubdll: Remove

2022-12-21 Thread LIU Hao
在 2022-12-20 02:49, Pali Rohár 写道: And I think that this decision is independent of tool itself if should be removed too or not. My point is that if this should be removed then we shouldn't behave as if it was being actively maintained. Patch attached. Thoughts? -- Best regards, LIU Hao F

Re: [Mingw-w64-public] [PATCH] genstubdll: Remove

2022-12-21 Thread Jacek Caban via Mingw-w64-public
On 12/21/22 15:12, LIU Hao wrote: 在 2022-12-20 02:49, Pali Rohár 写道: And I think that this decision is independent of tool itself if should be removed too or not. My point is that if this should be removed then we shouldn't behave as if it was being actively maintained. Patch attached. Thou

Re: [Mingw-w64-public] [PATCH] crt: Fix building LTO version of mingw-w64 crt libraries

2022-12-21 Thread Pali Rohár
On Wednesday 21 December 2022 15:00:34 Martin Storsjö wrote: > I guess I'd need to build mingw-w64-crt with -flto in order to reproduce the > situation at hand though. Yes, that is needed. I was thinking about adding a new configure flag --enable-lto which will do it for easier LTO builds.