Fix compile errors and warnings in MSVC 2010 / GCC 4.6

This commit is contained in:
rdb 2017-01-12 15:18:48 +01:00
parent e60d1e292e
commit a15d84dbeb
12 changed files with 25 additions and 14 deletions

View File

@ -40,7 +40,9 @@ using namespace std;
#define MOVE(x) x #define MOVE(x) x
#define DEFAULT_CTOR = default #define DEFAULT_CTOR = default
#define DEFAULT_DTOR = default #define DEFAULT_DTOR = default
#define DEFAULT_ASSIGN = default
#define DELETED = delete #define DELETED = delete
#define DELETED_ASSIGN = delete
#define EXPORT_TEMPLATE_CLASS(expcl, exptp, classname) #define EXPORT_TEMPLATE_CLASS(expcl, exptp, classname)
@ -169,6 +171,7 @@ template<class T> typename remove_reference<T>::type &&move(T &&t) {
# if __has_extension(cxx_defaulted_functions) # if __has_extension(cxx_defaulted_functions)
# define DEFAULT_CTOR = default # define DEFAULT_CTOR = default
# define DEFAULT_DTOR = default # define DEFAULT_DTOR = default
# define DEFAULT_ASSIGN = default
# endif # endif
# if __has_extension(cxx_deleted_functions) # if __has_extension(cxx_deleted_functions)
# define DELETED = delete # define DELETED = delete
@ -185,6 +188,7 @@ template<class T> typename remove_reference<T>::type &&move(T &&t) {
# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) # if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
# define DEFAULT_CTOR = default # define DEFAULT_CTOR = default
# define DEFAULT_DTOR = default # define DEFAULT_DTOR = default
# define DEFAULT_ASSIGN = default
# define DELETED = delete # define DELETED = delete
# endif # endif
@ -219,6 +223,7 @@ template<class T> typename remove_reference<T>::type &&move(T &&t) {
#if defined(_MSC_VER) && _MSC_VER >= 1800 // Visual Studio 2013 #if defined(_MSC_VER) && _MSC_VER >= 1800 // Visual Studio 2013
# define DEFAULT_CTOR = default # define DEFAULT_CTOR = default
# define DEFAULT_DTOR = default # define DEFAULT_DTOR = default
# define DEFAULT_ASSIGN = default
# define DELETED = delete # define DELETED = delete
#endif #endif
@ -244,8 +249,14 @@ template<class T> typename remove_reference<T>::type &&move(T &&t) {
#ifndef DEFAULT_DTOR #ifndef DEFAULT_DTOR
# define DEFAULT_DTOR {} # define DEFAULT_DTOR {}
#endif #endif
#ifndef DEFAULT_ASSIGN
# define DEFAULT_ASSIGN {return *this;}
#endif
#ifndef DELETED #ifndef DELETED
# define DELETED {assert(false);} # define DELETED {assert(false);}
# define DELETED_ASSIGN {assert(false);return *this;}
#else
# define DELETED_ASSIGN DELETED
#endif #endif

View File

@ -27,7 +27,7 @@ public:
private: private:
MutexDummyImpl(const MutexDummyImpl &copy) DELETED; MutexDummyImpl(const MutexDummyImpl &copy) DELETED;
MutexDummyImpl &operator = (const MutexDummyImpl &copy) DELETED; MutexDummyImpl &operator = (const MutexDummyImpl &copy) DELETED_ASSIGN;
public: public:
ALWAYS_INLINE void acquire(); ALWAYS_INLINE void acquire();

View File

@ -33,7 +33,7 @@ public:
private: private:
MutexPosixImpl(const MutexPosixImpl &copy) DELETED; MutexPosixImpl(const MutexPosixImpl &copy) DELETED;
MutexPosixImpl &operator = (const MutexPosixImpl &copy) DELETED; MutexPosixImpl &operator = (const MutexPosixImpl &copy) DELETED_ASSIGN;
public: public:
INLINE void acquire(); INLINE void acquire();

View File

@ -33,7 +33,7 @@ public:
private: private:
MutexSpinlockImpl(const MutexSpinlockImpl &copy) DELETED; MutexSpinlockImpl(const MutexSpinlockImpl &copy) DELETED;
MutexSpinlockImpl &operator = (const MutexSpinlockImpl &copy) DELETED; MutexSpinlockImpl &operator = (const MutexSpinlockImpl &copy) DELETED_ASSIGN;
public: public:
INLINE void acquire(); INLINE void acquire();

View File

@ -33,7 +33,7 @@ public:
private: private:
MutexWin32Impl(const MutexWin32Impl &copy) DELETED; MutexWin32Impl(const MutexWin32Impl &copy) DELETED;
MutexWin32Impl &operator = (const MutexWin32Impl &copy) DELETED; MutexWin32Impl &operator = (const MutexWin32Impl &copy) DELETED_ASSIGN;
public: public:
INLINE void acquire(); INLINE void acquire();

View File

@ -89,7 +89,7 @@ class EXPCL_DTOOL TypedObject : public MemoryBase {
public: public:
INLINE TypedObject() DEFAULT_CTOR; INLINE TypedObject() DEFAULT_CTOR;
INLINE TypedObject(const TypedObject &copy) DEFAULT_CTOR; INLINE TypedObject(const TypedObject &copy) DEFAULT_CTOR;
INLINE TypedObject &operator = (const TypedObject &copy) DEFAULT_CTOR; INLINE TypedObject &operator = (const TypedObject &copy) DEFAULT_ASSIGN;
PUBLISHED: PUBLISHED:
// A virtual destructor is just a good idea. // A virtual destructor is just a good idea.

View File

@ -161,7 +161,7 @@ write_public_keys(Filename outfile) {
} }
output_c_string(out, "prc_pubkey", i, mbio); output_c_string(out, "prc_pubkey", i, mbio);
BIO_reset(mbio); (void)BIO_reset(mbio);
out << "\n"; out << "\n";
} }
} }

