mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 06:48:48 +00:00
Added assert
This commit is contained in:
parent
eeddb0b25a
commit
2b9adec087
6 changed files with 15 additions and 2 deletions
|
|
@ -151,6 +151,15 @@ static void failure (char *s, ...) {
|
|||
vfailure (s, args);
|
||||
}
|
||||
|
||||
void Lassert (void *f, char *s, ...) {
|
||||
if (!UNBOX(f)) {
|
||||
va_list args;
|
||||
|
||||
va_start (args, s);
|
||||
vfailure (s, args);
|
||||
}
|
||||
}
|
||||
|
||||
# define ASSERT_BOXED(memo, x) \
|
||||
do if (UNBOXED(x)) failure ("boxed value expected in %s\n", memo); while (0)
|
||||
# define ASSERT_UNBOXED(memo, x) \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue