From 7fa9c03083e90cdb8476ff3dc8154572d71aa852 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 9 Mar 2009 05:53:40 -0400 Subject: bump common macros up to localdecls.h so tests can use them Signed-off-by: Mike Frysinger --- localdecls.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'localdecls.h') diff --git a/localdecls.h b/localdecls.h index 2567ccd..595a5ac 100644 --- a/localdecls.h +++ b/localdecls.h @@ -63,6 +63,19 @@ typedef __sighandler_t sighandler_t; # endif #endif +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof(arr[0])) +#endif +#ifndef MAX +#define MAX(x, y) ((x) < (y) ? (y) : (x)) +#endif +#ifndef MIN +#define MIN(x, y) ((x) < (y) ? (x) : (y)) +#endif +#ifndef offsetof +#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) +#endif + /* If the system is old and does not support *at funcs, then define * it ourself. Shouldn't matter based on how we use it. */ -- cgit v1.2.3-65-gdbad