From 62366813b06f97ba4aafca52cd6d2a33cef97cc5 Mon Sep 17 00:00:00 2001 From: George Oikonomou Date: Wed, 20 Mar 2013 21:05:19 +0000 Subject: [PATCH] Provide a macro to read rimestats when enabled --- core/net/rime/rimestats.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/net/rime/rimestats.h b/core/net/rime/rimestats.h index d40c9b684..abdc509de 100644 --- a/core/net/rime/rimestats.h +++ b/core/net/rime/rimestats.h @@ -55,12 +55,15 @@ struct rimestats { unsigned long lltx, llrx; }; +#if RIMESTATS_CONF_ENABLED +/* Don't access this variable directly, use RIMESTATS_ADD and RIMESTATS_GET */ extern struct rimestats rimestats; -#if RIMESTATS_CONF_ENABLED #define RIMESTATS_ADD(x) rimestats.x++ +#define RIMESTATS_GET(x) rimestats.x #else /* RIMESTATS_CONF_ENABLED */ #define RIMESTATS_ADD(x) +#define RIMESTATS_GET(x) 0 #endif /* RIMESTATS_CONF_ENABLED */ #endif /* __RIMESTATS_H__ */