clean up use of _WIN32
Replace the use of _WIN32 in libc++. Replace most use with a C runtime check _LIBCPP_MSVCRT or the new _LIBCPP_WIN32 to indicate that we are using the Win32 API. Use a new _LIBCPP_WCHAR_IS_UCS2 to indicate that we are on an environment that has a short wchar_t. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290910 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -24,16 +24,17 @@
|
||||
# endif // defined(BSD)
|
||||
#endif // defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
|
||||
|
||||
#if !defined(_WIN32)
|
||||
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
|
||||
# include <unistd.h>
|
||||
#endif // !_WIN32
|
||||
#endif // defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
|
||||
|
||||
#if defined(__NetBSD__)
|
||||
#pragma weak pthread_create // Do not create libpthread dependency
|
||||
#endif
|
||||
#if defined(_WIN32)
|
||||
|
||||
#if defined(_LIBCPP_WIN32API)
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#endif // defined(_LIBCPP_WIN32API)
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
@@ -91,7 +92,7 @@ thread::hardware_concurrency() _NOEXCEPT
|
||||
if (result < 0)
|
||||
return 0;
|
||||
return static_cast<unsigned>(result);
|
||||
#elif defined(_WIN32)
|
||||
#elif defined(_LIBCPP_WIN32API)
|
||||
SYSTEM_INFO info;
|
||||
GetSystemInfo(&info);
|
||||
return info.dwNumberOfProcessors;
|
||||
|
||||
Reference in New Issue
Block a user