Re: [Mingw-w64-public] [PATCH] headers: Sync changes from stdlib.h to wchar.h from a2feff99e4f

2020-04-30 Thread Martin Storsjö
On Thu, 30 Apr 2020, Liu Hao wrote: 在 04/30/2020 07:30 PM, Martin Storsjö 写道: This define machinery is duplicated betwen the headers, and should stay in sync. Also sync the ifdef surrounding the wcstof and wcstod functions. This fixes building the crt for arm platforms. On x86 platforms, the

Re: [Mingw-w64-public] [PATCH] headers: Sync changes from stdlib.h to wchar.h from a2feff99e4f

2020-04-30 Thread Liu Hao
在 04/30/2020 07:30 PM, Martin Storsjö 写道: > This define machinery is duplicated betwen the headers, and should > stay in sync. > > Also sync the ifdef surrounding the wcstof and wcstod functions. > > This fixes building the crt for arm platforms. > > On x86 platforms, the intrin headers end up i

[Mingw-w64-public] [PATCH] headers: Sync changes from stdlib.h to wchar.h from a2feff99e4f

2020-04-30 Thread Martin Storsjö
This define machinery is duplicated betwen the headers, and should stay in sync. Also sync the ifdef surrounding the wcstof and wcstod functions. This fixes building the crt for arm platforms. On x86 platforms, the intrin headers end up including mm_malloc.h, which includes stdlib.h implcitly -

Re: [Mingw-w64-public] [PATCH] _mingw.h: Do not check for _UCRT

2020-04-30 Thread Liu Hao
在 2020/4/30 4:48, Pali Rohár 写道: > This fixes commit bfd33f6c0ec5e652cc9911857dd1492ece8d8383. _UCRT does not > have to be defined yet (it is defined after including _mingw.h), but > __MSVCRT_VERSION__ at this stage is always defined (few lines above). > --- > Thanks. Pushed this one. -- Best r

Re: [Mingw-w64-public] [PATCH] Enable __USE_MINGW_ANSI_STDIO for C99 and C++11 when not using UCRT

2020-04-30 Thread Liu Hao
在 2020/4/30 15:56, Pali Rohár 写道: > > Strange, I compiled mingw-w64 from git master branch with applied this > patch with gcc-8 and there was no such problem. > Did you forget to install new headers prior to building the CRT? Sometimes I forget it too. -- Best regards, LH_Mouse _

Re: [Mingw-w64-public] [PATCH] Enable __USE_MINGW_ANSI_STDIO for C99 and C++11 when not using UCRT

2020-04-30 Thread Liu Hao
在 2020/4/30 17:33, Martin Storsjö 写道: > > Thanks - this patch looks good to me on a quick glance. > >> (I would like to know whether there are any better macros than `_CRTBLD` >> to check against.) > > There's probably a lots of different ways of achieving the same, but > _CRTBLD is fine with me

Re: [Mingw-w64-public] [PATCH] crt: Add missing functions in msvcr80.def

2020-04-30 Thread Liu Hao
在 2020/4/30 17:31, Pali Rohár 写道: > > Back to this patch. After applying it, gcc/mingw produce executable > binary without any warning or error, so I think it fine. > Thanks. Pushed. Back to the manifest issue: It is probably legal to copy one from another executable, as it is a resource in pla

Re: [Mingw-w64-public] [PATCH] Allow to use __USE_MINGW_ANSI_STDIO with msvcr80.dll

