Add macro M_CTYPE_FROM_FIELD like M_TYPE_FROM_FIELD
but for const pointer.
This commit is contained in:
1 parent
3d5914f389
commit
29d181c113
1 file changed
+2
@@ -1202,6 +1202,8 @@
|
||||
#define M_TYPE_FROM_FIELD(type, ptr, field_type, field) \
|
||||
((type *)(void*)( (char *)M_ASSIGN_CAST(field_type*, (ptr)) - offsetof(type, field) ))
|
||||
|
||||
#define M_CTYPE_FROM_FIELD(type, ptr, field_type, field) \
|
||||
((const type *)(const void*)( (const char *)M_ASSIGN_CAST(const field_type*, (ptr)) - offsetof(const type, field) ))
|
||||
|
||||
|
||||
/************************************************************/
|
||||
|
||||
Reference in new issue
Block a user