Workaround NOMINMAX issues on Windows.

::max() can be overridden if you forget NOMINMAX on Windows.
Hardcode literals instead. UINT32_MAX also requires weird macros in C++.
This commit is contained in:
Hans-Kristian Arntzen 2018-07-17 00:10:12 +02:00
parent be7425ef70
commit cc7679ee45
3 changed files with 3 additions and 4 deletions

View File

@ -20,6 +20,7 @@
#include <algorithm>
#include <assert.h>
#include <cmath>
#include <limits>
#include <utility>
using namespace spv;

View File

@ -18,7 +18,6 @@
#define SPIRV_CROSS_GLSL_HPP
#include "spirv_cross.hpp"
#include <limits>
#include <sstream>
#include <unordered_map>
#include <unordered_set>
@ -466,7 +465,7 @@ protected:
virtual std::string to_initializer_expression(const SPIRVariable &var);
bool buffer_is_packing_standard(const SPIRType &type, BufferPackingStandard packing, uint32_t start_offset = 0,
uint32_t end_offset = std::numeric_limits<uint32_t>::max());
uint32_t end_offset = ~(0u));
uint32_t type_to_packed_base_size(const SPIRType &type, BufferPackingStandard packing);
uint32_t type_to_packed_alignment(const SPIRType &type, const Bitset &flags, BufferPackingStandard packing);
uint32_t type_to_packed_array_stride(const SPIRType &type, const Bitset &flags, BufferPackingStandard packing);

View File

@ -18,7 +18,6 @@
#define SPIRV_CROSS_MSL_HPP
#include "spirv_glsl.hpp"
#include <limits>
#include <map>
#include <set>
#include <unordered_map>
@ -131,7 +130,7 @@ using MSLStructMemberKey = uint64_t;
// Special constant used in a MSLResourceBinding desc_set
// element to indicate the bindings for the push constants.
static const uint32_t kPushConstDescSet = std::numeric_limits<uint32_t>::max();
static const uint32_t kPushConstDescSet = ~(0u);
// Special constant used in a MSLResourceBinding binding
// element to indicate the bindings for the push constants.