[Bf-blender-cvs] [6022cd015ff] master: Revert "Cleanup/MSVC: Enable C++ conformance mode on compiler versions that support it."

Ray Molenkamp noreply at git.blender.org
Thu Feb 13 15:06:06 CET 2020


Commit: 6022cd015ffe414b60229ba214dc1e324772e22d
Author: Ray Molenkamp
Date:   Thu Feb 13 07:04:30 2020 -0700
Branches: master
https://developer.blender.org/rB6022cd015ffe414b60229ba214dc1e324772e22d

Revert "Cleanup/MSVC: Enable C++ conformance mode on compiler versions that support it."

It is breaking compilation on some configurations, revert for now while
i see what is wrong.

This reverts commit 9fe469c110940af5d2525158305d5d365bd15276.

===================================================================

M	build_files/cmake/platform/platform_win32.cmake
M	extern/mantaflow/CMakeLists.txt
M	intern/ghost/intern/GHOST_ContextWGL.cpp
M	intern/mantaflow/CMakeLists.txt
M	source/blender/collada/MeshImporter.cpp

===================================================================

diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake
index 5eccc6c66be..653b3a9f508 100644
--- a/build_files/cmake/platform/platform_win32.cmake
+++ b/build_files/cmake/platform/platform_win32.cmake
@@ -144,19 +144,6 @@ else()
   set(CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} /nologo /J /Gd /MP /bigobj")
 endif()
 
-# C++ standards conformace (/permissive-) is available on msvc 15.5 (1912) and up
-if(MSVC_VERSION GREATER 1911 AND NOT MSVC_CLANG)
-  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /permissive-")
-  # MSVC 2017 emits a whole lot of warnings (C4199) about two-phase lookup
-  # in combination with OpenMP, however my current MSVC2019 (16.4) does not.
-  # From the documentation it is not entirely clear when this got solved,
-  # so for any compiler versions >= 15.5 and < 16.4 opt in to the old non-conforming behavior.
-  if(MSVC_VERSION LESS 1924)
-    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Zc:twoPhase-")
-  endif()
-endif()
-
-
 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd /ZI")
 set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MDd /ZI")
 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD")
diff --git a/extern/mantaflow/CMakeLists.txt b/extern/mantaflow/CMakeLists.txt
index 99d985578bd..d2f78f7ab6c 100644
--- a/extern/mantaflow/CMakeLists.txt
+++ b/extern/mantaflow/CMakeLists.txt
@@ -54,10 +54,6 @@ if(WITH_OPENVDB)
   add_definitions(-DOPENVDB_STATICLIB)
 endif()
 
-if(WIN32)
-  add_definitions(-D_USE_MATH_DEFINES)
-endif()
-
 set(INC
   ${MANTA_PP}
   ${MANTA_PP}/fileio
diff --git a/intern/ghost/intern/GHOST_ContextWGL.cpp b/intern/ghost/intern/GHOST_ContextWGL.cpp
index 6d5d4f75351..d4851450ce8 100644
--- a/intern/ghost/intern/GHOST_ContextWGL.cpp
+++ b/intern/ghost/intern/GHOST_ContextWGL.cpp
@@ -647,11 +647,9 @@ GHOST_TSuccess GHOST_ContextWGL::initializeDrawingContext()
 
   /* Silence warnings interpreted as errors by users when trying to get
    * a context with version higher than 3.3 Core. */
-  {
-    const bool silent = m_contextMajorVersion > 3;
-    if (!WIN32_CHK_SILENT(m_hGLRC != NULL, silent)) {
-      goto error;
-    }
+  const bool silent = m_contextMajorVersion > 3;
+  if (!WIN32_CHK_SILENT(m_hGLRC != NULL, silent)) {
+    goto error;
   }
 
   s_sharedCount++;
@@ -682,17 +680,15 @@ GHOST_TSuccess GHOST_ContextWGL::initializeDrawingContext()
   ::SwapBuffers(m_hDC);
 
 #ifndef NDEBUG
-  {
-    const char *vendor = reinterpret_cast<const char *>(glGetString(GL_VENDOR));
-    const char *renderer = reinterpret_cast<const char *>(glGetString(GL_RENDERER));
-    const char *version = reinterpret_cast<const char *>(glGetString(GL_VERSION));
+  const char *vendor = reinterpret_cast<const char *>(glGetString(GL_VENDOR));
+  const char *renderer = reinterpret_cast<const char *>(glGetString(GL_RENDERER));
+  const char *version = reinterpret_cast<const char *>(glGetString(GL_VERSION));
 
-    reportContextString("Vendor", m_dummyVendor, vendor);
-    reportContextString("Renderer", m_dummyRenderer, renderer);
-    reportContextString("Version", m_dummyVersion, version);
+  reportContextString("Vendor", m_dummyVendor, vendor);
+  reportContextString("Renderer", m_dummyRenderer, renderer);
+  reportContextString("Version", m_dummyVersion, version);
 
-    fprintf(stderr, "Context Version: %d.%d\n", m_contextMajorVersion, m_contextMinorVersion);
-  }
+  fprintf(stderr, "Context Version: %d.%d\n", m_contextMajorVersion, m_contextMinorVersion);
 #endif
 
   return GHOST_kSuccess;
diff --git a/intern/mantaflow/CMakeLists.txt b/intern/mantaflow/CMakeLists.txt
index b2a0ab30a0c..2d49f96a451 100644
--- a/intern/mantaflow/CMakeLists.txt
+++ b/intern/mantaflow/CMakeLists.txt
@@ -30,11 +30,6 @@ if(WITH_OPENVDB)
   add_definitions(-DOPENVDB_STATICLIB)
 endif()
 
-if(WIN32)
-  add_definitions(-D_USE_MATH_DEFINES)
-endif()
-
-
 set(INC
   extern
   intern/strings
diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp
index bc6dd4202b1..14c09a95d10 100644
--- a/source/blender/collada/MeshImporter.cpp
+++ b/source/blender/collada/MeshImporter.cpp
@@ -19,7 +19,10 @@
  */
 
 #include <algorithm>
-#include <iostream>
+
+#if !defined(WIN32)
+#  include <iostream>
+#endif
 
 /* COLLADABU_ASSERT, may be able to remove later */
 #include "COLLADABUPlatform.h"



More information about the Bf-blender-cvs mailing list