diff options
author | Paul Duncan <pabs@pablotron.org> | 2019-02-03 04:54:10 -0500 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2019-02-03 04:54:10 -0500 |
commit | 1e3dc2401263a436a32377e207352ffbe6984e8f (patch) | |
tree | fc34de6b8d7a456d861d7534360073ad10d8c620 /util.h | |
parent | a3792d8769d2dc8ee0abae758c6fae3a35b5dfbc (diff) | |
download | kmeans-1e3dc2401263a436a32377e207352ffbe6984e8f.tar.bz2 kmeans-1e3dc2401263a436a32377e207352ffbe6984e8f.zip |
add outstanding changes
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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 */ |