From 0be8f64c44d2fe87fdf8feda175dc39d38a83906 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Thu, 1 Aug 2013 18:17:34 +0000 Subject: Nico Rieck: Currently _MSC_VER and _WIN32 are used to guard code which is MSVC-specific, MSVCRT-specific, or Windows-specific. Because Clang can also define _MSC_VER, and MSVCRT is not necessarily the only C runtime, these macros should not be used interchangeably. This patch divides all Windows-related bits into the aforementioned categories. Two new macros are introduced: - _LIBCPP_MSVC: Defined when compiling with MSVC. Detected using _MSC_VER, excluding Clang. - _LIBCPP_MSVCRT: Defined when using the Microsoft CRT. This is the default when _WIN32 is defined. This leaves _WIN32 for code using the Windows API. This also corrects the spelling of _LIBCP_HAS_IS_BASE_OF to _LIBCPP_HAS_IS_BASE_OF. Nico, please prepare a patch for CREDITS.TXT, thanks. llvm-svn: 187593 --- libcxx/include/cstring | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libcxx/include/cstring') diff --git a/libcxx/include/cstring b/libcxx/include/cstring index 45075b3af29..21c9155cd4d 100644 --- a/libcxx/include/cstring +++ b/libcxx/include/cstring @@ -93,8 +93,8 @@ 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__) && !defined(_STRING_H_CPLUSPLUS_98_CONFORMANCE_) +// MSVCRT, GNU libc and its derivates already have the correct prototype in #ifdef __cplusplus +#if !defined(__GLIBC__) && !defined(_LIBCPP_MSVCRT) && !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);} -- cgit v1.2.3