Skip to content

Commit

Permalink
COMP: Supress warning in MSVC for non-float complex
Browse files Browse the repository at this point in the history
  • Loading branch information
blowekamp committed Feb 14, 2023
1 parent 0e3a056 commit a7a3e5d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions Modules/Core/Common/include/itkMath.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
*/
#include <vxl_version.h>


namespace itk
{
namespace Math
Expand Down
2 changes: 2 additions & 0 deletions Modules/Core/Common/src/itkNumericTraits.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ constexpr long double NumericTraits<long double>::Zero;
constexpr long double NumericTraits<long double>::One;

#if !defined(ITK_LEGACY_REMOVE)
// Supress MSVC warnings
# define _SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING
template <>
const std::complex<char> NumericTraits<std::complex<char>>::Zero = std::complex<char>(0, 0);
template <>
Expand Down
5 changes: 5 additions & 0 deletions Modules/Core/Common/test/itkMathTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
#include <limits>
#include <type_traits> // For is_same.

#if !defined(ITK_LEGACY_REMOVE)
// Supress MSVC warnings
# define _SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING
#endif

constexpr auto maxUnsignedValue = std::numeric_limits<uintmax_t>::max();

using itk::Math::UnsignedPower;
Expand Down
5 changes: 5 additions & 0 deletions Modules/Core/Common/test/itkNumericTraitsTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
#include "itkNumericTraitsVariableLengthVectorPixel.h"
#include "itkTestingMacros.h"

#if !defined(ITK_LEGACY_REMOVE)
// Supress MSVC warnings
# define _SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING
#endif

namespace
{

Expand Down

0 comments on commit a7a3e5d

Please sign in to comment.