Luna/luna/Check.h

10 lines
330 B
C

#pragma once
#include <Attributes.h>
extern _noreturn bool __check_failed(const char* file, const char* line, const char* func, const char* expr);
#define STRINGIZE(x) #x
#define STRINGIZE_VALUE_OF(x) STRINGIZE(x)
#define check(expr) (expr) || __check_failed(__FILE__, STRINGIZE_VALUE_OF(__LINE__), __PRETTY_FUNCTION__, #expr)