mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -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 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
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
MutexDummyImpl(const MutexDummyImpl ©) DELETED;
|
MutexDummyImpl(const MutexDummyImpl ©) DELETED;
|
||||||
MutexDummyImpl &operator = (const MutexDummyImpl ©) DELETED;
|
MutexDummyImpl &operator = (const MutexDummyImpl ©) DELETED_ASSIGN;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ALWAYS_INLINE void acquire();
|
ALWAYS_INLINE void acquire();
|
||||||
|
@ -33,7 +33,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
MutexPosixImpl(const MutexPosixImpl ©) DELETED;
|
MutexPosixImpl(const MutexPosixImpl ©) DELETED;
|
||||||
MutexPosixImpl &operator = (const MutexPosixImpl ©) DELETED;
|
MutexPosixImpl &operator = (const MutexPosixImpl ©) DELETED_ASSIGN;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
INLINE void acquire();
|
INLINE void acquire();
|
||||||
|
@ -33,7 +33,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
MutexSpinlockImpl(const MutexSpinlockImpl ©) DELETED;
|
MutexSpinlockImpl(const MutexSpinlockImpl ©) DELETED;
|
||||||
MutexSpinlockImpl &operator = (const MutexSpinlockImpl ©) DELETED;
|
MutexSpinlockImpl &operator = (const MutexSpinlockImpl ©) DELETED_ASSIGN;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
INLINE void acquire();
|
INLINE void acquire();
|
||||||
|
@ -33,7 +33,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
MutexWin32Impl(const MutexWin32Impl ©) DELETED;
|
MutexWin32Impl(const MutexWin32Impl ©) DELETED;
|
||||||
MutexWin32Impl &operator = (const MutexWin32Impl ©) DELETED;
|
MutexWin32Impl &operator = (const MutexWin32Impl ©) DELETED_ASSIGN;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
INLINE void acquire();
|
INLINE void acquire();
|
||||||
|
@ -89,7 +89,7 @@ class EXPCL_DTOOL TypedObject : public MemoryBase {
|
|||||||
public:
|
public:
|
||||||
INLINE TypedObject() DEFAULT_CTOR;
|
INLINE TypedObject() DEFAULT_CTOR;
|
||||||
INLINE TypedObject(const TypedObject ©) DEFAULT_CTOR;
|
INLINE TypedObject(const TypedObject ©) DEFAULT_CTOR;
|
||||||
INLINE TypedObject &operator = (const TypedObject ©) DEFAULT_CTOR;
|
INLINE TypedObject &operator = (const TypedObject ©) DEFAULT_ASSIGN;
|
||||||
|
|
||||||
PUBLISHED:
|
PUBLISHED:
|
||||||
// A virtual destructor is just a good idea.
|
// 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);
|
output_c_string(out, "prc_pubkey", i, mbio);
|
||||||
BIO_reset(mbio);
|
(void)BIO_reset(mbio);
|
||||||
out << "\n";
|
out << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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> ©);
|
INLINE PointerTo(const PointerTo<T> ©);
|
||||||
|
|
||||||
@ -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> ©);
|
INLINE ConstPointerTo(const PointerTo<T> ©);
|
||||||
INLINE ConstPointerTo(const ConstPointerTo<T> ©);
|
INLINE ConstPointerTo(const ConstPointerTo<T> ©);
|
||||||
|
@ -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> ©);
|
INLINE PointerToBase(const PointerToBase<T> ©);
|
||||||
INLINE ~PointerToBase();
|
INLINE ~PointerToBase();
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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 ©) DELETED;
|
PointerToVoid(const PointerToVoid ©) 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:
|
||||||
|
@ -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 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user