[Paraview-developers] Re: [vtk-developers] Removed windows.h from VTK headers.

Brad King brad.king at kitware.com
Fri Dec 17 08:20:05 EST 2004


John Biddiscombe (CSCS) wrote:
> Couldn't we
> #include "vtkWindows.h" which would simply include windows as usual and 
> then #undef all the clashing names that are causing trouble.
> If users are then having trouble calling windows functions because of 
> their removal, they can
> #include "vtkWindowsUnMangle.h ....." which will redef the undef'ed 
> methods. Not many users will be calling the windows functions that are 
> renamed and they can easily insert #ifdefs in their code without vtk 
> having to be bludgeoned into conformance

This solution would not provide the compile time reduction for VTK and 
would still require changes to application code (and probably even 
more).  Any place the user would add vtkWindowsUnMangle.h you can just 
add vtkWindows.h under the current solution.  Besides, I do not like the 
idea of redefining macros defined by a system header.  The current 
solution never actually changes these definitions.  It just temporarily 
adds more.

Right now you can fix your application very quickly by just adding this 
to your CMake code:

ADD_DEFINITIONS(-DVTK_INCLUDE_WINDOWS_H)

and then using the script in VTK/Utilities/Upgrading to help find 
methods whose names might have changed.  Again, to put this in 
perspective it took me less than an hour to fix ALL of ParaView, which 
is one of the largest VTK applications ever created.

-Brad


More information about the Paraview-developers mailing list