From 7cd4be1a7824a6de10a3964c76c89612fe303992 Mon Sep 17 00:00:00 2001 From: maier Date: Mon, 25 Feb 2013 13:01:03 +0000 Subject: [PATCH] Fix this macro issue for msvc properly git-svn-id: https://svn.dealii.org/branches/branch_cmake@28548 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/cmake/setup_compiler_flags_msvc.cmake | 3 +++ deal.II/include/deal.II/base/config.h.in | 11 ----------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/deal.II/cmake/setup_compiler_flags_msvc.cmake b/deal.II/cmake/setup_compiler_flags_msvc.cmake index 3afea550b8..fc1c88e037 100644 --- a/deal.II/cmake/setup_compiler_flags_msvc.cmake +++ b/deal.II/cmake/setup_compiler_flags_msvc.cmake @@ -40,6 +40,9 @@ ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "/EHsc") #enable warnings: ADD_FLAGS(CMAKE_CXX_FLAGS "/W3") +# Globally disable some legacy min and max macros that cause problems: +ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "/NOMINMAX") + ############################# # # # For Release target: # diff --git a/deal.II/include/deal.II/base/config.h.in b/deal.II/include/deal.II/base/config.h.in index 97a51bc24d..cc90898938 100644 --- a/deal.II/include/deal.II/base/config.h.in +++ b/deal.II/include/deal.II/base/config.h.in @@ -500,10 +500,8 @@ #cmakedefine HAVE_LIBZ - /* Disable a bunch of warnings for Microsoft Visual C++. */ #ifdef DEAL_II_MSVC - //# pragma warning( disable : 4244 ) /* implied downcasting from double to float */ //# pragma warning( disable : 4267 ) /* implied downcasting from size_t to unsigned int */ //# pragma warning( disable : 4996 ) /* unsafe functions, such as strcat and sprintf */ @@ -516,15 +514,6 @@ //# pragma warning( disable : 4700 ) /* uninitialized local variable */ //# pragma warning( disable : 4789 ) /* destination of memory copy is too small */ //# pragma warning( disable : 4808 ) /* case 'value' is not a valid value for switch condition of type 'bool */ - -/* - * On Windows systems with MS Visual C/C++, there is a - * #define for 'max' that collides with std::max. So, if - * we find that this is indeed the case, #undef it - */ -# if defined(max) -# undef max -# endif #endif // DEAL_II_MSVC -- 2.39.5