Examples: Using IM_OFFSETOF macro. + Comments

This commit is contained in:
omar
2018-01-05 22:05:02 +01:00
parent 95b773370f
commit 407955d9fb
7 changed files with 20 additions and 31 deletions

View File

@ -39,7 +39,7 @@
#define IM_FMTLIST(FMT)
#endif
#define IM_ARRAYSIZE(_ARR) ((int)(sizeof(_ARR)/sizeof(*_ARR)))
#define IM_OFFSETOF(_TYPE,_ELM) ((size_t)&(((_TYPE*)0)->_ELM))
#define IM_OFFSETOF(_TYPE,_MEMBER) ((size_t)&(((_TYPE*)0)->_MEMBER)) // Offset of _MEMBER within _TYPE. Standardized as offsetof() in modern C++.
#if defined(__clang__)
#pragma clang diagnostic push