diff options
Diffstat (limited to 'source/blender/bmesh/bmesh_class.h')
-rw-r--r-- | source/blender/bmesh/bmesh_class.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/bmesh/bmesh_class.h b/source/blender/bmesh/bmesh_class.h index 16e8285902a..4ffa0bda71a 100644 --- a/source/blender/bmesh/bmesh_class.h +++ b/source/blender/bmesh/bmesh_class.h @@ -276,8 +276,16 @@ enum { #define BM_CHECK_TYPE_ELEM(ele) \ CHECK_TYPE_ANY(ele, _BM_GENERIC_TYPE_ELEM_NONCONST, _BM_GENERIC_TYPE_ELEM_CONST) +/* Assignment from a void* to a typed pointer is not allowed in C++, + * casting the LHS to void works fine though. + */ +#ifdef __cplusplus +#define BM_CHECK_TYPE_ELEM_ASSIGN(ele) \ + (BM_CHECK_TYPE_ELEM(ele)), *((void **)&ele) +#else #define BM_CHECK_TYPE_ELEM_ASSIGN(ele) \ (BM_CHECK_TYPE_ELEM(ele)), ele +#endif /* BMHeader->hflag (char) */ enum { |