1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:48:14 +00:00
serenity/LibC/assert.h
Andreas Kling 022f7790db Use modern C++ attributes instead of __attribute__ voodoo.
This is quite nice, although I wish [[gnu::always_inline]] implied inline.
Also "gnu::" is kind of a wart, but whatcha gonna do.
2019-02-15 12:30:48 +01:00

16 lines
431 B
C

#pragma once
#include <sys/cdefs.h>
__BEGIN_DECLS
[[noreturn]] void __assertion_failed(const char* msg, const char* file, unsigned line, const char* func);
#define assert(expr) ((expr) ? (void)0 : __assertion_failed(#expr, __FILE__, __LINE__, __PRETTY_FUNCTION__))
#define CRASH() do { asm volatile("ud2"); } while(0)
#define ASSERT assert
#define RELEASE_ASSERT assert
#define ASSERT_NOT_REACHED() assert(false)
__END_DECLS