mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
Fix compile errors and warnings in MSVC 2010 / GCC 4.6
This commit is contained in:
parent
e60d1e292e
commit
a15d84dbeb
@ -40,7 +40,9 @@ using namespace std;
|
||||
#define MOVE(x) x
|
||||
#define DEFAULT_CTOR = default
|
||||
#define DEFAULT_DTOR = default
|
||||
#define DEFAULT_ASSIGN = default
|
||||
#define DELETED = delete
|
||||
#define DELETED_ASSIGN = delete
|
||||
|
||||
#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)
|
||||
# define DEFAULT_CTOR = default
|
||||
# define DEFAULT_DTOR = default
|
||||
# define DEFAULT_ASSIGN = default
|
||||
# endif
|
||||
# if __has_extension(cxx_deleted_functions)
|
||||
# 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)
|
||||
# define DEFAULT_CTOR = default
|
||||
# define DEFAULT_DTOR = default
|
||||
# define DEFAULT_ASSIGN = default
|
||||
# define DELETED = delete
|
||||
# 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
|
||||
# define DEFAULT_CTOR = default
|
||||
# define DEFAULT_DTOR = default
|
||||
# define DEFAULT_ASSIGN = default
|
||||
# define DELETED = delete
|
||||
#endif
|
||||
|
||||
@ -244,8 +249,14 @@ template<class T> typename remove_reference<T>::type &&move(T &&t) {
|
||||
#ifndef DEFAULT_DTOR
|
||||
# define DEFAULT_DTOR {}
|
||||
#endif
|
||||
#ifndef DEFAULT_ASSIGN
|
||||
# define DEFAULT_ASSIGN {return *this;}
|
||||
#endif
|
||||
#ifndef DELETED
|
||||
# define DELETED {assert(false);}
|
||||
# define DELETED_ASSIGN {assert(false);return *this;}
|
||||
#else
|
||||
# define DELETED_ASSIGN DELETED
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -27,7 +27,7 @@ public:
|
||||
|
||||
private:
|
||||
MutexDummyImpl(const MutexDummyImpl ©) DELETED;
|
||||
MutexDummyImpl &operator = (const MutexDummyImpl ©) DELETED;
|
||||
MutexDummyImpl &operator = (const MutexDummyImpl ©) DELETED_ASSIGN;
|
||||
|
||||
public:
|
||||
ALWAYS_INLINE void acquire();
|
||||
|
@ -33,7 +33,7 @@ public:
|
||||
|
||||
private:
|
||||
MutexPosixImpl(const MutexPosixImpl ©) DELETED;
|
||||
MutexPosixImpl &operator = (const MutexPosixImpl ©) DELETED;
|
||||
MutexPosixImpl &operator = (const MutexPosixImpl ©) DELETED_ASSIGN;
|
||||
|
||||
public:
|
||||
INLINE void acquire();
|
||||
|
@ -33,7 +33,7 @@ public:
|
||||
|
||||
private:
|
||||
MutexSpinlockImpl(const MutexSpinlockImpl ©) DELETED;
|
||||
MutexSpinlockImpl &operator = (const MutexSpinlockImpl ©) DELETED;
|
||||
MutexSpinlockImpl &operator = (const MutexSpinlockImpl ©) DELETED_ASSIGN;
|
||||
|
||||
public:
|
||||
INLINE void acquire();
|
||||
|
@ -33,7 +33,7 @@ public:
|
||||
|
||||
private:
|
||||
MutexWin32Impl(const MutexWin32Impl ©) DELETED;
|
||||
MutexWin32Impl &operator = (const MutexWin32Impl ©) DELETED;
|
||||
MutexWin32Impl &operator = (const MutexWin32Impl ©) DELETED_ASSIGN;
|
||||
|
||||
public:
|
||||
INLINE void acquire();
|
||||
|
@ -89,7 +89,7 @@ class EXPCL_DTOOL TypedObject : public MemoryBase {
|
||||
public:
|
||||
INLINE TypedObject() DEFAULT_CTOR;
|
||||
INLINE TypedObject(const TypedObject ©) DEFAULT_CTOR;
|
||||
INLINE TypedObject &operator = (const TypedObject ©) DEFAULT_CTOR;
|
||||
INLINE TypedObject &operator = (const TypedObject ©) DEFAULT_ASSIGN;
|
||||
|
||||
PUBLISHED:
|
||||
// A virtual destructor is just a good idea.
|
||||
|
@ -161,7 +161,7 @@ write_public_keys(Filename outfile) {
|
||||
}
|
||||
|
||||
output_c_string(out, "prc_pubkey", i, mbio);
|
||||
BIO_reset(mbio);
|
||||
(void)BIO_reset(mbio);
|
||||
out << "\n";
|
||||
}
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ class PointerTo : public PointerToBase<T> {
|
||||
public:
|
||||
typedef TYPENAME PointerToBase<T>::To To;
|
||||
PUBLISHED:
|
||||
ALWAYS_INLINE CONSTEXPR PointerTo() NOEXCEPT DEFAULT_CTOR;
|
||||
CONSTEXPR PointerTo() NOEXCEPT DEFAULT_CTOR;
|
||||
ALWAYS_INLINE PointerTo(To *ptr) NOEXCEPT;
|
||||
INLINE PointerTo(const PointerTo<T> ©);
|
||||
|
||||
@ -133,7 +133,7 @@ class ConstPointerTo : public PointerToBase<T> {
|
||||
public:
|
||||
typedef TYPENAME PointerToBase<T>::To To;
|
||||
PUBLISHED:
|
||||
ALWAYS_INLINE CONSTEXPR ConstPointerTo() NOEXCEPT DEFAULT_CTOR;
|
||||
CONSTEXPR ConstPointerTo() NOEXCEPT DEFAULT_CTOR;
|
||||
ALWAYS_INLINE ConstPointerTo(const To *ptr) NOEXCEPT;
|
||||
INLINE ConstPointerTo(const PointerTo<T> ©);
|
||||
INLINE ConstPointerTo(const ConstPointerTo<T> ©);
|
||||
|
@ -31,7 +31,7 @@ public:
|
||||
typedef T To;
|
||||
|
||||
protected:
|
||||
ALWAYS_INLINE CONSTEXPR PointerToBase() NOEXCEPT DEFAULT_CTOR;
|
||||
CONSTEXPR PointerToBase() NOEXCEPT DEFAULT_CTOR;
|
||||
INLINE PointerToBase(To *ptr);
|
||||
INLINE PointerToBase(const PointerToBase<T> ©);
|
||||
INLINE ~PointerToBase();
|
||||
|
@ -14,7 +14,7 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
INLINE CONSTEXPR PointerToVoid::
|
||||
CONSTEXPR PointerToVoid::
|
||||
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
|
||||
* comparison to a NULL pointer also works.)
|
||||
*/
|
||||
ALWAYS_INLINE CONSTEXPR bool PointerToVoid::
|
||||
CONSTEXPR bool PointerToVoid::
|
||||
is_null() const {
|
||||
return _void_ptr == nullptr;
|
||||
}
|
||||
|
@ -32,14 +32,14 @@
|
||||
*/
|
||||
class EXPCL_PANDAEXPRESS PointerToVoid : public MemoryBase {
|
||||
protected:
|
||||
ALWAYS_INLINE CONSTEXPR PointerToVoid() NOEXCEPT;
|
||||
CONSTEXPR PointerToVoid() NOEXCEPT;
|
||||
//INLINE ~PointerToVoid();
|
||||
|
||||
private:
|
||||
PointerToVoid(const PointerToVoid ©) DELETED;
|
||||
|
||||
PUBLISHED:
|
||||
ALWAYS_INLINE CONSTEXPR bool is_null() const;
|
||||
CONSTEXPR bool is_null() const;
|
||||
INLINE size_t get_hash() const;
|
||||
|
||||
public:
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
|
||||
private:
|
||||
// The assignment operator cannot be used for this class.
|
||||
INLINE void operator = (const WritableParam &other) DELETED;
|
||||
WritableParam &operator = (const WritableParam &other) DELETED_ASSIGN;
|
||||
|
||||
public:
|
||||
virtual TypeHandle get_type() const {
|
||||
|
Loading…
x
Reference in New Issue
Block a user