diff --git a/common.h b/common.h index 999a40e..00c3483 100644 --- a/common.h +++ b/common.h @@ -13,6 +13,12 @@ #define offsetof(type, member) ((size_t)&(((type*)0)->member)) +#define PANIC(fmt, ...) \ + do { \ + printf("panic %s:%d" fmt "\n", __FILE__, __LINE__, ## __VAR_ARGS__); \ + while(1){}; \ + } while(0) + typedef int bool; typedef unsigned char uint8_t; typedef unsigned short uint16_t ;