2020-04-30 Thread Pali Rohár
On Tuesday 28 April 2020 22:02:35 Liu Hao wrote: > 在 2020/4/28 15:21, Pali Rohár 写道: > > Trying to link application with msvcr80.dll instead of msvcrt.dll (e.g. by > > replacing -lmsvcrt by -lmsvcr80 in gcc spec file) results in following > > linker error: > > > > .../lib/crt2.o: in function `_tma

Re: [Mingw-w64-public] snprintf() is broken in mingw-w64

2020-04-30 Thread Pali Rohár
On Friday 21 February 2020 17:22:13 Pali Rohár wrote: > On Friday 21 February 2020 18:17:37 Liu Hao wrote: > > 在 2020/2/21 2:27, Pali Rohár 写道: > > > Hello! Based on raymod2 suggestion on IRC, I prepared full patch and > > > tested it that snprintf() and vsnprintf() works correctly. > > > > > > Pa

Re: [Mingw-w64-public] [PATCH] Enable __USE_MINGW_ANSI_STDIO for C99 and C++11 when not using UCRT

2020-04-30 Thread Pali Rohár
On Thursday 30 April 2020 16:33:01 Liu Hao wrote: > 在 2020/4/30 13:17, Martin Storsjö 写道: > > > > This patch broke compiling mingw-w64-crt (with clang, but I'm fairly > > sure the same happens with gcc as well: > > > > ../misc/wcstof.c:20:7: error: redefinition of 'wcstof' float wcstof > > (const

Re: [Mingw-w64-public] [PATCH] Enable __USE_MINGW_ANSI_STDIO for C99 and C++11 when not using UCRT

2020-04-30 Thread Pali Rohár
On Thursday 30 April 2020 08:17:04 Martin Storsjö wrote: > On Wed, 29 Apr 2020, Liu Hao wrote: > > > 在 2020/4/28 15:22, Pali Rohár 写道: > > > C99 and C++11 standards requires printf ll modifier for long long type but > > > it does not work in WinXP system msvcrt.dll. It requires at least library >

Re: [Mingw-w64-public] [PATCH] Enable __USE_MINGW_ANSI_STDIO for C99 and C++11 when not using UCRT

2020-04-30 Thread Pali Rohár
On Thursday 30 April 2020 17:13:05 Liu Hao wrote: > 在 2020/4/30 16:43, Pali Rohár 写道: > > > > I think there is another problem: > > > > Function wcstof() which is in mingw-w64-headers/crt/stdlib.h should be > > marked as "inline". Otherwise there could be link problems... > > > > And after that

Re: [Mingw-w64-public] [PATCH] crt: Add missing functions in msvcr80.def

2020-04-30 Thread Pali Rohár
On Thursday 30 April 2020 10:17:55 Liu Hao wrote: > 在 2020/4/30 2:31, Pali Rohár 写道: > > On Wednesday 29 April 2020 22:20:57 Liu Hao wrote: > > > > The application failed to initialize properly (0xc142). Click OK to > > terminate application. > > > > > > When I tried to link with -lmsvc

[Mingw-w64-public] [PATCH] _mingw.h: Do not check for _UCRT

2020-04-30 Thread Pali Rohár
This fixes commit bfd33f6c0ec5e652cc9911857dd1492ece8d8383. _UCRT does not have to be defined yet (it is defined after including _mingw.h), but __MSVCRT_VERSION__ at this stage is always defined (few lines above). --- mingw-w64-headers/crt/_mingw.h.in | 4 ++-- 1 file changed, 2 insertions(+), 2 d

Re: [Mingw-w64-public] [PATCH] crt: Add missing functions in msvcr80.def

2020-04-30 Thread Pali Rohár
On Wednesday 29 April 2020 22:20:57 Liu Hao wrote: > 在 2020/4/28 23:47, Pali Rohár 写道: > > > > They really exist in my tested msvcr80.dll file! > > > > I thought that if symbols are missing in mingw def files then functions > > are unimplemented. But it looks like that problem is in mingw def fil

Re: [Mingw-w64-public] [PATCH] crt: Add missing functions in msvcr80.def

2020-04-30 Thread Pali Rohár
On Wednesday 29 April 2020 22:20:57 Liu Hao wrote: > 在 2020/4/28 23:47, Pali Rohár 写道: > > > > They really exist in my tested msvcr80.dll file! > > > > I thought that if symbols are missing in mingw def files then functions > > are unimplemented. But it looks like that problem is in mingw def fil

Re: [Mingw-w64-public] [PATCH] crt: Add missing functions in msvcr80.def

2020-04-30 Thread Pali Rohár
On Thursday 30 April 2020 17:22:52 Liu Hao wrote: > 在 2020/4/30 17:14, Pali Rohár 写道: > > > > So problem is only with 80, not 90. > > > > Anyway, that error message is issued by msvcr80.dll library itself, so I > > think it could be possible to do some link-time workaround in mingw-w64 > > or gcc

Re: [Mingw-w64-public] [PATCH] Enable __USE_MINGW_ANSI_STDIO for C99 and C++11 when not using UCRT

2020-04-30 Thread Martin Storsjö
On Thu, 30 Apr 2020, Liu Hao wrote: 在 2020/4/30 13:17, Martin Storsjö 写道: This patch broke compiling mingw-w64-crt (with clang, but I'm fairly sure the same happens with gcc as well: ../misc/wcstof.c:20:7: error: redefinition of 'wcstof' float wcstof (const wchar_t * __restrict__ wcs, wchar_t

Re: [Mingw-w64-public] [PATCH] crt: Add missing functions in msvcr80.def

2020-04-30 Thread Liu Hao
在 2020/4/30 17:14, Pali Rohár 写道: > > So problem is only with 80, not 90. > > Anyway, that error message is issued by msvcr80.dll library itself, so I > think it could be possible to do some link-time workaround in mingw-w64 > or gcc to make msvcr80.dll happy. > I am not clear about details abo

Re: [Mingw-w64-public] [PATCH] Enable __USE_MINGW_ANSI_STDIO for C99 and C++11 when not using UCRT

2020-04-30 Thread Liu Hao
在 2020/4/30 16:43, Pali Rohár 写道: > > I think there is another problem: > > Function wcstof() which is in mingw-w64-headers/crt/stdlib.h should be > marked as "inline". Otherwise there could be link problems... > > And after that above redefinition error should not be triggered as C99 > allows y

Re: [Mingw-w64-public] [PATCH] Enable __USE_MINGW_ANSI_STDIO for C99 and C++11 when not using UCRT

2020-04-30 Thread Liu Hao
在 2020/4/30 13:17, Martin Storsjö 写道: > > This patch broke compiling mingw-w64-crt (with clang, but I'm fairly > sure the same happens with gcc as well: > > ../misc/wcstof.c:20:7: error: redefinition of 'wcstof' float wcstof > (const wchar_t * __restrict__ wcs, wchar_t ** __restrict__ wcse) >