Skip to content

Commit

Permalink
Provide a macro to read rimestats when enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
g-oikonomou committed Mar 20, 2013
1 parent 12860ce commit 6236681
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/net/rime/rimestats.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__ */

0 comments on commit 6236681

Please sign in to comment.