Re: [Mingw-w64-public] mingw-w64 and __attribute__((format(printf))) issue

2020-05-06 Thread Liu Hao
在 2020/5/6 18:48, Martin Storsjö 写道: > > So something like this should work: > > #ifdef __MINGW32__ > #define PRINTF_FORMAT __MINGW_PRINTF_FORMAT > #else > #define PRINTF_FORMAT printf > #endif > > __attribute__((format(PRINTF_FORMAT))) > > Not very pretty, but should work without hardcoding an

[Mingw-w64-public] [PATCH] headers/devguid.h: add missing guids and winapi family

2020-05-06 Thread Biswapriyo Nath
... From 209e4505d428c1679343c2ec7bac2421af209bc0 Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Thu, 7 May 2020 01:04:38 +0530 Subject: [PATCH] headers/devguid.h: add missing guids and winapi family Signed-off-by: Biswapriyo Nath --- mingw-w64-headers/include/devguid.h | 28 +

[Mingw-w64-public] [PATCH] headers: Fix include order of fvec.h/ivec.h/dvec.h referring to each other

2020-05-06 Thread Martin Storsjö
Previously, these headers expanded properly if dvec.h was included first, but not if fvec.h or ivec. were included first. Move the cyclical includes last, so that the bits that these headers are expected to declare are declared before the next level header is included. Signed-off-by: Martin Stors

Re: [Mingw-w64-public] [PATCH 8/9] winstorecompat: allow building with code that needs codeGeneration capability

2020-05-06 Thread Jacek Caban
On 06.05.2020 15:17, Martin Storsjö wrote: That lld patch is approved now FWIW, but I realized I want to refine it a bit further. I also came to think about another trick I implemented in lld - for the cases where the address is in a .refptr$ stub, lld can actually swap that out for the IAT

Re: [Mingw-w64-public] [PATCH v3 05/10] winstorecompat: provide GetUserName

2020-05-06 Thread Martin Storsjö
On Wed, 6 May 2020, Jacek Caban wrote: On 06.05.2020 15:09, Martin Storsjö wrote: Or call directly GetEnvironment directly? If it works on all relevant Windows versions, that sounds good. MSDN says it's supported since XP so I suppose so, but I can't guarantee it. I can only test on windo

Re: [Mingw-w64-public] [PATCH v3 08/10] winstorecompat: allow building with code that needs codeGeneration capability

2020-05-06 Thread Martin Storsjö
On Mon, 27 Apr 2020, Steve Lhomme wrote: By default winstorecompat is built without the need for this capability. VirtualProtect may be mapped to VirtualProtectFromApp but only if the app has the codeGeneration capability. It is needed when compiling UNIX code with relocatable sections that are

Re: [Mingw-w64-public] [PATCH 8/9] winstorecompat: allow building with code that needs codeGeneration capability

2020-05-06 Thread Martin Storsjö
On Mon, 27 Apr 2020, Martin Storsjö wrote: On Fri, 24 Apr 2020, Martin Storsjö wrote: On Fri, 24 Apr 2020, Steve Lhomme wrote: By default winstorecompat is built without the need for this capability. VirtualProtect may be mapped to VirtualProtectFromApp but only if the app has the codeGen

Re: [Mingw-w64-public] [PATCH v3 05/10] winstorecompat: provide GetUserName

2020-05-06 Thread Jacek Caban
On 06.05.2020 15:09, Martin Storsjö wrote: Or call directly GetEnvironment directly? If it works on all relevant Windows versions, that sounds good. MSDN says it's supported since XP so I suppose so, but I can't guarantee it. I can only test on windows 10 at the moment. Did I understand i

Re: [Mingw-w64-public] [PATCH v3 07/10] headers: allow some forbidden functions winstore calls with WINSTORECOMPAT

2020-05-06 Thread Martin Storsjö
On Mon, 27 Apr 2020, Steve Lhomme wrote: The stubs don't do anything but they are used by the crt. --- mingw-w64-headers/include/winnt.h | 30 +- 1 file changed, 21 insertions(+), 9 deletions(-) I think these aren't used unconditionally by the crt any longer, since

Re: [Mingw-w64-public] [PATCH v3 06/10] headers: allow CreateFileW/GetFileSize in winstore builds

