Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Modules/Core/Common/src/itkNumericTraits.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
* limitations under the License.
*
*=========================================================================*/

#if !defined(ITK_LEGACY_REMOVE)
// Suppress MSVC warnings from VS2022, saying: "warning C4996: 'std::complex<T>::complex': warning STL4037: The effect
// of instantiating the template std::complex for any type other than float, double, or long double is unspecified."
# define _SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING
#endif

#include "itkNumericTraits.h"

namespace itk
Expand Down Expand Up @@ -72,8 +79,6 @@ 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
11 changes: 6 additions & 5 deletions Modules/Core/Common/test/itkMathTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
*
*=========================================================================*/

#if !defined(ITK_LEGACY_REMOVE)
// Suppress MSVC warnings from VS2022, saying: "warning C4996: 'std::complex<T>::complex': warning STL4037: The effect
// of instantiating the template std::complex for any type other than float, double, or long double is unspecified."
# define _SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING
#endif

#include "itkMath.h"
#include "itkIntTypes.h"
#include "itkStdStreamStateSave.h"
Expand All @@ -25,11 +31,6 @@
#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
11 changes: 6 additions & 5 deletions Modules/Core/Common/test/itkNumericTraitsTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
*
*=========================================================================*/

#if !defined(ITK_LEGACY_REMOVE)
// Suppress MSVC warnings from VS2022, saying: "warning C4996: 'std::complex<T>::complex': warning STL4037: The effect
// of instantiating the template std::complex for any type other than float, double, or long double is unspecified."
# define _SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING
#endif

#include <iostream>
#include <cstddef>

Expand All @@ -36,11 +42,6 @@
#include "itkNumericTraitsVariableLengthVectorPixel.h"
#include "itkTestingMacros.h"

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

namespace
{

Expand Down