A few minor improvements when building with C++17

This commit is contained in:
Chuck Walbourn 2022-03-13 15:13:45 -07:00
parent 4482cb3e40
commit 5a1d284615
2 changed files with 16 additions and 9 deletions

View File

@ -1195,7 +1195,11 @@ namespace
// Find Min and Max points, as starting point // Find Min and Max points, as starting point
HDRColorA X, Y; HDRColorA X, Y;
#if (__cplusplus >= 201703L)
if constexpr (ishdr)
#else
if (ishdr) if (ishdr)
#endif
{ {
X = HDRColorA{ FLT_MAX, FLT_MAX, FLT_MAX, 0.0f }; X = HDRColorA{ FLT_MAX, FLT_MAX, FLT_MAX, 0.0f };
Y = HDRColorA{ -FLT_MAX, -FLT_MAX, -FLT_MAX, 0.0f }; Y = HDRColorA{ -FLT_MAX, -FLT_MAX, -FLT_MAX, 0.0f };

View File

@ -3263,10 +3263,11 @@ void DirectX::Internal::ConvertScanline(
break; break;
} }
#ifdef _MSC_VER #if (__cplusplus >= 201703L)
[[fallthrough]];
#elif defined(_MSC_VER)
__fallthrough; __fallthrough;
#endif #elif defined(__clang__)
#ifdef __clang__
[[clang::fallthrough]]; [[clang::fallthrough]];
#endif #endif
@ -3552,10 +3553,11 @@ void DirectX::Internal::ConvertScanline(
break; break;
} }
#ifdef _MSC_VER #if (__cplusplus >= 201703L)
[[fallthrough]];
#elif defined(_MSC_VER)
__fallthrough; __fallthrough;
#endif #elif defined(__clang__)
#ifdef __clang__
[[clang::fallthrough]]; [[clang::fallthrough]];
#endif #endif
@ -3650,10 +3652,11 @@ void DirectX::Internal::ConvertScanline(
break; break;
} }
#ifdef _MSC_VER #if (__cplusplus >= 201703L)
[[fallthrough]];
#elif defined(_MSC_VER)
__fallthrough; __fallthrough;
#endif #elif defined(__clang__)
#ifdef __clang__
[[clang::fallthrough]]; [[clang::fallthrough]];
#endif #endif