提交 7d1c5d82 编写于 作者: N nvelinov 提交者: Behdad Esfahbod

Compilation Error for ASSERT_STATIC on Some Compilers (#380)

* this pointer in type definitions is not interpreted as a constant.
This rule is not enforced strictly by all compilers, but the Green Hills Software compiler will regard this as an error.

* Merging branches for the DEFINE_SIZE_UNION macro
Adding check for the existence of static_size field in the tested member.
上级 e2b87805
......@@ -105,7 +105,7 @@ static inline Type& StructAfter(TObject &X)
inline unsigned int get_size (void) const { return (size); }
#define DEFINE_SIZE_UNION(size, _member) \
DEFINE_INSTANCE_ASSERTION (this->u._member.static_size == (size)); \
DEFINE_INSTANCE_ASSERTION (0*sizeof(this->u._member.static_size) + sizeof(this->u._member) == (size)); \
static const unsigned int min_size = (size)
#define DEFINE_SIZE_MIN(size) \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册