summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2019-09-28 11:46:19 +0200
committerAnton Khirnov <anton@khirnov.net>2019-09-28 11:46:19 +0200
commit3bb94aa06bdaee136fdc3a6a206e5f391a8b5361 (patch)
tree6a9afe93071f38e709ee7084e58847b4615984a8
parentdcae690175ce7f552a7cfc12dd96b85bf2bb08eb (diff)
Print the line number in qms_assert.
-rw-r--r--src/qms.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/qms.c b/src/qms.c
index a82cc01..a1366bd 100644
--- a/src/qms.c
+++ b/src/qms.c
@@ -28,12 +28,13 @@
#define CPINDEX(cp, i, j, k) ((k * cp->grid_size[1] + j) * cp->grid_size[0] + i)
-#define qms_assert(x) \
-do { \
- if (!(x)) { \
- fprintf(stderr, "Assertion " #x " failed\n"); \
- abort(); \
- } \
+#define qms_assert(x) \
+do { \
+ if (!(x)) { \
+ fprintf(stderr, "%s:%d assertion " #x " failed\n", \
+ __FILE__, __LINE__); \
+ abort(); \
+ } \
} while (0)
/* precomputed values for a given refined grid */