aboutsummaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2019-02-03 04:54:10 -0500
committerPaul Duncan <pabs@pablotron.org>2019-02-03 04:54:10 -0500
commit1e3dc2401263a436a32377e207352ffbe6984e8f (patch)
treefc34de6b8d7a456d861d7534360073ad10d8c620 /util.h
parenta3792d8769d2dc8ee0abae758c6fae3a35b5dfbc (diff)
downloadkmeans-1e3dc2401263a436a32377e207352ffbe6984e8f.tar.bz2
kmeans-1e3dc2401263a436a32377e207352ffbe6984e8f.zip
add outstanding changes
Diffstat (limited to 'util.h')
-rw-r--r--util.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/util.h b/util.h
new file mode 100644
index 0000000..d13dfae
--- /dev/null
+++ b/util.h
@@ -0,0 +1,17 @@
+#ifndef UTIL_H
+#define UTIL_H
+
+#include <stdio.h> // fprintf()
+#include <stdlib.h> // exit()
+
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+#define UNUSED(a) ((void) (a))
+
+#define die(...) do { \
+ fputs("FATAL: ", stderr); \
+ fprintf(stderr, __VA_ARGS__); \
+ fputs("\n", stderr); \
+ exit(EXIT_FAILURE); \
+} while (0)
+
+#endif /* UTIL_H */