Hello All
I am kind of beginner in C/C++ and I need to convert following code to python. Could you explain to me what this macro does
Thnks
Code:
/**
* Macros to check and validate a structure pointer, given that the
* first entry in the structure is a magic number. ((void)(1?0:((_ptr), void(), 0)))
*/
#ifdef NO_BOMBING_MACROS
#define BU_CKMAG(_ptr, _magic, _str) BU_IGNORE((_ptr))
#else
#define BU_CKMAG(_ptr, _magic, _str) { \
const uintptr_t _ptrval = (const uintptr_t) (_ptr);
if (UNLIKELY
((_ptrval == 0) || (_ptrval & (sizeof(_ptrval) - 1))
|| *((const uint32_t *) (_ptr)) != (uint32_t) (_magic)))
{
bu_badmagic((const uint32_t *) (_ptr), (uint32_t) _magic, _str, __FILE__,
__LINE__);
}
}
#endif