зеркало из https://github.com/mozilla/pjs.git
unified compiler dependent code (removed from unit-tests, inserted in header); fixed for egcs-1.1 well known bug (member using declarations don't work)
This commit is contained in:
Родитель
256cb9beaa
Коммит
590649bf2a
|
@ -151,7 +151,17 @@
|
|||
What do I have to beware of?
|
||||
*/
|
||||
|
||||
#if defined(__GNUG__) && (__GNUC_MINOR__ <= 90)
|
||||
#define NO_MEMBER_USING_DECLARATIONS
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER<1100)
|
||||
#define NO_EXPLICIT
|
||||
#endif
|
||||
|
||||
#ifdef NO_EXPLICIT
|
||||
#define explicit
|
||||
#endif
|
||||
|
||||
|
||||
template <class T>
|
||||
|
@ -165,10 +175,32 @@ class derived_safe : public T
|
|||
*/
|
||||
{
|
||||
private:
|
||||
#ifndef NO_MEMBER_USING_DECLARATIONS
|
||||
using T::AddRef;
|
||||
using T::Release;
|
||||
#else
|
||||
unsigned long AddRef() { }
|
||||
unsigned long Release() { }
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined(NO_MEMBER_USING_DECLARATIONS) && defined(NEED_UNUSED_VIRTUAL_IMPLEMENTATIONS)
|
||||
template <class T>
|
||||
unsigned long
|
||||
derived_safe<T>::AddRef()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
unsigned long
|
||||
derived_safe<T>::Release()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -19,11 +19,6 @@
|
|||
#define NOT_PRODUCTION_CODE
|
||||
#define USE_EXPERIMENTAL_SMART_POINTERS
|
||||
|
||||
// Oops. Still want to compile the test app under VC++ 4.2
|
||||
#if defined(_MSC_VER) && (_MSC_VER<1100)
|
||||
#define explicit
|
||||
#endif
|
||||
|
||||
#include <iostream.h>
|
||||
#include "COM_auto_ptr.h"
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче