From: Timo Kokkonen Date: Tue, 29 Oct 2013 20:15:15 +0000 (+0200) Subject: Move random utility macros into utils.h X-Git-Url: http://git.itanic.dy.fi/?p=log-plotter;a=commitdiff_plain;h=4daad2abbacb183bc39d7ef1220e86afe6068b5d Move random utility macros into utils.h Avoid defining useful utility macros in C files. Signed-off-by: Timo Kokkonen --- diff --git a/data.c b/data.c index 890e6bd..fa37072 100644 --- a/data.c +++ b/data.c @@ -11,8 +11,8 @@ #include "data.h" #include "trace.h" +#include "utils.h" -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) static int separate_entries(char *buf, char *entries[], int max_entries) { diff --git a/utils.h b/utils.h new file mode 100644 index 0000000..8b5152e --- /dev/null +++ b/utils.h @@ -0,0 +1,6 @@ +#ifndef _UTILS_H +#define _UTILS_H + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +#endif