Fri, 18 Nov 2016 03:01:38 +0200
Made DEFINE_FLAG_ACCESS_METHODS a function macro
src/ldDocument.h | file | annotate | diff | comparison | revisions | |
src/macros.h | file | annotate | diff | comparison | revisions |
--- a/src/ldDocument.h Fri Nov 18 02:56:53 2016 +0200 +++ b/src/ldDocument.h Fri Nov 18 03:01:38 2016 +0200 @@ -128,7 +128,7 @@ LDGLData* m_gldata; DocumentManager* m_manager; - DEFINE_FLAG_ACCESS_METHODS + DEFINE_FLAG_ACCESS_METHODS(m_flags) void addKnownVertices (LDObject* obj); void mergeVertices(); };
--- a/src/macros.h Fri Nov 18 02:56:53 2016 +0200 +++ b/src/macros.h Fri Nov 18 03:01:38 2016 +0200 @@ -59,7 +59,7 @@ #define ConfigOption(...) -#define DEFINE_FLAG_ACCESS_METHODS \ - bool checkFlag(Flag flag) const { return !!(m_flags & flag); } \ - void setFlag(Flag flag) { m_flags |= flag; } \ - void unsetFlag(Flag flag) { m_flags &= ~flag; } +#define DEFINE_FLAG_ACCESS_METHODS(FLAGS) \ + bool checkFlag(decltype(FLAGS) flag) const { return !!(FLAGS & flag); } \ + void setFlag(decltype(FLAGS) flag) { FLAGS |= flag; } \ + void unsetFlag(decltype(FLAGS) flag) { FLAGS &= ~flag; }