Fix Win32 Chromium and ANGLE builds

* Fix std::shared_mutex not found when compiling with clang-cl. LLVM's
RWMutex assumes _MSC_VER is defined only when using the msvc compiler,
but clang-cl also defines it, which uses libc++ that does not define
std::shared_mutex for pre-C++17. To fix it, we also make sure __clang__
is not defined (_MSC_VER and __clang__ implies clang-cl). I will make a
similar upstream fix.

* Fix missing ___chkstk symbol linker error

* Fix "warning C4018: '>': signed/unsigned mismatch" by disabling the
warning.

Bug: b/152339534
Bug: b/161554059
Bug: chromium:1106623
Bug: angleproject:4851
Change-Id: I8639417e3ff78d82477b5ff9699f63507ec2a4ec
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/46628
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Antonio Maiorano <amaiorano@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
diff --git a/third_party/llvm-10.0/BUILD.gn b/third_party/llvm-10.0/BUILD.gn
index a346088..bd69965 100644
--- a/third_party/llvm-10.0/BUILD.gn
+++ b/third_party/llvm-10.0/BUILD.gn
@@ -21,6 +21,7 @@
   if (is_win) {
     cflags += [
       "/wd4005",
+      "/wd4018",
       "/wd4065",
       "/wd4141",
       "/wd4146",
diff --git a/third_party/llvm-10.0/configs/windows/include/llvm/Config/config.h b/third_party/llvm-10.0/configs/windows/include/llvm/Config/config.h
index 674aca2..3dc0d0f 100644
--- a/third_party/llvm-10.0/configs/windows/include/llvm/Config/config.h
+++ b/third_party/llvm-10.0/configs/windows/include/llvm/Config/config.h
@@ -248,7 +248,7 @@
 /* #undef HAVE___ASHRDI3 */
 
 /* Have host's __chkstk */
-#define HAVE___CHKSTK 1
+/* #undef HAVE___CHKSTK */
 
 /* Have host's __chkstk_ms */
 /* #undef HAVE___CHKSTK_MS */
diff --git a/third_party/llvm-10.0/llvm/include/llvm/Support/RWMutex.h b/third_party/llvm-10.0/llvm/include/llvm/Support/RWMutex.h
index 150bc7d..7b197e6 100644
--- a/third_party/llvm-10.0/llvm/include/llvm/Support/RWMutex.h
+++ b/third_party/llvm-10.0/llvm/include/llvm/Support/RWMutex.h
@@ -94,7 +94,9 @@
 template <bool mt_only> class SmartRWMutex {
   // shared_mutex (C++17) is more efficient than shared_timed_mutex (C++14)
   // on Windows and always available on MSVC.
-#if defined(_MSC_VER) || __cplusplus > 201402L
+////amaiorano@google.com: Fix clang-cl build (b/161554059)
+////#if defined(_MSC_VER) || __cplusplus > 201402L
+#if (defined(_MSC_VER) && !defined(__clang__)) || __cplusplus > 201402L
   std::shared_mutex impl;
 #else
 #if !defined(LLVM_USE_RW_MUTEX_IMPL)