mirror of
https://github.com/asmjit/asmjit.git
synced 2025-12-18 04:54:36 +03:00
[Bug] Fixed compile-time issue with ASMJIT_NONCOPYABLE/NONCONSTRUCTIBLE for GCC 11 in C++20 mode (#343)
* fixed GCC 11 compilation in C++20 mode (don't use template parameters in constructors/operator assignment) * refactored ASMJIT_NONCOPYABLE/NONCONSTRUCTIBLE (variadic macros not needed)
This commit is contained in:
@@ -514,18 +514,14 @@ namespace asmjit {
|
|||||||
// [asmjit::Build - Globals - Utilities]
|
// [asmjit::Build - Globals - Utilities]
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
#define ASMJIT_NONCOPYABLE(...) \
|
#define ASMJIT_NONCOPYABLE(Type) \
|
||||||
private: \
|
Type(const Type& other) = delete; \
|
||||||
__VA_ARGS__(const __VA_ARGS__& other) = delete; \
|
Type& operator=(const Type& other) = delete;
|
||||||
__VA_ARGS__& operator=(const __VA_ARGS__& other) = delete; \
|
|
||||||
public:
|
|
||||||
|
|
||||||
#define ASMJIT_NONCONSTRUCTIBLE(...) \
|
#define ASMJIT_NONCONSTRUCTIBLE(Type) \
|
||||||
private: \
|
Type() = delete; \
|
||||||
__VA_ARGS__() = delete; \
|
Type(const Type& other) = delete; \
|
||||||
__VA_ARGS__(const __VA_ARGS__& other) = delete; \
|
Type& operator=(const Type& other) = delete;
|
||||||
__VA_ARGS__& operator=(const __VA_ARGS__& other) = delete; \
|
|
||||||
public:
|
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// [asmjit::Build - Globals - Cleanup]
|
// [asmjit::Build - Globals - Cleanup]
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ ASMJIT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
class GlobalConstPoolPass : public Pass {
|
class GlobalConstPoolPass : public Pass {
|
||||||
typedef Pass Base;
|
typedef Pass Base;
|
||||||
|
public:
|
||||||
ASMJIT_NONCOPYABLE(GlobalConstPoolPass)
|
ASMJIT_NONCOPYABLE(GlobalConstPoolPass)
|
||||||
|
|
||||||
GlobalConstPoolPass() noexcept : Pass("GlobalConstPoolPass") {}
|
GlobalConstPoolPass() noexcept : Pass("GlobalConstPoolPass") {}
|
||||||
|
|||||||
@@ -40,9 +40,9 @@ ASMJIT_BEGIN_NAMESPACE
|
|||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
class RAAssignment {
|
class RAAssignment {
|
||||||
|
public:
|
||||||
ASMJIT_NONCOPYABLE(RAAssignment)
|
ASMJIT_NONCOPYABLE(RAAssignment)
|
||||||
|
|
||||||
public:
|
|
||||||
enum Ids : uint32_t {
|
enum Ids : uint32_t {
|
||||||
kPhysNone = 0xFF,
|
kPhysNone = 0xFF,
|
||||||
kWorkNone = RAWorkReg::kIdNone
|
kWorkNone = RAWorkReg::kIdNone
|
||||||
|
|||||||
@@ -496,7 +496,7 @@ public:
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
class RALiveSpans {
|
class RALiveSpans {
|
||||||
public:
|
public:
|
||||||
ASMJIT_NONCOPYABLE(RALiveSpans<T>)
|
ASMJIT_NONCOPYABLE(RALiveSpans)
|
||||||
|
|
||||||
typedef typename T::DataType DataType;
|
typedef typename T::DataType DataType;
|
||||||
ZoneVector<T> _data;
|
ZoneVector<T> _data;
|
||||||
|
|||||||
@@ -371,7 +371,7 @@ public:
|
|||||||
template<size_t N>
|
template<size_t N>
|
||||||
class StringTmp : public String {
|
class StringTmp : public String {
|
||||||
public:
|
public:
|
||||||
ASMJIT_NONCOPYABLE(StringTmp<N>)
|
ASMJIT_NONCOPYABLE(StringTmp)
|
||||||
|
|
||||||
//! Embedded data.
|
//! Embedded data.
|
||||||
char _embeddedData[Support::alignUp(N + 1, sizeof(size_t))];
|
char _embeddedData[Support::alignUp(N + 1, sizeof(size_t))];
|
||||||
|
|||||||
@@ -391,7 +391,7 @@ public:
|
|||||||
template<size_t N>
|
template<size_t N>
|
||||||
class ZoneTmp : public Zone {
|
class ZoneTmp : public Zone {
|
||||||
public:
|
public:
|
||||||
ASMJIT_NONCOPYABLE(ZoneTmp<N>)
|
ASMJIT_NONCOPYABLE(ZoneTmp)
|
||||||
|
|
||||||
//! Temporary storage, embedded after \ref Zone.
|
//! Temporary storage, embedded after \ref Zone.
|
||||||
struct Storage {
|
struct Storage {
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ public:
|
|||||||
template<typename NodeT>
|
template<typename NodeT>
|
||||||
class ZoneHash : public ZoneHashBase {
|
class ZoneHash : public ZoneHashBase {
|
||||||
public:
|
public:
|
||||||
ASMJIT_NONCOPYABLE(ZoneHash<NodeT>)
|
ASMJIT_NONCOPYABLE(ZoneHash)
|
||||||
|
|
||||||
typedef NodeT Node;
|
typedef NodeT Node;
|
||||||
|
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ public:
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
class ZoneStack : public ZoneStackBase {
|
class ZoneStack : public ZoneStackBase {
|
||||||
public:
|
public:
|
||||||
ASMJIT_NONCOPYABLE(ZoneStack<T>)
|
ASMJIT_NONCOPYABLE(ZoneStack)
|
||||||
|
|
||||||
enum : uint32_t {
|
enum : uint32_t {
|
||||||
kNumBlockItems = uint32_t((kBlockSize - sizeof(Block)) / sizeof(T)),
|
kNumBlockItems = uint32_t((kBlockSize - sizeof(Block)) / sizeof(T)),
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ public:
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
class ZoneVector : public ZoneVectorBase {
|
class ZoneVector : public ZoneVectorBase {
|
||||||
public:
|
public:
|
||||||
ASMJIT_NONCOPYABLE(ZoneVector<T>)
|
ASMJIT_NONCOPYABLE(ZoneVector)
|
||||||
|
|
||||||
// STL compatibility;
|
// STL compatibility;
|
||||||
typedef T value_type;
|
typedef T value_type;
|
||||||
|
|||||||
Reference in New Issue
Block a user