From 0795931dee2c4f718e6f6c5476ed7a7e0bd794f9 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Mon, 8 Apr 2013 18:59:28 +0000 Subject: [PATCH] Change and to look out for flags which may or may not be set by the C headers and indicating C support for the C++-altered wcschr, wcspbrk, wcsrchr, wcsstr, wmemchr, strchr, strpbrk, strrchr, memchr, and strstr. This was already done in for other platforms using other flags, so just had to add one more flag to the list there. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@179041 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/cstring | 2 +- include/cwchar | 23 ++++++++++++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/include/cstring b/include/cstring index 13bb1189..45075b3a 100644 --- a/include/cstring +++ b/include/cstring @@ -94,7 +94,7 @@ using ::strspn; using ::strstr; // MSVC, GNU libc and its derivates already have the correct prototype in #ifdef __cplusplus -#if !defined(__GLIBC__) && !defined(_MSC_VER) && !defined(__sun__) +#if !defined(__GLIBC__) && !defined(_MSC_VER) && !defined(__sun__) && !defined(_STRING_H_CPLUSPLUS_98_CONFORMANCE_) inline _LIBCPP_INLINE_VISIBILITY char* strchr( char* __s, int __c) {return ::strchr(__s, __c);} inline _LIBCPP_INLINE_VISIBILITY char* strpbrk( char* __s1, const char* __s2) {return ::strpbrk(__s1, __s2);} inline _LIBCPP_INLINE_VISIBILITY char* strrchr( char* __s, int __c) {return ::strrchr(__s, __c);} diff --git a/include/cwchar b/include/cwchar index caed08de..845ccec3 100644 --- a/include/cwchar +++ b/include/cwchar @@ -167,28 +167,37 @@ using ::wcscoll; using ::wcsncmp; using ::wcsxfrm; +#if defined(_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_) + +using ::wcschr; +using ::wcspbrk; +using ::wcsrchr; +using ::wcsstr; +using ::wmemchr; + +#else + inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcschr(const wchar_t* __s, wchar_t __c) {return ::wcschr(__s, __c);} inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcschr( wchar_t* __s, wchar_t __c) {return ::wcschr(__s, __c);} -using ::wcscspn; -using ::wcslen; - inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcspbrk(const wchar_t* __s1, const wchar_t* __s2) {return ::wcspbrk(__s1, __s2);} inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcspbrk( wchar_t* __s1, const wchar_t* __s2) {return ::wcspbrk(__s1, __s2);} inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcsrchr(const wchar_t* __s, wchar_t __c) {return ::wcsrchr(__s, __c);} inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcsrchr( wchar_t* __s, wchar_t __c) {return ::wcsrchr(__s, __c);} -using ::wcsspn; - inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return ::wcsstr(__s1, __s2);} inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcsstr( wchar_t* __s1, const wchar_t* __s2) {return ::wcsstr(__s1, __s2);} -using ::wcstok; - inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) {return ::wmemchr(__s, __c, __n);} inline _LIBCPP_INLINE_VISIBILITY wchar_t* wmemchr( wchar_t* __s, wchar_t __c, size_t __n) {return ::wmemchr(__s, __c, __n);} +#endif + +using ::wcscspn; +using ::wcslen; +using ::wcsspn; +using ::wcstok; using ::wmemcmp; using ::wmemcpy; using ::wmemmove;