From f28c0aae0d8fe6ccd48f3bca711360cb650c4d11 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 29 Jul 2020 14:20:12 +0200 Subject: Added assertions --- src/lib/inc/assert.h | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/lib/inc/assert.h (limited to 'src/lib/inc/assert.h') diff --git a/src/lib/inc/assert.h b/src/lib/inc/assert.h new file mode 100644 index 0000000..2cb095b --- /dev/null +++ b/src/lib/inc/assert.h @@ -0,0 +1,11 @@ +// MIT License, Copyright (c) 2020 Marvin Borner + +#ifndef ASSERT_H +#define ASSERT_H + +#include + +#define assert(exp) \ + (exp) ? 0 : printf("%s:%d: %s: Assertion '%s' failed\n", __FILE__, __LINE__, __func__, #exp) + +#endif -- cgit v1.2.3