View File

@ -70,7 +70,7 @@ class PointerTo : public PointerToBase<T> {
public: public:
typedef TYPENAME PointerToBase<T>::To To; typedef TYPENAME PointerToBase<T>::To To;
PUBLISHED: PUBLISHED:
ALWAYS_INLINE CONSTEXPR PointerTo() NOEXCEPT DEFAULT_CTOR; CONSTEXPR PointerTo() NOEXCEPT DEFAULT_CTOR;
ALWAYS_INLINE PointerTo(To *ptr) NOEXCEPT; ALWAYS_INLINE PointerTo(To *ptr) NOEXCEPT;
INLINE PointerTo(const PointerTo<T> &copy); INLINE PointerTo(const PointerTo<T> &copy);
@ -133,7 +133,7 @@ class ConstPointerTo : public PointerToBase<T> {
public: public:
typedef TYPENAME PointerToBase<T>::To To; typedef TYPENAME PointerToBase<T>::To To;
PUBLISHED: PUBLISHED:
ALWAYS_INLINE CONSTEXPR ConstPointerTo() NOEXCEPT DEFAULT_CTOR; CONSTEXPR ConstPointerTo() NOEXCEPT DEFAULT_CTOR;
ALWAYS_INLINE ConstPointerTo(const To *ptr) NOEXCEPT; ALWAYS_INLINE ConstPointerTo(const To *ptr) NOEXCEPT;
INLINE ConstPointerTo(const PointerTo<T> &copy); INLINE ConstPointerTo(const PointerTo<T> &copy);
INLINE ConstPointerTo(const ConstPointerTo<T> &copy); INLINE ConstPointerTo(const ConstPointerTo<T> &copy);

View File

@ -31,7 +31,7 @@ public:
typedef T To; typedef T To;
protected: protected:
ALWAYS_INLINE CONSTEXPR PointerToBase() NOEXCEPT DEFAULT_CTOR; CONSTEXPR PointerToBase() NOEXCEPT DEFAULT_CTOR;
INLINE PointerToBase(To *ptr); INLINE PointerToBase(To *ptr);
INLINE PointerToBase(const PointerToBase<T> &copy); INLINE PointerToBase(const PointerToBase<T> &copy);
INLINE ~PointerToBase(); INLINE ~PointerToBase();

View File

@ -14,7 +14,7 @@
/** /**
* *
*/ */
INLINE CONSTEXPR PointerToVoid:: CONSTEXPR PointerToVoid::
PointerToVoid() NOEXCEPT : _void_ptr(nullptr) { PointerToVoid() NOEXCEPT : _void_ptr(nullptr) {
} }
@ -30,7 +30,7 @@ PointerToVoid() NOEXCEPT : _void_ptr(nullptr) {
* Returns true if the PointerTo is a NULL pointer, false otherwise. (Direct * Returns true if the PointerTo is a NULL pointer, false otherwise. (Direct
* comparison to a NULL pointer also works.) * comparison to a NULL pointer also works.)
*/ */
ALWAYS_INLINE CONSTEXPR bool PointerToVoid:: CONSTEXPR bool PointerToVoid::
is_null() const { is_null() const {
return _void_ptr == nullptr; return _void_ptr == nullptr;
} }

View File

@ -32,14 +32,14 @@
*/ */
class EXPCL_PANDAEXPRESS PointerToVoid : public MemoryBase { class EXPCL_PANDAEXPRESS PointerToVoid : public MemoryBase {
protected: protected:
ALWAYS_INLINE CONSTEXPR PointerToVoid() NOEXCEPT; CONSTEXPR PointerToVoid() NOEXCEPT;
//INLINE ~PointerToVoid(); //INLINE ~PointerToVoid();
private: private:
PointerToVoid(const PointerToVoid &copy) DELETED; PointerToVoid(const PointerToVoid &copy) DELETED;
PUBLISHED: PUBLISHED:
ALWAYS_INLINE CONSTEXPR bool is_null() const; CONSTEXPR bool is_null() const;
INLINE size_t get_hash() const; INLINE size_t get_hash() const;
public: public:

View File

@ -39,7 +39,7 @@ public:
private: private:
// The assignment operator cannot be used for this class. // The assignment operator cannot be used for this class.
INLINE void operator = (const WritableParam &other) DELETED; WritableParam &operator = (const WritableParam &other) DELETED_ASSIGN;
public: public:
virtual TypeHandle get_type() const { virtual TypeHandle get_type() const {