diff options
author | Chad Versace <[email protected]> | 2015-10-07 11:43:13 -0700 |
---|---|---|
committer | Chad Versace <[email protected]> | 2015-10-07 11:44:33 -0700 |
commit | c2f94e3a0d41c1f100f477498d3173ed1716eabc (patch) | |
tree | 4cf0da1a73162dd88abe6ffa4ce20cdc21cca8e2 /include/vulkan/vulkan.h | |
parent | 0ca3c8480ddc280bc7faa8aec2db2c3cd299aade (diff) |
vk/0.170.2: Update C++ errata and typedefs
Diffstat (limited to 'include/vulkan/vulkan.h')
-rw-r--r-- | include/vulkan/vulkan.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h index 62305a60116..321a1d60b1b 100644 --- a/include/vulkan/vulkan.h +++ b/include/vulkan/vulkan.h @@ -55,7 +55,7 @@ extern "C" { #if defined(__cplusplus) - #if (_MSC_VER >= 1800 || __cplusplus >= 201103L) + #if ((defined(_MSC_VER) && _MSC_VER >= 1800) || __cplusplus >= 201103L) // The bool operator only works if there are no implicit conversions from an obj to // a bool-compatible type, which can then be used to unintentionally violate type safety. // C++11 and above supports the "explicit" keyword on conversion operators to stop this @@ -63,13 +63,18 @@ extern "C" { // the object handle as a bool in expressions like: // if (obj) vkDestroy(obj); #define VK_NONDISP_HANDLE_OPERATOR_BOOL() explicit operator bool() const { return handle != 0; } + #define VK_NONDISP_HANDLE_CONSTRUCTOR_FROM_UINT64(obj) \ + explicit obj(uint64_t x) : handle(x) { } \ + obj(decltype(nullptr)) : handle(0) { } #else #define VK_NONDISP_HANDLE_OPERATOR_BOOL() + #define VK_NONDISP_HANDLE_CONSTRUCTOR_FROM_UINT64(obj) \ + obj(uint64_t x) : handle(x) { } #endif #define VK_DEFINE_NONDISP_HANDLE(obj) \ struct obj { \ obj() : handle(0) { } \ - obj(uint64_t x) : handle(x) { } \ + VK_NONDISP_HANDLE_CONSTRUCTOR_FROM_UINT64(obj) \ obj& operator =(uint64_t x) { handle = x; return *this; } \ bool operator==(const obj& other) const { return handle == other.handle; } \ bool operator!=(const obj& other) const { return handle != other.handle; } \ @@ -83,6 +88,10 @@ extern "C" { +typedef uint32_t VkBool32; +typedef uint32_t VkFlags; +typedef uint64_t VkDeviceSize; +typedef uint32_t VkSampleMask; VK_DEFINE_HANDLE(VkInstance) VK_DEFINE_HANDLE(VkPhysicalDevice) |