summaryrefslogtreecommitdiff
path: root/LibC
diff options
context:
space:
mode:
Diffstat (limited to 'LibC')
-rw-r--r--LibC/assert.cpp3
-rw-r--r--LibC/assert.h2
-rw-r--r--LibC/sys/cdefs.h1
3 files changed, 3 insertions, 3 deletions
diff --git a/LibC/assert.cpp b/LibC/assert.cpp
index a8c499e1d0..7397c20a69 100644
--- a/LibC/assert.cpp
+++ b/LibC/assert.cpp
@@ -4,11 +4,10 @@
extern "C" {
-extern void __assertion_failed(const char* msg, const char* file, unsigned line, const char* func)
+void __assertion_failed(const char* msg, const char* file, unsigned line, const char* func)
{
fprintf(stderr, "ASSERTION FAILED: %s\n%s:%u in %s\n", msg, file, line, func);
abort();
}
}
-
diff --git a/LibC/assert.h b/LibC/assert.h
index e0a297a12a..546dcc90a7 100644
--- a/LibC/assert.h
+++ b/LibC/assert.h
@@ -4,7 +4,7 @@
__BEGIN_DECLS
-void __assertion_failed(const char* msg, const char* file, unsigned line, const char* func);
+void __assertion_failed(const char* msg, const char* file, unsigned line, const char* func) __NORETURN;
#define assert(expr) ((expr) ? (void)0 : __assertion_failed(#expr, __FILE__, __LINE__, __PRETTY_FUNCTION__))
#define CRASH() do { asm volatile("ud2"); } while(0)
diff --git a/LibC/sys/cdefs.h b/LibC/sys/cdefs.h
index 743ff03951..4bfbabedf1 100644
--- a/LibC/sys/cdefs.h
+++ b/LibC/sys/cdefs.h
@@ -1,6 +1,7 @@
#pragma once
#define ALWAYS_INLINE inline __attribute__ ((always_inline))
+#define __NORETURN __attribute__ ((noreturn))
#ifdef __cplusplus
#define __BEGIN_DECLS extern "C" {