Redo r242889, now using the method from projects/amd64_xen_pv r240747.
Reminded by: kib MFC after: 3 days
This commit is contained in:
parent
45f8cc9a6c
commit
66400b6a10
@ -58,11 +58,11 @@ __FBSDID("$FreeBSD$");
|
|||||||
#define TOSTRING(x) STRINGIFY(x)
|
#define TOSTRING(x) STRINGIFY(x)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes an error message to buffer if cond is false, and returns true
|
* Writes an error message to buffer if cond is false
|
||||||
* iff the assertion failed. Note the implied parameters buffer and
|
* Note the implied parameters buffer and
|
||||||
* buflen
|
* buflen
|
||||||
*/
|
*/
|
||||||
#define XNB_ASSERT(cond) do { \
|
#define XNB_ASSERT(cond) ({ \
|
||||||
int passed = (cond); \
|
int passed = (cond); \
|
||||||
char *_buffer = (buffer); \
|
char *_buffer = (buffer); \
|
||||||
size_t _buflen = (buflen); \
|
size_t _buflen = (buflen); \
|
||||||
@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
strlcat(_buffer, ":" TOSTRING(__LINE__) \
|
strlcat(_buffer, ":" TOSTRING(__LINE__) \
|
||||||
" Assertion Error: " #cond "\n", _buflen); \
|
" Assertion Error: " #cond "\n", _buflen); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
})
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user