diff options
| author | Dave Houlton <daveh@lunarg.com> | 2017-12-22 13:55:53 -0700 |
|---|---|---|
| committer | Mike Schuchardt <mikes@lunarg.com> | 2018-01-03 11:38:50 -0700 |
| commit | ac4d43c8085e09d886ceb04192e088c9125b20f6 (patch) | |
| tree | d95a6a146f41131984634d251d0c59df44f3be2f /include/vulkan | |
| parent | 7117a4f841589d0613dfeba176db2cddd9f51323 (diff) | |
| download | usermoji-ac4d43c8085e09d886ceb04192e088c9125b20f6.tar.xz | |
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
Diffstat (limited to 'include/vulkan')
| -rw-r--r-- | include/vulkan/vk_sdk_platform.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/include/vulkan/vk_sdk_platform.h b/include/vulkan/vk_sdk_platform.h index ef9a000f..96d86769 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 |
