Skip to content

Commit

Permalink
define some macros using other macros
Browse files Browse the repository at this point in the history
We can differentiate between the "pure" access macros and the "wrapper" ones.
  • Loading branch information
robUx4 committed Feb 24, 2024
1 parent 3defb8f commit 60c52b0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ebml/EbmlElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class DllApi x : public BaseClass { \
#define EBML_INFO(ref) ref::ClassInfo()
#define EBML_ID(ref) ref::ClassId()
#define EBML_CLASS_SEMCONTEXT(ref) Context_##ref
#define EBML_CLASS_CONTEXT(ref) ref::ClassInfo().GetContext()
#define EBML_CLASS_CONTEXT(ref) EBML_INFO_CONTEXT(EBML_INFO(ref))
#define EBML_CONTEXT(e) (e)->Context()
#define EBML_NAME(e) (e)->DebugName()

Expand All @@ -253,15 +253,15 @@ class DllApi x : public BaseClass { \
#define EBML_INFO_CONTEXT(cb) (cb).GetContext()

#define EBML_SEM_SPECS(s) (s).GetCallbacks()
#define EBML_SEM_CONTEXT(s) ((const libebml::EbmlCallbacks &)(s)).GetContext()
#define EBML_SEM_CONTEXT(s) EBML_INFO_CONTEXT(EBML_SEM_SPECS(s))
#define EBML_SEM_CREATE(s) (s).Create()

#define EBML_CTX_SIZE(c) (c).GetSize()
#define EBML_CTX_MASTER(c) (c).GetMaster()
#define EBML_CTX_PARENT(c) (c).Parent()
#define EBML_CTX_IDX(c,i) (c).GetSemantic(i)
#define EBML_CTX_IDX_INFO(c,i) (const libebml::EbmlCallbacks &)((c).GetSemantic(i))
#define EBML_CTX_IDX_ID(c,i) ((const libebml::EbmlCallbacks &)((c).GetSemantic(i))).ClassId()
#define EBML_CTX_IDX_INFO(c,i) EBML_SEM_SPECS(EBML_CTX_IDX(c,i))
#define EBML_CTX_IDX_ID(c,i) EBML_INFO_ID(EBML_CTX_IDX_INFO(c,i))

#if !defined(INVALID_FILEPOS_T)
#define INVALID_FILEPOS_T 0
Expand Down

0 comments on commit 60c52b0

Please sign in to comment.