2019-04-11 23:08:59 +02:00
|
|
|
#pragma once
|
|
|
|
#include "stack.h"
|
2019-05-17 09:35:23 +02:00
|
|
|
#include "klibc.h"
|
2019-04-11 23:08:59 +02:00
|
|
|
|
|
|
|
#define assert(p) do { \
|
|
|
|
if (!(p)) { \
|
|
|
|
printf("BUG at %s:%d assert(%s)\n", \
|
|
|
|
__FILE__, __LINE__, #p); \
|
|
|
|
printStackTrace(5); \
|
|
|
|
while(1){} \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define assertmsg(p, ...) do { \
|
|
|
|
if (!(p)) { \
|
|
|
|
printf("BUG at %s:%d assert(%s)\n", \
|
|
|
|
__FILE__, __LINE__, #p); \
|
|
|
|
printf(__VA_ARGS__); \
|
|
|
|
printStackTrace(5); \
|
|
|
|
while(1){} \
|
|
|
|
} \
|
|
|
|
} while (0)
|