mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-02 07:28:21 +00:00
logging: make failed asserts panic
This commit is contained in:
@@ -2,16 +2,15 @@
|
|||||||
#define _LOGGING_H
|
#define _LOGGING_H
|
||||||
|
|
||||||
#include <printf.h>
|
#include <printf.h>
|
||||||
|
#include <panic.h>
|
||||||
|
|
||||||
void _putchar(char c);
|
void _putchar(char c);
|
||||||
void logging_sethook(void (*fun)(char));
|
void logging_sethook(void (*fun)(char));
|
||||||
|
|
||||||
// TODO panic
|
|
||||||
|
|
||||||
#define __assert(x) \
|
#define __assert(x) \
|
||||||
if (!(x)){ \
|
if (!(x)){ \
|
||||||
printf("\e[91m%s:%s:%d: %s failed\n\e[0m", __FILE__, __func__, __LINE__, #x); \
|
printf("\e[91m%s:%s:%d: %s failed\n\e[0m", __FILE__, __func__, __LINE__, #x); \
|
||||||
for(;;); \
|
_panic(NULL, NULL); \
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user