diff options
author | Martin Storsjo <martin@martin.st> | 2017-09-06 05:07:25 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2017-09-06 05:07:25 +0000 |
commit | f8689b1be1db3ebd119fc795ddcb8664113e11dd (patch) | |
tree | 1b1540dc07a7c2558784471bd8f4e45d6297cf90 /libcxx/include/support | |
parent | c2320add83208a89f495bc28e3a15de58c5bd15d (diff) | |
download | bcm5719-llvm-f8689b1be1db3ebd119fc795ddcb8664113e11dd.tar.gz bcm5719-llvm-f8689b1be1db3ebd119fc795ddcb8664113e11dd.zip |
Redirect strftime_l to the locale-ignorant strftime on mingw
_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.
Differential Revision: https://reviews.llvm.org/D37468
llvm-svn: 312617
Diffstat (limited to 'libcxx/include/support')
-rw-r--r-- | libcxx/include/support/win32/locale_win32.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libcxx/include/support/win32/locale_win32.h b/libcxx/include/support/win32/locale_win32.h index b2b3ac4c799..113c10753e4 100644 --- a/libcxx/include/support/win32/locale_win32.h +++ b/libcxx/include/support/win32/locale_win32.h @@ -100,7 +100,11 @@ isupper_l(int c, _locale_t loc) #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__ ) |