Fix HAVE_ROUND-related build warnings in Visual Studio 2013

When built with certain versions of Python, a VTK build with VTK_WRAP_PYTHON enabled results in many build warnings. For example:

Python 2.7.10:

c:\python27\include\pyconfig.h(444): warning C4005: 'HAVE_ROUND' : macro redefinition
          C:\dev\VTK\Utilities\Python\vtkPython.h(77) : see previous definition of 'HAVE_ROUND'

This warning occurs because both vtkPython.h and Python.h define the HAVE_ROUND macro, but the definitions don't match. Python 2.7.9+ and Python 3.4.2+ define HAVE_ROUND when compiling with Visual Studio 2013+ (see http://bugs.python.org/issue21958).

Python 3.4.1:

c:\python34\include\pymath.h(22): warning C4273: 'round' : inconsistent dll linkage
          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\math.h(516) : see previous definition of 'round'
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xtgmath.h(206): warning C4273: 'round' : inconsistent dll linkage
          C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\math.h(516) : see previous definition of 'round'

This warning occurs because neither Python.h nor vtkPython.h define HAVE_ROUND.

This commit removes the build warnings by:

  • changing the HAVE_ROUND macro definition to match Python's definition
  • removing the Python version check

Merge request reports

Loading