* Size checking
*/
-#define _DEFINE_SIZE_ASSERTION(_compare) \
+#define _DEFINE_SIZE_ASSERTION(_assertion) \
inline void _size_assertion (void) const \
- { ASSERT_STATIC ((sizeof (*this)) _compare); }
+ { ASSERT_STATIC (_assertion); }
#define DEFINE_SIZE_STATIC(size) \
- _DEFINE_SIZE_ASSERTION (== (size)); \
+ _DEFINE_SIZE_ASSERTION (sizeof (*this) == (size)); \
static const unsigned int static_size = (size); \
static const unsigned int min_size = (size)
#define VAR 1
#define VAR0 (VAR+0)
+#define DEFINE_SIZE_UNION(size, _member) \
+ _DEFINE_SIZE_ASSERTION (this->u._member.static_size == (size)); \
+ static const unsigned int min_size = (size)
+
#define DEFINE_SIZE_MIN(size) \
- _DEFINE_SIZE_ASSERTION (>= (size)); \
+ _DEFINE_SIZE_ASSERTION (sizeof (*this) >= (size)); \
static const unsigned int min_size = (size)
#define DEFINE_SIZE_VAR(size, _var_type) \
- _DEFINE_SIZE_ASSERTION (== (size) + VAR0 * sizeof (_var_type)); \
+ _DEFINE_SIZE_ASSERTION (sizeof (*this) == (size) + VAR0 * sizeof (_var_type)); \
static const unsigned int min_size = (size)
-#define DEFINE_SIZE_VAR2(size, _var_type1, _var_type2) \
- _DEFINE_SIZE_ASSERTION (== (size) + VAR0 * sizeof (_var_type1) + VAR0 * sizeof (_var_type2)); \
+#define DEFINE_SIZE_VAR2(size, array1, array2) \
+ _DEFINE_SIZE_ASSERTION (sizeof (*this) == (size) + this->array1[0].static_size + this->array2[0].static_size); \
static const unsigned int min_size = (size)
* structure. This field is only present if bit
* UseMarkFilteringSet of lookup flags is set. */
public:
- DEFINE_SIZE_VAR2 (6, Offset, USHORT);
+ DEFINE_SIZE_VAR2 (6, subTable, markFilteringSetX);
};
typedef OffsetListOf<Lookup> LookupList;
CoverageFormat2 format2[VAR];
} u;
public:
- DEFINE_SIZE_MIN (2);
+ DEFINE_SIZE_UNION (2, format);
};
ClassDefFormat2 format2[VAR];
} u;
public:
- DEFINE_SIZE_MIN (2);
+ DEFINE_SIZE_UNION (2, format);
};
LookupRecord lookupRecordX[VAR]; /* Array of LookupRecords--in
* design order */
public:
- DEFINE_SIZE_VAR2 (4, USHORT, LookupRecord);
+ DEFINE_SIZE_VAR2 (4, input, lookupRecordX);
};
struct RuleSet
LookupRecord lookupRecordX[VAR]; /* Array of LookupRecords--in
* design order */
public:
- DEFINE_SIZE_VAR2 (6, OffsetTo<Coverage>, LookupRecord);
+ DEFINE_SIZE_VAR2 (6, coverage, lookupRecordX);
};
struct Context