Cleanup: use static_assert on MSVC versions that support it.

This greatly improves the error message
This commit is contained in:
Ray molenkamp 2019-05-31 08:12:21 -06:00
parent 6eebeb577d
commit 3a72c9aa33
1 changed files with 5 additions and 1 deletions

View File

@ -89,7 +89,11 @@ extern "C" {
# define BLI_STATIC_ASSERT(a, msg) static_assert(a, msg);
#elif defined(_MSC_VER)
/* Visual Studio */
# define BLI_STATIC_ASSERT(a, msg) _STATIC_ASSERT(a);
# if _MSC_VER > 1910
# define BLI_STATIC_ASSERT(a, msg) static_assert(a, msg);
# else
# define BLI_STATIC_ASSERT(a, msg) _STATIC_ASSERT(a);
# endif
#elif defined(__COVERITY__)
/* Workaround error with coverity */
# define BLI_STATIC_ASSERT(a, msg)