[PATCH] D37468: [libc++] Redirect strftime_l to the locale-ignorant strftime on mingw
This revision was automatically updated to reflect the committed changes. Closed by commit rL312617: Redirect strftime_l to the locale-ignorant strftime on mingw (authored by mstorsjo). Changed prior to commit: https://reviews.llvm.org/D37468?vs=113838&id=113956#toc Repository: rL LLVM https://reviews.llvm.org/D37468 Files: libcxx/trunk/include/support/win32/locale_win32.h Index: libcxx/trunk/include/support/win32/locale_win32.h === --- libcxx/trunk/include/support/win32/locale_win32.h +++ libcxx/trunk/include/support/win32/locale_win32.h @@ -100,7 +100,11 @@ #define iswxdigit_l _iswxdigit_l #define towupper_l _towupper_l #define towlower_l _towlower_l +#if defined(__MINGW32__) && __MSVCRT_VERSION__ < 0x0800 +#define strftime_l( __s, __l, __f, __tm, __loc ) strftime( __s, __l, __f, __tm ) +#else #define strftime_l _strftime_l +#endif #define sscanf_l( __s, __l, __f, ...) _sscanf_l( __s, __f, __l, __VA_ARGS__ ) #define vsscanf_l( __s, __l, __f, ...) _sscanf_l( __s, __f, __l, __VA_ARGS__ ) #define sprintf_l( __s, __l, __f, ... ) _sprintf_l( __s, __f, __l, __VA_ARGS__ ) Index: libcxx/trunk/include/support/win32/locale_win32.h === --- libcxx/trunk/include/support/win32/locale_win32.h +++ libcxx/trunk/include/support/win32/locale_win32.h @@ -100,7 +100,11 @@ #define iswxdigit_l _iswxdigit_l #define towupper_l _towupper_l #define towlower_l _towlower_l +#if defined(__MINGW32__) && __MSVCRT_VERSION__ < 0x0800 +#define strftime_l( __s, __l, __f, __tm, __loc ) strftime( __s, __l, __f, __tm ) +#else #define strftime_l _strftime_l +#endif #define sscanf_l( __s, __l, __f, ...) _sscanf_l( __s, __f, __l, __VA_ARGS__ ) #define vsscanf_l( __s, __l, __f, ...) _sscanf_l( __s, __f, __l, __VA_ARGS__ ) #define sprintf_l( __s, __l, __f, ... ) _sprintf_l( __s, __f, __l, __VA_ARGS__ ) ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D37468: [libc++] Redirect strftime_l to the locale-ignorant strftime on mingw
compnerd accepted this revision. compnerd added a comment. This revision is now accepted and ready to land. ick https://reviews.llvm.org/D37468 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D37468: [libc++] Redirect strftime_l to the locale-ignorant strftime on mingw
mstorsjo created this revision. _strftime_l is only available in the numbered msvcrt versions (starting from msvcr80.dll). In the default configuration, mingw targets the unversioned msvcrt.dll - and there, _strftime_l is not available (not even on windows 10). If __MSVCRT_VERSION__ is set to a higher value (indicating a non-default target and wanting to link to msvcrXX.dll), use the correct function. https://reviews.llvm.org/D37468 Files: include/support/win32/locale_win32.h Index: include/support/win32/locale_win32.h === --- include/support/win32/locale_win32.h +++ include/support/win32/locale_win32.h @@ -100,7 +100,11 @@ #define iswxdigit_l _iswxdigit_l #define towupper_l _towupper_l #define towlower_l _towlower_l +#if defined(__MINGW32__) && __MSVCRT_VERSION__ < 0x0800 +#define strftime_l( __s, __l, __f, __tm, __loc ) strftime( __s, __l, __f, __tm ) +#else #define strftime_l _strftime_l +#endif #define sscanf_l( __s, __l, __f, ...) _sscanf_l( __s, __f, __l, __VA_ARGS__ ) #define vsscanf_l( __s, __l, __f, ...) _sscanf_l( __s, __f, __l, __VA_ARGS__ ) #define sprintf_l( __s, __l, __f, ... ) _sprintf_l( __s, __f, __l, __VA_ARGS__ ) Index: include/support/win32/locale_win32.h === --- include/support/win32/locale_win32.h +++ include/support/win32/locale_win32.h @@ -100,7 +100,11 @@ #define iswxdigit_l _iswxdigit_l #define towupper_l _towupper_l #define towlower_l _towlower_l +#if defined(__MINGW32__) && __MSVCRT_VERSION__ < 0x0800 +#define strftime_l( __s, __l, __f, __tm, __loc ) strftime( __s, __l, __f, __tm ) +#else #define strftime_l _strftime_l +#endif #define sscanf_l( __s, __l, __f, ...) _sscanf_l( __s, __f, __l, __VA_ARGS__ ) #define vsscanf_l( __s, __l, __f, ...) _sscanf_l( __s, __f, __l, __VA_ARGS__ ) #define sprintf_l( __s, __l, __f, ... ) _sprintf_l( __s, __f, __l, __VA_ARGS__ ) ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits