aboutsummaryrefslogtreecommitdiffstats
path: root/util.h
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2025-05-02 14:32:56 -0400
committerSam Anthony <sam@samanthony.xyz>2025-05-02 14:32:56 -0400
commit0307f0efa3aaabc887212c9535fd22560902cebd (patch)
treeaff0444747807a0ec09ea183bfba11c2ef2225ec /util.h
parentcb1183751aa25069560923948a0a6de300e6ac9c (diff)
downloadvolute-0307f0efa3aaabc887212c9535fd22560902cebd.zip
draw points on compressor map
Diffstat (limited to 'util.h')
-rw-r--r--util.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/util.h b/util.h
index 501d11e..052a106 100644
--- a/util.h
+++ b/util.h
@@ -2,5 +2,14 @@
#define min(a, b) ((a < b) ? a : b)
#define max(a, b) ((a > b) ? a : b)
+#define expect(x) do { \
+ if (!(x)) { \
+ fprintf(stderr, "Fatal error: %s:%d: assertion '%s' failed\n", \
+ __FILE__, __LINE__, #x); \
+ abort(); \
+ } \
+ } while (0)
+
+
void free_arr(void **arr, int n);
int lsearch(const void *key, const void *base, size_t n, size_t size, int (*cmp)(const void *keyval, const void *datum));