diff --git a/src/utils_complain.h b/src/utils_complain.h
index 56e74eabac3400d729df19d80ed7636157ede56b..b51a81c677a10d8777ca2d22b2ff7503093e0704 100644 (file)
--- a/src/utils_complain.h
+++ b/src/utils_complain.h
int interval;
} c_complain_t;
-#define C_COMPLAIN_INIT { 0, 0 }
+#define C_COMPLAIN_INIT_STATIC { 0, 0 }
+#define C_COMPLAIN_INIT(c) do { (c)->last = 0; (c)->interval = 0; } while (0)
/*
* NAME
*
* See `c_complain' for a description of the parameters.
*/
-void c_release (int level, c_complain_t *c, const char *format, ...);
+void c_do_release (int level, c_complain_t *c, const char *format, ...);
+#define c_release(level, c, ...) \
+ do { \
+ if ((c)->interval != 0) \
+ c_do_release(level, c, __VA_ARGS__); \
+ } while (0)
#endif /* UTILS_COMPLAIN_H */