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:
105
include/wx/any.h
105
include/wx/any.h
@@ -102,16 +102,10 @@ public:
|
||||
Use this template function for checking if wxAnyValueType represents
|
||||
a specific C++ data type.
|
||||
|
||||
@remarks This template function does not work on some older compilers
|
||||
(such as Visual C++ 6.0). For full compiler compatibility
|
||||
please use wxANY_VALUE_TYPE_CHECK_TYPE(valueTypePtr, T) macro
|
||||
instead.
|
||||
|
||||
@see wxAny::CheckType()
|
||||
*/
|
||||
// FIXME-VC6: remove this hack when VC6 is no longer supported
|
||||
template <typename T>
|
||||
bool CheckType(T* reserved = NULL) const;
|
||||
bool CheckType() const;
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
virtual const wxTypeInfo* GetTypeInfo() const = 0;
|
||||
@@ -139,8 +133,9 @@ private:
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// This method of checking the type is compatible with VC6
|
||||
// Deprecated macro for checking the type which was originally introduced for
|
||||
// MSVC6 compatibility and is not needed any longer now that this compiler is
|
||||
// not supported any more.
|
||||
#define wxANY_VALUE_TYPE_CHECK_TYPE(valueTypePtr, T) \
|
||||
wxAnyValueTypeImpl<T>::IsSameClass(valueTypePtr)
|
||||
|
||||
@@ -183,12 +178,6 @@ public: \
|
||||
wxAnyValueTypeScopedPtr CLS::sm_instance(new CLS());
|
||||
|
||||
|
||||
#ifdef __VISUALC6__
|
||||
// "non dll-interface class 'xxx' used as base interface
|
||||
#pragma warning (push)
|
||||
#pragma warning (disable:4275)
|
||||
#endif
|
||||
|
||||
/**
|
||||
Following are helper classes for the wxAnyValueTypeImplBase.
|
||||
*/
|
||||
@@ -266,6 +255,10 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <typename T>
|
||||
struct wxAnyAsImpl;
|
||||
|
||||
} // namespace wxPrivate
|
||||
|
||||
|
||||
@@ -664,11 +657,6 @@ public:
|
||||
|
||||
#endif // wxUSE_VARIANT
|
||||
|
||||
#ifdef __VISUALC6__
|
||||
// Re-enable useless VC6 warnings
|
||||
#pragma warning (pop)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
Let's define a discrete Null value so we don't have to really
|
||||
@@ -720,7 +708,6 @@ wxConvertAnyToVariant(const wxAny& any, wxVariant* variant);
|
||||
|
||||
#endif // wxUSE_VARIANT
|
||||
|
||||
|
||||
//
|
||||
// The wxAny class represents a container for any type. A variant's value
|
||||
// can be changed at run time, possibly to a different type of value.
|
||||
@@ -790,15 +777,10 @@ public:
|
||||
Use this template function for checking if this wxAny holds
|
||||
a specific C++ data type.
|
||||
|
||||
@remarks This template function does not work on some older compilers
|
||||
(such as Visual C++ 6.0). For full compiler ccompatibility
|
||||
please use wxANY_CHECK_TYPE(any, T) macro instead.
|
||||
|
||||
@see wxAnyValueType::CheckType()
|
||||
*/
|
||||
// FIXME-VC6: remove this hack when VC6 is no longer supported
|
||||
template <typename T>
|
||||
bool CheckType(T* = NULL) const
|
||||
bool CheckType() const
|
||||
{
|
||||
return m_type->CheckType<T>();
|
||||
}
|
||||
@@ -962,14 +944,16 @@ public:
|
||||
@remarks For convenience, conversion is done when T is wxString. This
|
||||
is useful when a string literal (which are treated as
|
||||
const char* and const wchar_t*) has been assigned to wxAny.
|
||||
|
||||
This template function may not work properly with Visual C++
|
||||
6. For full compiler compatibility, please use
|
||||
wxANY_AS(any, T) macro instead.
|
||||
*/
|
||||
// FIXME-VC6: remove this hack when VC6 is no longer supported
|
||||
template<typename T>
|
||||
template <typename T>
|
||||
T As(T* = NULL) const
|
||||
{
|
||||
return wxPrivate::wxAnyAsImpl<T>::DoAs(*this);
|
||||
}
|
||||
|
||||
// Semi private helper: get the value without coercion, for all types.
|
||||
template <typename T>
|
||||
T RawAs() const
|
||||
{
|
||||
if ( !wxAnyValueTypeImpl<T>::IsSameClass(m_type) )
|
||||
{
|
||||
@@ -979,19 +963,6 @@ public:
|
||||
return static_cast<T>(wxAnyValueTypeImpl<T>::GetValue(m_buffer));
|
||||
}
|
||||
|
||||
// Allow easy conversion from 'const char *' etc. to wxString
|
||||
// FIXME-VC6: remove this hack when VC6 is no longer supported
|
||||
//template<>
|
||||
wxString As(wxString*) const
|
||||
{
|
||||
wxString value;
|
||||
if ( !GetAs(&value) )
|
||||
{
|
||||
wxFAIL_MSG("Incorrect or non-convertible data type");
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
const wxTypeInfo* GetTypeInfo() const
|
||||
{
|
||||
@@ -1087,22 +1058,52 @@ private:
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// This method of checking the type is compatible with VC6
|
||||
namespace wxPrivate
|
||||
{
|
||||
|
||||
// Dispatcher for template wxAny::As() implementation which is different for
|
||||
// wxString and all the other types: the generic implementation check if the
|
||||
// value is of the right type and returns it.
|
||||
template <typename T>
|
||||
struct wxAnyAsImpl
|
||||
{
|
||||
static T DoAs(const wxAny& any)
|
||||
{
|
||||
return any.RawAs<T>();
|
||||
}
|
||||
};
|
||||
|
||||
// Specialization for wxString does coercion.
|
||||
template <>
|
||||
struct wxAnyAsImpl<wxString>
|
||||
{
|
||||
static wxString DoAs(const wxAny& any)
|
||||
{
|
||||
wxString value;
|
||||
if ( !any.GetAs(&value) )
|
||||
{
|
||||
wxFAIL_MSG("Incorrect or non-convertible data type");
|
||||
}
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
// See comment for wxANY_VALUE_TYPE_CHECK_TYPE.
|
||||
#define wxANY_CHECK_TYPE(any, T) \
|
||||
wxANY_VALUE_TYPE_CHECK_TYPE((any).GetType(), T)
|
||||
|
||||
|
||||
//
|
||||
// This method of getting the value is compatible with VC6
|
||||
// This macro shouldn't be used any longer for the same reasons as
|
||||
// wxANY_VALUE_TYPE_CHECK_TYPE(), just call As() directly.
|
||||
#define wxANY_AS(any, T) \
|
||||
(any).As(static_cast<T*>(NULL))
|
||||
|
||||
|
||||
template<typename T>
|
||||
inline bool wxAnyValueType::CheckType(T* reserved) const
|
||||
inline bool wxAnyValueType::CheckType() const
|
||||
{
|
||||
wxUnusedVar(reserved);
|
||||
return wxAnyValueTypeImpl<T>::IsSameClass(this);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user