2020-05-06 Thread Martin Storsjö
On Mon, 27 Apr 2020, Steve Lhomme wrote: They are implemented in winstorecompat so they should be available. --- mingw-w64-headers/include/fileapi.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) This looks good, so I pushed it. // Martin ___

Re: [Mingw-w64-public] [PATCH v3 05/10] winstorecompat: provide GetUserName

2020-05-06 Thread Martin Storsjö
On Tue, 28 Apr 2020, Steve Lhomme wrote: On 2020-04-27 19:59, Jacek Caban wrote: On 27.04.2020 19:55, Jean-Baptiste Kempf wrote: On Mon, Apr 27, 2020, at 19:40, Jacek Caban wrote: On 27.04.2020 16:31, Steve Lhomme wrote: It's needed by: - getlogin() in mingwex Could we prohibit getlogin()

Re: [Mingw-w64-public] [PATCH v3 04/10] crt: use WCHAR API's in WspiapiLoad

2020-05-06 Thread Martin Storsjö
On Mon, 27 Apr 2020, Steve Lhomme wrote: They are more likely to be available in UWP and we already provide a LoadLibraryW replacement otherwise. --- mingw-w64-crt/libsrc/wspiapi/WspiapiLoad.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) This looks ok with me in genera

Re: [Mingw-w64-public] [PATCH v3 03/10] crt: use UWP allowed API's in __mingw_fwrite

2020-05-06 Thread Martin Storsjö
On Mon, 27 Apr 2020, Steve Lhomme wrote: GetFileSize is not allowed. Switching to GetFileSizeEx and SetFilePointerEx makes the types and comparison cleaner. Both API's are available in XP as the one they replace. --- mingw-w64-crt/misc/mingw-fseek.c | 18 +++--- 1 file changed, 7 ins

Re: [Mingw-w64-public] mingw-w64 and __attribute__((format(printf))) issue

2020-05-06 Thread Liu Hao
在 2020/5/6 18:48, Martin Storsjö 写道: > > This is generally the risk of this kind of commit - regardless of how > right/wrong the status quo is, there's _a lot_ of code that relies on it > behaving in a specific way, and changing that will certainly run into > minor issues in a lot of places. > A

Re: [Mingw-w64-public] [PATCH v3 02/10] crt: use UWP allowed API's in ftruncate64

2020-05-06 Thread Martin Storsjö
On Mon, 27 Apr 2020, Steve Lhomme wrote: GetFileInformationByHandle, FindFirstVolumeW, FindNextVolumeW, FindVolumeClose are not allowed. GetFinalPathNameByHandleW is allowed in win8 and win10 https://docs.microsoft.com/en-us/uwp/win32-and-com/win32-apis https://docs.microsoft.com/en-us/windows/

Re: [Mingw-w64-public] [PATCH v3 01/10] crt: use GetEnvironmentVariableW in getopt

2020-05-06 Thread Martin Storsjö
On Mon, 27 Apr 2020, Steve Lhomme wrote: The API is available since Windows XP and available in UWP for win8 and win10. This avoids relying on getenv() from winstorecompat that returns NULL and can't be reimplemented in a clean way. --- mingw-w64-crt/misc/getopt.c | 2 +- 1 file changed, 1 inser

Re: [Mingw-w64-public] [PATCH] winstorecompat: add libwindowsappcompat to use with libwindowsapp

2020-05-06 Thread Martin Storsjö
On Wed, 6 May 2020, Steve Lhomme wrote: Hello, Any update on this ? Is there anything blocking ? Sorry, I've been rather busy. I'll try to have a look at the last version of the patchset now (today/tomorrow), test things I want to doublecheck, commit the bits where there's enough consensus

Re: [Mingw-w64-public] mingw-w64 and __attribute__((format(printf))) issue

2020-05-06 Thread Martin Storsjö
On Wed, 6 May 2020, Liu Hao wrote: Due to a recent change in mingw-w64 master [1], libgomp ceases to build: ``` ../../../gcc-git/libgomp/target.c:936:21: error: unknown conversion type character 'l' in format [-Werror=format=] 936 | gomp_fatal ("present clause: !acc_is_present (%p, "