diff --git a/SPIRV/GlslangToSpv.h b/SPIRV/GlslangToSpv.h
index 3a4371375091c9271045d0aec92783e422eeae8e..f7f7cff620be71c05122f04b2457e918f148ce36 100644
--- a/SPIRV/GlslangToSpv.h
+++ b/SPIRV/GlslangToSpv.h
@@ -34,7 +34,7 @@
 
 #pragma once
 
-#if _MSC_VER >= 1900
+#if defined(_MSC_VER) && _MSC_VER >= 1900
     #pragma warning(disable : 4464) // relative include path contains '..'
 #endif
 
diff --git a/glslang/Include/Common.h b/glslang/Include/Common.h
index 041701774e144f1eb33db555b7381f322dd2e569..f7448fa00c423b2ec7a32a72ea59a26c04104fa2 100644
--- a/glslang/Include/Common.h
+++ b/glslang/Include/Common.h
@@ -51,7 +51,7 @@
     #define UINT_PTR uintptr_t
 #endif
 
-#if defined(__ANDROID__) || _MSC_VER < 1700
+#if defined(__ANDROID__) || (defined(_MSC_VER) && _MSC_VER < 1700)
 #include <sstream>
 namespace std {
 template<typename T>
diff --git a/glslang/Include/intermediate.h b/glslang/Include/intermediate.h
index 72f83e940ce331142db48a28d530c096f2592be1..b4e4858de5ba1785a5fd4a8db8315a3e1ec1486c 100644
--- a/glslang/Include/intermediate.h
+++ b/glslang/Include/intermediate.h
@@ -47,7 +47,7 @@
 #ifndef __INTERMEDIATE_H
 #define __INTERMEDIATE_H
 
-#if _MSC_VER >= 1900
+#if defined(_MSC_VER) && _MSC_VER >= 1900
     #pragma warning(disable : 4464) // relative include path contains '..'
     #pragma warning(disable : 5026) // 'glslang::TIntermUnary': move constructor was implicitly defined as deleted
 #endif
diff --git a/hlsl/hlslParseHelper.cpp b/hlsl/hlslParseHelper.cpp
index d719b0461a946bccbca2927fc1ade7148a5bd290..73bda6d644f01e2df91a1f7ee208de9e387d2963 100755
--- a/hlsl/hlslParseHelper.cpp
+++ b/hlsl/hlslParseHelper.cpp
@@ -7520,8 +7520,8 @@ const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, TFunction
             }
         };
 
-        return std::abs(linearize(to2.getBasicType()) - linearize(from.getBasicType())) <
-               std::abs(linearize(to1.getBasicType()) - linearize(from.getBasicType()));
+        return abs(linearize(to2.getBasicType()) - linearize(from.getBasicType())) <
+               abs(linearize(to1.getBasicType()) - linearize(from.getBasicType()));
     };
 
     // for ambiguity reporting