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 - which makes stdlib.h end up
included before wchar.h, even if stdlib.h isn't explicitly included.
That explains why the build succeeded on one architecture but not
others.

Signed-off-by: Martin Storsjö <mar...@martin.st>
---
 mingw-w64-headers/crt/wchar.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mingw-w64-headers/crt/wchar.h b/mingw-w64-headers/crt/wchar.h
index 18e618d33..d9227efb3 100644
--- a/mingw-w64-headers/crt/wchar.h
+++ b/mingw-w64-headers/crt/wchar.h
@@ -9,7 +9,7 @@
 #include <corecrt.h>
 #include <corecrt_wstdlib.h>
 
-#if __USE_MINGW_ANSI_STDIO && !defined (__USE_MINGW_STRTOX)
+#if __USE_MINGW_ANSI_STDIO && !defined (__USE_MINGW_STRTOX) && 
!defined(_CRTBLD)
 #define __USE_MINGW_STRTOX 1
 #endif
 
@@ -1251,7 +1251,7 @@ int vsnwprintf (wchar_t *__stream, size_t __n, const 
wchar_t *__format, __builti
   float __cdecl __mingw_wcstof(const wchar_t * __restrict__ nptr, wchar_t ** 
__restrict__ endptr);
   long double __cdecl __mingw_wcstold(const wchar_t * __restrict__, wchar_t ** 
__restrict__);
 
-#if __USE_MINGW_ANSI_STDIO
+#if __USE_MINGW_STRTOX
   __mingw_ovr
   double __cdecl wcstod(const wchar_t * __restrict__ _Str,wchar_t ** 
__restrict__ _EndPtr){
     return __mingw_wcstod(_Str,_EndPtr);
-- 
2.17.1



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

Reply via email to