[libc++] Account for Microsoft CRT const overloads

Microsoft's CRT already provides the const overloads, and it defines the
`_CRT_CONST_CORRECT_OVERLOADS` macro to indicate their presence. Check
for this macro before attempting to define our own const-correct
overloads, to avoid compiler warnings about casts dropping const
qualifiers.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313377 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Shoaib Meenai 2017-09-15 18:49:34 +00:00
parent ca79c159d8
commit ffe3715924

View File

@ -125,6 +125,10 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
# if __GLIBC_PREREQ(2, 10)
# define _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS 1
# endif
#elif defined(_LIBCPP_MSVCRT)
# if defined(_CRT_CONST_CORRECT_OVERLOADS)
# define _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS 1
# endif
#endif
#if defined(__cplusplus) && !defined(_LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS) && defined(_LIBCPP_PREFERRED_OVERLOAD)