Create M_ASSERT macro to encapsulate assert within M*LIB
The goal is to enable the user to override this macro if needed so that it can enable or disable the M*LIB witout impacting its own assertions.
This commit is contained in:
1 parent
f5afd6e275
commit
a29682ca29
26 files changed
+901
-888
No files matched your search
+3
-3
@@ -140,7 +140,7 @@ M_BEGIN_PROTECTED_CODE
|
||||
static inline void M_ATTR_DEPRECATED \
|
||||
M_C(name, _init_set2)(shared_t *ptr, shared_t shared) \
|
||||
{ \
|
||||
assert (ptr != NULL); \
|
||||
M_ASSERT (ptr != NULL); \
|
||||
*ptr = M_C(name, _init_set)(shared); \
|
||||
} \
|
||||
\
|
||||
@@ -176,7 +176,7 @@ M_BEGIN_PROTECTED_CODE
|
||||
static inline void \
|
||||
M_C(name, _clear_ptr)(shared_t *shared) \
|
||||
{ \
|
||||
assert(shared != NULL); \
|
||||
M_ASSERT(shared != NULL); \
|
||||
M_C(name, _clear)(*shared); \
|
||||
*shared = NULL; \
|
||||
} \
|
||||
@@ -191,7 +191,7 @@ M_BEGIN_PROTECTED_CODE
|
||||
static inline void \
|
||||
M_C(name, _set)(shared_t *ptr, shared_t shared) \
|
||||
{ \
|
||||
assert (ptr != NULL); \
|
||||
M_ASSERT (ptr != NULL); \
|
||||
if (M_LIKELY (*ptr != shared)) { \
|
||||
M_C(name, _clear)(*ptr); \
|
||||
*ptr = M_C(name, _init_set)(shared); \
|
||||
|
||||
Reference in new issue
Block a user