Commit 33a743d2 authored by Sean McBride's avatar Sean McBride

Hoist _snprintf hack up to vtkConfigure.h

Since VS 2015 now supports proper snprintf,
VTK can just start using it anywhere as normal
with the workaround moved to vtkConfigure.h.

One day the pre-VS2015 workaround can be removed.
parent 86347484
...@@ -172,4 +172,12 @@ ...@@ -172,4 +172,12 @@
# define VTK_HAS_STD_UNIQUE_PTR # define VTK_HAS_STD_UNIQUE_PTR
#endif #endif
/* MS Visual Studio 2015 finally supports C99/C++11's snprintf but
* for older versions, use _snprintf instead. Annoyingly, its semantics
* are slightly different, but still better than using sprintf.
*/
#if defined(_MSC_VER) && (_MSC_VER < 1900)
# define snprintf _snprintf
#endif
#endif // vtkConfigure_h #endif // vtkConfigure_h
...@@ -20,10 +20,6 @@ ...@@ -20,10 +20,6 @@
#include <string> #include <string>
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define snprintf _snprintf
#endif
static const char *vtkDebugLeaksIgnoreClasses[] = { static const char *vtkDebugLeaksIgnoreClasses[] = {
0 0
}; };
......
...@@ -69,10 +69,6 @@ ...@@ -69,10 +69,6 @@
# include <malloc.h> # include <malloc.h>
#endif /* EXODUSII_HAVE_MALLOC_H */ #endif /* EXODUSII_HAVE_MALLOC_H */
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define snprintf _snprintf
#endif
/// Define this to get printouts summarizing array glomming process /// Define this to get printouts summarizing array glomming process
#undef VTK_DBG_GLOM #undef VTK_DBG_GLOM
......
...@@ -42,10 +42,6 @@ ...@@ -42,10 +42,6 @@
#include <sstream> #include <sstream>
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define snprintf _snprintf
#endif
vtkStandardNewMacro(vtkRIBExporter); vtkStandardNewMacro(vtkRIBExporter);
typedef double RtColor[3]; typedef double RtColor[3];
......
...@@ -25,10 +25,6 @@ ...@@ -25,10 +25,6 @@
#include <sstream> #include <sstream>
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define snprintf _snprintf
#endif
vtkStandardNewMacro(vtkGeoJSONWriter); vtkStandardNewMacro(vtkGeoJSONWriter);
#define VTK_GJWRITER_MAXPOINTS 32000 #define VTK_GJWRITER_MAXPOINTS 32000
......
...@@ -27,10 +27,6 @@ extern "C" { ...@@ -27,10 +27,6 @@ extern "C" {
#include <setjmp.h> #include <setjmp.h>
} }
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define snprintf _snprintf
#endif
vtkStandardNewMacro(vtkJPEGWriter); vtkStandardNewMacro(vtkJPEGWriter);
vtkCxxSetObjectMacro(vtkJPEGWriter,Result,vtkUnsignedCharArray); vtkCxxSetObjectMacro(vtkJPEGWriter,Result,vtkUnsignedCharArray);
......
...@@ -24,10 +24,6 @@ ...@@ -24,10 +24,6 @@
#include <vector> #include <vector>
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define snprintf _snprintf
#endif
class vtkPNGWriter::vtkInternals class vtkPNGWriter::vtkInternals
{ {
public: public:
......
...@@ -21,10 +21,6 @@ ...@@ -21,10 +21,6 @@
#include "vtkStreamingDemandDrivenPipeline.h" #include "vtkStreamingDemandDrivenPipeline.h"
#include "vtk_tiff.h" #include "vtk_tiff.h"
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define snprintf _snprintf
#endif
vtkStandardNewMacro(vtkTIFFWriter); vtkStandardNewMacro(vtkTIFFWriter);
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
......
...@@ -71,10 +71,6 @@ POSSIBILITY OF SUCH DAMAGES. ...@@ -71,10 +71,6 @@ POSSIBILITY OF SUCH DAMAGES.
#include <map> #include <map>
#include <sstream> #include <sstream>
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define snprintf _snprintf
#endif
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// A container for mapping attribute names to arrays // A container for mapping attribute names to arrays
class vtkMINCImageAttributeMap class vtkMINCImageAttributeMap
......
...@@ -87,10 +87,6 @@ POSSIBILITY OF SUCH DAMAGES. ...@@ -87,10 +87,6 @@ POSSIBILITY OF SUCH DAMAGES.
#include <vector> #include <vector>
#include <map> #include <map>
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define snprintf _snprintf
#endif
#define VTK_MINC_MAX_DIMS 8 #define VTK_MINC_MAX_DIMS 8
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
......
...@@ -48,10 +48,6 @@ ...@@ -48,10 +48,6 @@
#include <cstdio> // for snprintf #include <cstdio> // for snprintf
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define snprintf _snprintf
#endif
#undef VTK_DBG_LAYOUT #undef VTK_DBG_LAYOUT
vtkStandardNewMacro(vtkScalarBarActor); vtkStandardNewMacro(vtkScalarBarActor);
......
...@@ -40,10 +40,6 @@ PURPOSE. See the above copyright notice for more information. ...@@ -40,10 +40,6 @@ PURPOSE. See the above copyright notice for more information.
#include "vtkTrivialProducer.h" #include "vtkTrivialProducer.h"
#include "vtkViewport.h" #include "vtkViewport.h"
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define snprintf _snprintf
#endif
struct _xmlNode; struct _xmlNode;
#define VTK_MAX_PLOTS 50 #define VTK_MAX_PLOTS 50
......
...@@ -49,10 +49,6 @@ ...@@ -49,10 +49,6 @@
#include <fstream> #include <fstream>
using std::ofstream; using std::ofstream;
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define snprintf _snprintf
#endif
vtkStandardNewMacro(vtkDynamic2DLabelMapper); vtkStandardNewMacro(vtkDynamic2DLabelMapper);
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
......
...@@ -46,10 +46,6 @@ vtkStandardNewMacro(vtkLabeledDataMapper); ...@@ -46,10 +46,6 @@ vtkStandardNewMacro(vtkLabeledDataMapper);
vtkCxxSetObjectMacro(vtkLabeledDataMapper,Transform,vtkTransform); vtkCxxSetObjectMacro(vtkLabeledDataMapper,Transform,vtkTransform);
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define snprintf _snprintf
#endif
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
template<typename T> template<typename T>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment