Remove MSVC6 support.

Don't support this compiler any more, this allows to get rid of tons of
MSVC6-specific workarounds, in particular we can now use Bind() and natural
template functions calls in the library code.

Also remove MSVC6 project and solution files and don't generate them when
bakefile_gen is ran any more (removing the remaining occurrences of msvc6prj
from the bakefiles results in weird bake-time errors, so it's simpler to just
leave them there).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-05-15 22:32:17 +00:00
parent 28f9670787
commit f4b80e5337
289 changed files with 394 additions and 38949 deletions

View File

@@ -12,27 +12,11 @@
#include "wx/defs.h"
// NB: This code is intentionally written without partial templates
// specialization, because some older compilers (notably VC6) don't
// support it.
namespace wxPrivate
{
template <bool Cond>
struct wxIfImpl
// broken VC6 needs not just an incomplete template class declaration but a
// "skeleton" declaration of the specialized versions below as it apparently
// tries to look up the types in the generic template definition at some moment
// even though it ends up by using the correct specialization in the end -- but
// without this skeleton it doesn't recognize Result as a class at all below
#if defined(__VISUALC__) && !wxCHECK_VISUALC_VERSION(7)
{
template<typename TTrue, typename TFalse> struct Result {};
}
#endif // VC++ <= 6
;
struct wxIfImpl;
// specialization for true:
template <>

View File

@@ -29,28 +29,18 @@
namespace wxPrivate
{
// Helper macro to define a constant inside a template class: it's needed
// because MSVC6 doesn't support initializing static integer members but the
// usual workaround of using enums instead doesn't work for Borland (at least
// in template classes).
#ifdef __VISUALC6__
#define wxDEFINE_CLASS_INT_CONST(name, value) enum { name = value }
#else
#define wxDEFINE_CLASS_INT_CONST(name, value) static const int name = value
#endif
template<typename T>
struct TypeHierarchy
{
// consider unknown types (e.g. objects, pointers) to be of highest
// level, always convert to them if they occur
wxDEFINE_CLASS_INT_CONST( level, 9999 );
static const int level = 9999;
};
#define WX_TYPE_HIERARCHY_LEVEL(level_num, type) \
template<> struct TypeHierarchy<type> \
{ \
wxDEFINE_CLASS_INT_CONST( level, level_num ); \
static const int level = level_num; \
}
WX_TYPE_HIERARCHY_LEVEL( 1, char);

View File

@@ -20,7 +20,7 @@
template<typename T>
struct wxIsMovable
{
wxDEFINE_TEMPLATE_BOOL_VALUE(wxIsPod<T>::value);
static const bool value = wxIsPod<T>::value;
};
// Macro to add wxIsMovable<T> specialization for given type that marks it

View File

@@ -18,22 +18,11 @@
// <tr1/type_traits>, while GCC 4.3 and later have it in <type_traits>.
//
// This macro declares something called "value" inside a class declaration.
//
// It has to be used because VC6 doesn't handle initialization of the static
// variables in the class declaration itself while BCC5.82 doesn't understand
// enums (it compiles the template fine but can't use it later)
#if defined(__VISUALC__) && !wxCHECK_VISUALC_VERSION(7)
#define wxDEFINE_TEMPLATE_BOOL_VALUE(val) enum { value = val }
#else
#define wxDEFINE_TEMPLATE_BOOL_VALUE(val) static const bool value = val
#endif
// Helper to decide if an object of type T is POD (Plain Old Data)
template<typename T>
struct wxIsPod
{
wxDEFINE_TEMPLATE_BOOL_VALUE(false);
static const bool value = false;
};
// Macro to add wxIsPod<T> specialization for given type that marks it
@@ -41,7 +30,7 @@ struct wxIsPod
#define WX_DECLARE_TYPE_POD(type) \
template<> struct wxIsPod<type> \
{ \
wxDEFINE_TEMPLATE_BOOL_VALUE(true); \
static const bool value = true; \
};
WX_DECLARE_TYPE_POD(bool)
@@ -64,11 +53,6 @@ WX_DECLARE_TYPE_POD(wxLongLong_t)
WX_DECLARE_TYPE_POD(wxULongLong_t)
#endif
// Visual C++ 6.0 can't compile partial template specializations and as this is
// only an optimization, we can live with pointers not being recognized as
// POD types under VC6
#if !defined(__VISUALC__) || wxCHECK_VISUALC_VERSION(7)
// pointers are Plain Old Data:
template<typename T>
struct wxIsPod<T*>
@@ -82,6 +66,4 @@ struct wxIsPod<const T*>
static const bool value = true;
};
#endif // !VC++ < 7
#endif // _WX_META_POD_H_

View File

@@ -13,10 +13,6 @@
// wxRemoveRef<> is similar to C++11 std::remove_reference<> but works with all
// compilers (but, to compensate for this, doesn't work with rvalue references).
// Except that it doesn't work with VC++ 6 as there doesn't seem to be any way
// to partially specialize a template for references with it.
#ifndef __VISUALC6__
template <typename T>
struct wxRemoveRef
{
@@ -29,8 +25,9 @@ struct wxRemoveRef<T&>
typedef T type;
};
// Define this for compatibility with the previous versions in which
// wxRemoveRef() wasn't always defined as we supported MSVC6 for which it
// couldn't be implemented.
#define wxHAS_REMOVEREF
#endif // !__VISUALC6__
#endif // _WX_META_REMOVEREF_H_