diff options
author | Shoaib Meenai <smeenai@fb.com> | 2017-09-15 18:49:34 +0000 |
---|---|---|
committer | Shoaib Meenai <smeenai@fb.com> | 2017-09-15 18:49:34 +0000 |
commit | 03e314bb0de338a8ff63c41ec1afd95d67281e50 (patch) | |
tree | 4d0baa504945dd3331b47f2c88b7e55bbec070f2 | |
parent | 534bfbd3ba82b4fe742563667f933f4e0a8ac9f0 (diff) | |
download | bcm5719-llvm-03e314bb0de338a8ff63c41ec1afd95d67281e50.tar.gz bcm5719-llvm-03e314bb0de338a8ff63c41ec1afd95d67281e50.zip |
[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.
llvm-svn: 313377
-rw-r--r-- | libcxx/include/wchar.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libcxx/include/wchar.h b/libcxx/include/wchar.h index a5666e193a5..f74fe6ddcff 100644 --- a/libcxx/include/wchar.h +++ b/libcxx/include/wchar.h @@ -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) |