Merge topic 'remove-ancient-msvc-workarounds'

12cb0b86 Help: Update developer manual with some C++ features now permitted.
ba74465f cmGeneratorTarget: Remove MSVC7 workaround
41363c0c VisualStudio: Remove MSVC6 compatibility macro.
4efcfe52 cmSystemTools: Remove MSVC6 compatibility define.
5f4695cd cmStandardIncludes: Remove MSVC6 condition for cmArrayBegin macro.
7a064337 cmFindCommon: Remove MSVC6 workaround for nested struct private access.
fdb73547 cmTarget: Remove std::min and std::max MSVC6 compatibility code.
This commit is contained in:
Brad King 2014-11-25 10:28:57 -05:00 committed by CMake Topic Stage
commit c7b9fad117
7 changed files with 5 additions and 57 deletions

View File

@ -147,7 +147,7 @@ A loop must be used instead:
theSet.insert(*it); theSet.insert(*it);
} }
.. MSVC6, SunCC 5.9 .. SunCC 5.9
Template Parameter Defaults Template Parameter Defaults
--------------------------- ---------------------------
@ -177,12 +177,6 @@ this does not work with other ancient compilers:
and invoke it with the value ``0`` explicitly in all cases. and invoke it with the value ``0`` explicitly in all cases.
std::min and std::max
---------------------
``min`` and ``max`` are defined as macros on some systems. ``std::min`` and
``std::max`` may not be used. Use ``cmMinimum`` and ``cmMaximum`` instead.
size_t size_t
------ ------

View File

@ -34,8 +34,6 @@ static bool LogErrorsAsMessages;
// Copied from a correct comdef.h to avoid problems with deficient versions // Copied from a correct comdef.h to avoid problems with deficient versions
// of comdef.h that exist in the wild... Fixes issue #7533. // of comdef.h that exist in the wild... Fixes issue #7533.
// //
#if ( _MSC_VER >= 1300 )
// VS7 and later:
#ifdef _NATIVE_WCHAR_T_DEFINED #ifdef _NATIVE_WCHAR_T_DEFINED
# ifdef _DEBUG # ifdef _DEBUG
# pragma comment(lib, "comsuppwd.lib") # pragma comment(lib, "comsuppwd.lib")
@ -49,10 +47,6 @@ static bool LogErrorsAsMessages;
# pragma comment(lib, "comsupp.lib") # pragma comment(lib, "comsupp.lib")
# endif # endif
#endif #endif
#else
// VS6 only had comsupp.lib:
# pragma comment(lib, "comsupp.lib")
#endif
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------

View File

@ -33,10 +33,6 @@ public:
protected: protected:
friend class cmSearchPath; friend class cmSearchPath;
/* VS6 is broken and can't pass protected class definitions to child classes */
#if defined(_MSC_VER) && (_MSC_VER < 1300)
public:
#endif
/** Used to define groups of path labels */ /** Used to define groups of path labels */
class PathGroup : public cmPathLabel class PathGroup : public cmPathLabel
{ {
@ -61,9 +57,6 @@ public:
static PathLabel CMakeSystem; static PathLabel CMakeSystem;
static PathLabel Guess; static PathLabel Guess;
}; };
#if defined(_MSC_VER) && (_MSC_VER < 1300)
protected:
#endif
enum RootPathMode { RootPathModeNever, enum RootPathMode { RootPathModeNever,
RootPathModeOnly, RootPathModeOnly,

View File

@ -56,7 +56,6 @@ struct ModuleDefinitionFileTag {};
struct AppManifestTag{}; struct AppManifestTag{};
struct CertificatesTag{}; struct CertificatesTag{};
#if !defined(_MSC_VER) || _MSC_VER >= 1310
template<typename Tag, typename OtherTag> template<typename Tag, typename OtherTag>
struct IsSameTag struct IsSameTag
{ {
@ -72,25 +71,6 @@ struct IsSameTag<Tag, Tag>
Result = true Result = true
}; };
}; };
#else
struct IsSameTagBase
{
typedef char (&no_type)[1];
typedef char (&yes_type)[2];
template<typename T> struct Check;
template<typename T> static yes_type check(Check<T>*, Check<T>*);
static no_type check(...);
};
template<typename Tag1, typename Tag2>
struct IsSameTag: public IsSameTagBase
{
enum {
Result = (sizeof(check(static_cast< Check<Tag1>* >(0),
static_cast< Check<Tag2>* >(0))) ==
sizeof(yes_type))
};
};
#endif
template<bool> template<bool>
struct DoAccept struct DoAccept

View File

@ -393,8 +393,7 @@ inline bool cmHasLiteralSuffixImpl(const char* str1,
return len >= N && strcmp(str1 + len - N, str2) == 0; return len >= N && strcmp(str1 + len - N, str2) == 0;
} }
#if defined(_MSC_VER) && _MSC_VER < 1300 \ #if defined(__GNUC__) && __GNUC__ < 3
|| defined(__GNUC__) && __GNUC__ < 3
#define cmArrayBegin(a) a #define cmArrayBegin(a) a
#define cmArraySize(a) (sizeof(a)/sizeof(*a)) #define cmArraySize(a) (sizeof(a)/sizeof(*a))

View File

@ -9,9 +9,7 @@
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information. See the License for more information.
============================================================================*/ ============================================================================*/
#if defined(_MSC_VER) && _MSC_VER < 1300
# define _WIN32_WINNT 0x0400 /* for wincrypt.h */
#endif
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>

View File

@ -4781,16 +4781,6 @@ std::pair<bool, const char*> consistentStringProperty(const char *lhs,
return std::make_pair(b, b ? lhs : 0); return std::make_pair(b, b ? lhs : 0);
} }
#if defined(_MSC_VER) && _MSC_VER <= 1200
template<typename T> const T&
cmMaximum(const T& l, const T& r) {return l > r ? l : r;}
template<typename T> const T&
cmMinimum(const T& l, const T& r) {return l < r ? l : r;}
#else
#define cmMinimum std::min
#define cmMaximum std::max
#endif
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::pair<bool, const char*> consistentNumberProperty(const char *lhs, std::pair<bool, const char*> consistentNumberProperty(const char *lhs,
const char *rhs, const char *rhs,
@ -4814,11 +4804,11 @@ std::pair<bool, const char*> consistentNumberProperty(const char *lhs,
if (t == NumberMaxType) if (t == NumberMaxType)
{ {
return std::make_pair(true, cmMaximum(lnum, rnum) == lnum ? lhs : rhs); return std::make_pair(true, std::max(lnum, rnum) == lnum ? lhs : rhs);
} }
else else
{ {
return std::make_pair(true, cmMinimum(lnum, rnum) == lnum ? lhs : rhs); return std::make_pair(true, std::min(lnum, rnum) == lnum ? lhs : rhs);
} }
} }