[Zion] Move to StrFormat for debug line.
This commit is contained in:
parent
4af19d010f
commit
69aced2220
23 changed files with 142 additions and 89 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <glacier/string/str_format.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "include/ztypes.h"
|
||||
|
|
@ -8,10 +9,19 @@
|
|||
// before allocations are available.
|
||||
void early_dbgln(const char* str);
|
||||
|
||||
void dbg(const char* fmt, ...);
|
||||
void dbgln(const char* str, ...);
|
||||
void panic(const char* str, ...);
|
||||
void dbgln(const glcr::StringView& str);
|
||||
|
||||
template <typename... Args>
|
||||
void dbgln(const char* str, Args... args) {
|
||||
dbgln(glcr::StrFormat(str, args...));
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void panic(const char* str, Args... args) {
|
||||
dbgln(glcr::StrFormat(str, args...));
|
||||
dbgln("PANIC");
|
||||
}
|
||||
|
||||
#define UNREACHABLE \
|
||||
panic("Unreachable %s, %s", __FILE__, __LINE__); \
|
||||
panic("Unreachable {}, {}", __FILE__, __LINE__); \
|
||||
__builtin_unreachable();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue