#define MAX_STATS_ENTRIES 200 #define STATS_ENTRIES_CNT 0 extern struct s_call_stats *menu_call_stats[MAX_STATS_ENTRIES]; #if STATS_ENTRIES_CNT >= MAX_STATS_ENTRIES #error Too many menu items, max. MAX_STATS_ENTRIES allowed #endif #define STATS_STRUCT(name) \ static struct s_call_stats name##_##call_stats = \ {#name, 0}; \ menu_call_stats[STATS_ENTRIES_CNT] = &s_call_stats name##_##call_stats; \ #define STATS_ENTRIES_CNT (STATS_ENTRIES_CNT+1)