Fixed GCC+Clang errors and warnings on Linux and OSX.

This commit is contained in:
Branimir Karadžić 2018-03-03 13:04:12 -08:00
parent 41e24fdb83
commit 1de8e54d66
4 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -37,7 +37,7 @@
#ifndef _COMMON_INCLUDED_
#define _COMMON_INCLUDED_
#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) || defined MINGW_HAS_SECURE_API
#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) // || defined MINGW_HAS_SECURE_API
#include <basetsd.h>
#define snprintf sprintf_s
#define safe_vsprintf(buf,max,format,args) vsnprintf_s((buf), (max), (max), (format), (args))
@ -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>

View File

@ -46,7 +46,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

View File

@ -7446,8 +7446,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