Commit de8eae2b authored by Sean McBride's avatar Sean McBride
Browse files

Removed VS6 and VS7 workarounds

Assume that if _MSC_VER is defined that it is >= 1310
(ie VS7.1).

This improves the readability of the code, and slightly
improved code coverage.

Change-Id: Iffc601f4cff53c4e267835e39b2b17a3adf74494
parent fcf221c7
/* Compile if this is MSVC 6. */
#if defined(_MSC_VER) && (_MSC_VER == 1200)
int main()
{
return 0;
}
#endif
......@@ -24,10 +24,6 @@
/* Check for known compilers. */
#if defined(_MSC_VER)
# define VTK_CXX_MSVC
#endif
#if defined(__sgi) && !defined(__GNUC__)
# define VTK_CXX_SGI
# if !defined(_COMPILER_VERSION)
......@@ -53,11 +49,6 @@
# define VTK_CLASS_TEMPLATE_SPECIALIZATION /* empty */
#endif
// Check for MSVC.
#if defined(VTK_CXX_MSVC) && (_MSC_VER < 1310)
# define VTK_TYPENAME /* empty */
#endif
// Assume standard behavior if symbol is not already defined.
#if !defined(VTK_TYPENAME)
# define VTK_TYPENAME typename
......@@ -400,8 +391,8 @@ int TestNonTypeTemplate()
/* Test mixed type and non-type template arguments in a non-trival way. */
#if !(defined(VTK_CXX_MSVC) && (_MSC_VER < 1300)) && !defined(__BORLANDC__)
// Visual Studio 6 and Borland do not support this fancy array template.
#if !defined(__BORLANDC__)
// Borland does not support this fancy array template.
template <class T, int N>
int TestMixedTypeTemplateFunction(T (*)[N])
{
......@@ -567,8 +558,8 @@ int TestException()
void TestVoidReturnInner() {}
void TestVoidReturnOuter()
{
// Visual Studio 6 and MIPSpro 7.3 do not support void returns.
#if !(defined(_MSC_VER) && (_MSC_VER < 1300) || defined(_COMPILER_VERSION) && (_COMPILER_VERSION < 740))
// MIPSpro 7.3 does not support void returns.
#if !(defined(_COMPILER_VERSION) && (_COMPILER_VERSION < 740))
return TestVoidReturnInner();
#endif
}
......@@ -672,7 +663,7 @@ int main()
DO_TEST(TestFullySpecializedClass);
DO_TEST(TestIfScope);
DO_TEST(TestNonTypeTemplate);
#if !(defined(VTK_CXX_MSVC) && (_MSC_VER < 1300)) && !defined(__BORLANDC__)
#if !defined(__BORLANDC__)
DO_TEST(TestMixedTypeTemplate);
#endif
DO_TEST(TestBinaryWriting);
......
......@@ -767,7 +767,7 @@ virtual double *Get##name() \
// possible on this compiler.
# if defined(__GNUC__) && !defined(__INTEL_COMPILER) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
# define VTK_LEGACY(method) method __attribute__((deprecated))
# elif defined(_MSC_VER) && _MSC_VER >= 1300
# elif defined(_MSC_VER)
# define VTK_LEGACY(method) __declspec(deprecated) method
# else
# define VTK_LEGACY(method) method
......
......@@ -111,11 +111,7 @@ public:
back_insert_iterator& operator=(std::string::const_reference value)
{
#if defined(_MSC_VER) && (_MSC_VER < 1300) // MSVC 6
this->Container->append(1, value);
#else
this->Container->push_back(value);
#endif
return *this;
}
......
......@@ -992,25 +992,7 @@ T vtkVariantStringToNumeric(vtkStdString str, bool* valid, T* vtkNotUsed(ignored
//----------------------------------------------------------------------------
// Definition of ToNumeric
// Visual Studio 6 chokes with "error C2893: Failed to specialize function
// template" when the definition of ToNumeric is included here and it
// encounters the various callers of ToNumeric below. So for VS6 include the
// the implementation of ToNumeric at the bottom of the file.
//
#if !defined(_MSC_VER) || (_MSC_VER >= 1300)
# define VTK_VARIANT_TO_NUMERIC_CXX_INCLUDED
# include "vtkVariantToNumeric.cxx"
#endif
//----------------------------------------------------------------------------
// Explicit instantiations of ToNumeric
// Visual Studio 6 chokes with "fatal error C1001: INTERNAL COMPILER ERROR"
// when trying to use the vtkVariantToNumericInstantiateMacro, so don't...
//
#if defined(_MSC_VER) && (_MSC_VER < 1300)
# define VTK_VARIANT_NO_INSTANTIATE
#endif
#include "vtkVariantToNumeric.cxx"
//----------------------------------------------------------------------------
// Explicitly instantiate the ToNumeric member template to make sure
......@@ -1235,11 +1217,4 @@ ostream& operator << ( ostream& os, const vtkVariant& val )
return os;
}
//----------------------------------------------------------------------------
// Definition of ToNumeric if not already included above:
#if !defined(VTK_VARIANT_TO_NUMERIC_CXX_INCLUDED)
# define VTK_VARIANT_TO_NUMERIC_CXX_INCLUDED
# include "vtkVariantToNumeric.cxx"
#endif
#endif
......@@ -87,7 +87,7 @@ Do_not_include_vtkWin32Header_directly__vtkSystemIncludes_includes_it;
# define VTK_WORKAROUND_WINDOWS_MANGLE
#endif
#if ( _MSC_VER >= 1300 ) // Visual studio .NET
#if defined(_MSC_VER) // Visual studio
#pragma warning ( disable : 4311 )
#pragma warning ( disable : 4312 )
# define vtkGetWindowLong GetWindowLongPtr
......@@ -96,7 +96,7 @@ Do_not_include_vtkWin32Header_directly__vtkSystemIncludes_includes_it;
# define vtkGWL_WNDPROC GWLP_WNDPROC
# define vtkGWL_HINSTANCE GWLP_HINSTANCE
# define vtkGWL_USERDATA GWLP_USERDATA
#else // older or non-Visual studio
#else // non-Visual studio
# define vtkGetWindowLong GetWindowLong
# define vtkSetWindowLong SetWindowLong
# define vtkLONG LONG
......@@ -132,15 +132,6 @@ Do_not_include_vtkWin32Header_directly__vtkSystemIncludes_includes_it;
# endif
#endif
// MSVC 6.0 in release mode will warn about code it produces with its
// optimizer. Disable the warnings specifically for this
// configuration. Real warnings will be revealed by a debug build or
// by other compilers.
#if defined(_MSC_VER) && (_MSC_VER < 1300) && defined(NDEBUG)
# pragma warning ( disable : 4701 ) /* Variable may be used uninitialized. */
# pragma warning ( disable : 4702 ) /* Unreachable code. */
#endif
#if defined(__BORLANDC__)
// Disable Borland compiler warning messages that often occur in valid code.
# if !defined(VTK_DISPLAY_WIN32_WARNINGS)
......
......@@ -39,9 +39,7 @@ vtkStandardNewMacro(vtkOrderedTriangulator);
# ifndef __PLACEMENT_NEW_INLINE
# define __PLACEMENT_NEW_INLINE
inline void *__cdecl operator new(size_t, void *_P) { return (_P); }
# if _MSC_VER >= 1200
inline void __cdecl operator delete(void *, void *) { return; }
# endif
inline void __cdecl operator delete(void *, void *) { return; }
# endif
#else
# include <new>
......
......@@ -1282,16 +1282,6 @@ int vtkTetraTile::Refine(vtkSimpleCellTessellator* tess,
return numTetraCreated;
}
// With Visual Studio 7.0 in release mode, we have to disable the global
// optimization flag for compiling vtkTetraTile::Refine
// Here we restore the flag value (it does not mean we put the flag to
// on, the pragma syntax is confusing for that)
#ifdef _MSC_VER
# if _MSC_VER==1300
# pragma optimize("g",on)
# endif
#endif
//-----------------------------------------------------------------------------
// Create the tessellator helper with a default of 0.25 for threshold
//
......
......@@ -109,11 +109,7 @@ int vtkDirectory::Open(const char* name)
struct _finddata_t data; // data of current file
// First count the number of files in the directory
#if _MSC_VER < 1300
long srchHandle;
#else
intptr_t srchHandle;
#endif
srchHandle = _findfirst(buf, &data);
......
......@@ -20,14 +20,6 @@
#undef UGLY_ASPECT_RATIO_HACK
#undef DBG_MIDPTS
#if defined(_MSC_VER) && (_MSC_VER < 1300)
/* Ignore "return type for 'std::deque<int*>::const_iterator::operator ->'
* is 'int *const * ' (ie; not a UDT or reference to a UDT.
* Will produce errors if applied using infix notation)" warning on MSVC6.
*/
# pragma warning ( disable : 4284 )
#endif
#include <stack>
#include <algorithm>
......
......@@ -434,14 +434,6 @@ print >> genCode, """
#undef UGLY_ASPECT_RATIO_HACK
#undef DBG_MIDPTS
#if defined(_MSC_VER) && (_MSC_VER < 1300)
/* Ignore "return type for 'std::deque<int*>::const_iterator::operator ->'
* is 'int *const * ' (ie; not a UDT or reference to a UDT.
* Will produce errors if applied using infix notation)" warning on MSVC6.
*/
# pragma warning ( disable : 4284 )
#endif
#include <stack>
#include <algorithm>
......
......@@ -163,7 +163,7 @@ static void vtkLSGetLine( ifstream& deck, std::string& line )
return;
line += linechar;
}
#endif // !defined(_WIN32) || !defined(_MSC_VER) || (_MSC_VER < 1200) || (_MSC_VER >= 1300)
#endif
}
// Read in lines until one that's
......
......@@ -68,7 +68,7 @@
vtkStandardNewMacro(vtkVideoSource);
#if defined ( _MSC_VER ) && ( _MSC_VER >= 1300 ) // Visual studio .NET
#if defined(_MSC_VER)
#pragma warning ( disable : 4311 )
#pragma warning ( disable : 4312 )
#endif
......
......@@ -2413,14 +2413,7 @@ void vtkLabelHierarchy::Implementation::FillHierarchyRoot( LabelSet& anchors )
++ endRootAnchors;
}
}
#if ! ( defined(_MSC_VER) && (_MSC_VER < 1300) )
this->Hierarchy3->root()->value().insert( anchors.begin(), endRootAnchors );
#else
for ( LabelSet::iterator it = anchors.begin(); it != endRootAnchors; ++ it )
{
this->Hierarchy3->root()->value().insert( *it );
}
#endif
this->Hierarchy3->root()->value().insert( anchors.begin(), endRootAnchors );
anchors.erase( anchors.begin(), endRootAnchors );
}
......
......@@ -132,9 +132,7 @@ public:
{
if ( this != &rhs )
{
#if ! ( defined(_MSC_VER) && (_MSC_VER < 1300) )
std::multiset<vtkIdType,PriorityComparator>::operator = ( rhs );
#endif
this->TotalAnchors = rhs.TotalAnchors;
this->Size = rhs.Size;
for ( int i = 0; i < 3; ++ i )
......
......@@ -45,7 +45,7 @@
// To switch off deprecated warning about
// vtkPainterDeviceAdapter::MakeVertexEmphasisWithStencilCheck
#if defined(_MSC_VER) && _MSC_VER >= 1300
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4996)
#endif
......@@ -174,7 +174,7 @@ private:
void operator=(const vtkOpenGLPainterDeviceAdapter &); // Not implemented.
};
#if defined(_MSC_VER) && _MSC_VER >= 1300
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
......
......@@ -16,28 +16,6 @@
#ifndef _vtkTestDriver_h
#define _vtkTestDriver_h
// MSVC 6.0 warns about unused inline functions from <exception> and
// <crtdbg.h>. Unfortunately this pragma has to be in effect at the
// end of the translation unit so we cannot push/pop it around the
// include.
#if defined(_MSC_VER) && (_MSC_VER < 1300)
# pragma warning (disable: 4514) /* unreferenced inline function */
// Temporary suppression of this warning from CMake generated TestDriver
// code until it can be fixed in the generator...
# pragma warning (disable: 4701) /* local variable 'x' may be used
without having been initialized */
// Warnings that show up on vc6 dashboards since floating point
// exception handling was added to the test driver...
//
# pragma warning (disable: 4018) /* signed/unsigned mismatch */
# pragma warning (disable: 4146) /* unary minus operator applied unsigned */
# pragma warning (disable: 4284) /* return type for operator-> not a UDT */
# pragma warning (disable: 4290) /* C++ exception specification ignored */
#endif
#include <exception> // for std::exception
#include "vtkFloatingPointExceptions.h"
......
......@@ -268,10 +268,8 @@ octree_path<T_,R_,P_,O_,OP_,d_>& octree_cursor<T_,R_,P_,O_,OP_,d_>::operator = (
/**\brief Assignment operator (for copying paths of immutable nodes).
*
*/
#if ! ( defined(_MSC_VER) && (_MSC_VER < 1300) )
template< typename T_, typename R_, typename P_, typename O_, typename OP_, int d_ >
octree_path<T_,R_,P_,O_,OP_,d_>& octree_cursor<T_,R_,P_,O_,OP_,d_>::operator = ( const const_path& it )
{
return this->octree_path<T_,R_,P_,O_,OP_,d_>::operator=( it );
}
#endif
......@@ -50,9 +50,7 @@ public:
bool visit( const std::vector<int>& path );
virtual self_path& operator = ( const path& it );
#if ! ( defined(_MSC_VER) && (_MSC_VER < 1300) )
virtual self_path& operator = ( const const_path& it );
#endif
};
#endif // __octree_cursor
......@@ -283,7 +283,6 @@ octree_iterator< T_, R_, P_, O_, OP_, d_ >& octree_iterator<T_,R_,P_,O_,OP_,d_>:
/**\brief Assignment operator (for copying iterators of immutable nodes).
*
*/
#if ! ( defined(_MSC_VER) && (_MSC_VER < 1300) )
template< typename T_, typename R_, typename P_, typename O_, typename OP_, int d_ >
octree_iterator< T_, R_, P_, O_, OP_, d_ >& octree_iterator<T_,R_,P_,O_,OP_,d_>::operator = ( const const_iterator& it )
{
......@@ -292,7 +291,6 @@ octree_iterator< T_, R_, P_, O_, OP_, d_ >& octree_iterator<T_,R_,P_,O_,OP_,d_>:
this->_M_only_leaf_nodes = it._M_only_leaf_nodes;
return *this;
}
#endif
/**\fn template< typename T_, typename R_, typename P_, typename O_, typename OP_, int d_ > \
* self_iterator& octree_iterator<T_,R_,P_,O_,OP_,d_>::operator ++ ()
......
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