Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Directly use the __DEPRECATED token to avoid warnings about

deprecated headers coming from VTK.  This works for GCC, and
the __DEPRECATED token has been used at least as far back
as GCC 4.2.
  • Loading branch information...
commit 0dd148f5164131ea6bea45e15a87f1695d80c992 1 parent ea1c143
John W. Peterson jwpeterson authored
Showing with 21 additions and 0 deletions.
  1. +21 −0 src/mesh/vtk_io.C
21 src/mesh/vtk_io.C
View
@@ -37,6 +37,22 @@
#ifdef LIBMESH_HAVE_VTK
#include "libmesh/ignore_warnings.h"
+
+// Hack to avoid warnings coming from stupid VTK files that include
+// deprecated headers. We only do this for GCC >= 4.2, but it may
+// work for other compilers as well. Note: technically it is
+// illegal to mess with identifiers that have double leading
+// underscores... but it is also technically super annoying to see
+// this warning all the time.
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__)
+#if __GNUC__ > 3 && __GNUC_MINOR__ > 1
+#ifdef __DEPRECATED
+ #undef __DEPRECATED
+ #define LIBMESH_REDEFINE_DEPRECATED
+#endif // if __DEPRECATED
+#endif // if version
+#endif // if gnu
+
#include "vtkXMLUnstructuredGridReader.h"
#include "vtkXMLUnstructuredGridWriter.h"
#include "vtkXMLPUnstructuredGridWriter.h"
@@ -48,6 +64,11 @@
#include "vtkPointData.h"
#include "vtkPoints.h"
#include "vtkSmartPointer.h"
+
+#ifdef LIBMESH_REDEFINE_DEPRECATED
+ #define __DEPRECATED
+#endif
+
#include "libmesh/restore_warnings.h"
// A convenient macro for comparing VTK versions. Returns 1 if the

3 comments on commit 0dd148f

cato-

You might also just define "VTK_LEGACY_REMOVE" which should prevent vtk from using the old headers

John W. Peterson
Owner
John W. Peterson
Owner

Committed in ce703f9

Please sign in to comment.
Something went wrong with that request. Please try again.