aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDave Houlton <[email protected]>2017-12-22 13:55:53 -0700
committerMark Lobodzinski <[email protected]>2018-05-04 09:31:34 -0600
commitfd051d36f78dad0f25370acadfe8f6f6ed8cd2fa (patch)
tree82adb8adad2329be02913fc672d537a81019ae32
parent5b95004c15a8b82877e8ad73a75e89263101c3b4 (diff)
downloadVulkan-Headers-fd051d36f78dad0f25370acadfe8f6f6ed8cd2fa.tar.gz
Vulkan-Headers-fd051d36f78dad0f25370acadfe8f6f6ed8cd2fa.zip
tests: Add a guard around noexcept in vktestbinding.h
VS2013 does not provide 'noexcept'. Layers had multiple occurences of a NOEXCEPT macro to protect the VS2013 build. This commit consolidates that macro to a single location in vk_sdk_platform.h, which is also visible to the layer tests via test_common.h. Updates the vktestbinding.h occurences of 'noexcept' to use the NOEXCEPT macro. Change-Id: I38bf8c08cda6fe75de78dff69050a913b47f91b1
-rw-r--r--include/vulkan/vk_sdk_platform.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/include/vulkan/vk_sdk_platform.h b/include/vulkan/vk_sdk_platform.h
index ef9a000..96d8676 100644
--- a/include/vulkan/vk_sdk_platform.h
+++ b/include/vulkan/vk_sdk_platform.h
@@ -43,4 +43,27 @@
#endif // _WIN32
-#endif // VK_SDK_PLATFORM_H
+// Check for noexcept support using clang, with fallback to Windows or GCC version numbers
+#ifndef NOEXCEPT
+#if defined(__clang__)
+#if __has_feature(cxx_noexcept)
+#define HAS_NOEXCEPT
+#endif
+#else
+#if defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC__ * 10 + __GNUC_MINOR__ >= 46
+#define HAS_NOEXCEPT
+#else
+#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023026 && defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS
+#define HAS_NOEXCEPT
+#endif
+#endif
+#endif
+
+#ifdef HAS_NOEXCEPT
+#define NOEXCEPT noexcept
+#else
+#define NOEXCEPT
+#endif
+#endif
+
+#endif // VK_SDK_PLATFORM_H