mirror of
https://github.com/ziglang/zig.git
synced 2025-02-11 07:00:16 +00:00
Add context to zig_unreachable calls (#1039)
This greatly aids debugging on platforms with no stack-traces.
This commit is contained in:
parent
b85b68a7fd
commit
4c273126df
10
src/util.hpp
10
src/util.hpp
@ -38,11 +38,11 @@ ATTRIBUTE_NORETURN
|
||||
ATTRIBUTE_PRINTF(1, 2)
|
||||
void zig_panic(const char *format, ...);
|
||||
|
||||
ATTRIBUTE_COLD
|
||||
ATTRIBUTE_NORETURN
|
||||
static inline void zig_unreachable(void) {
|
||||
zig_panic("unreachable");
|
||||
}
|
||||
#ifdef WIN32
|
||||
#define __func__ __FUNCTION__
|
||||
#endif
|
||||
|
||||
#define zig_unreachable() zig_panic("unreachable: %s:%s:%d", __FILE__, __func__, __LINE__)
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
static inline int clzll(unsigned long long mask) {
|
||||
|
Loading…
Reference in New Issue
Block a user