Commit cda91002 authored by Daniel Salzman's avatar Daniel Salzman
Browse files

Merge branch 'named-variadic-macros' into 'master'

Convert all named variadic macros to ISO C __VA_ARGS__ (with ## extension)

See merge request !380
parents 3afe1620 b541a21f
......@@ -57,8 +57,8 @@ static void test_int(const char *in, int expected, int errcode)
}
// mute warn_unused_result
#define asprintf(args...) do { \
int r = (asprintf)(args); assert(r >= 0); \
#define asprintf(args, ...) do { \
int r = (asprintf)(args, ##__VA_ARGS__); assert(r >= 0); \
} while (0);
int main(int argc, char *argv[])
......
......@@ -55,46 +55,46 @@
/* Brief messages. */
#ifdef DEBUG_ENABLE_BRIEF
#define dbg_ns(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_ns(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_ns_hex(data, len) hex_log((data), (len))
#define dbg_ns_exec(cmds) do { cmds } while (0)
#else
#define dbg_ns(msg...)
#define dbg_ns(msg, ...)
#define dbg_ns_hex(data, len)
#define dbg_ns_exec(cmds)
#endif
/* Verbose messages. */
#ifdef DEBUG_ENABLE_VERBOSE
#define dbg_ns_verb(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_ns_verb(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_ns_hex_verb(data, len) hex_log((data), (len))
#define dbg_ns_exec_verb(cmds) do { cmds } while (0)
#else
#define dbg_ns_verb(msg...)
#define dbg_ns_verb(msg, ...)
#define dbg_ns_hex_verb(data, len)
#define dbg_ns_exec_verb(cmds)
#endif
/* Detail messages. */
#ifdef DEBUG_ENABLE_DETAILS
#define dbg_ns_detail(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_ns_detail(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_ns_hex_detail(data, len) hex_log((data), (len))
#define dbg_ns_exec_detail(cmds) do { cmds } while (0)
#else
#define dbg_ns_detail(msg...)
#define dbg_ns_detail(msg, ...)
#define dbg_ns_hex_detail(data, len)
#define dbg_ns_exec_detail(cmds)
#endif
/* No messages. */
#else
#define dbg_ns(msg...)
#define dbg_ns(msg, ...)
#define dbg_ns_hex(data, len)
#define dbg_ns_exec(cmds)
#define dbg_ns_verb(msg...)
#define dbg_ns_verb(msg, ...)
#define dbg_ns_hex_verb(data, len)
#define dbg_ns_exec_verb(cmds)
#define dbg_ns_detail(msg...)
#define dbg_ns_detail(msg, ...)
#define dbg_ns_hex_detail(data, len)
#define dbg_ns_exec_detail(cmds)
#endif
......@@ -105,46 +105,46 @@
/* Brief messages. */
#ifdef DEBUG_ENABLE_BRIEF
#define dbg_zone(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_zone(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_zone_hex(data, len) hex_log((data), (len))
#define dbg_zone_exec(cmds) do { cmds } while (0)
#else
#define dbg_zone(msg...)
#define dbg_zone(msg, ...)
#define dbg_zone_hex(data, len)
#define dbg_zone_exec(cmds)
#endif
/* Verbose messages. */
#ifdef DEBUG_ENABLE_VERBOSE
#define dbg_zone_verb(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_zone_verb(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_zone_hex_verb(data, len) hex_log((data), (len))
#define dbg_zone_exec_verb(cmds) do { cmds } while (0)
#else
#define dbg_zone_verb(msg...)
#define dbg_zone_verb(msg, ...)
#define dbg_zone_hex_verb(data, len)
#define dbg_zone_exec_verb(cmds)
#endif
/* Detail messages. */
#ifdef DEBUG_ENABLE_DETAILS
#define dbg_zone_detail(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_zone_detail(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_zone_hex_detail(data, len) hex_log((data), (len))
#define dbg_zone_exec_detail(cmds) do { cmds } while (0)
#else
#define dbg_zone_detail(msg...)
#define dbg_zone_detail(msg, ...)
#define dbg_zone_hex_detail(data, len)
#define dbg_zone_exec_detail(cmds)
#endif
/* No messages. */
#else
#define dbg_zone(msg...)
#define dbg_zone(msg, ...)
#define dbg_zone_hex(data, len)
#define dbg_zone_exec(cmds)
#define dbg_zone_verb(msg...)
#define dbg_zone_verb(msg, ...)
#define dbg_zone_hex_verb(data, len)
#define dbg_zone_exec_verb(cmds)
#define dbg_zone_detail(msg...)
#define dbg_zone_detail(msg, ...)
#define dbg_zone_hex_detail(data, len)
#define dbg_zone_exec_detail(cmds)
#endif
......@@ -155,40 +155,40 @@
/* Brief messages. */
#ifdef DEBUG_ENABLE_BRIEF
#define dbg_zonediff(msg...) fprintf(stderr, msg)
#define dbg_zonediff(msg, ...) fprintf(stderr, msg, ##__VA_ARGS__)
#define dbg_zonediff_hex(data, len) hex_print((data), (len))
#else
#define dbg_zonediff(msg...)
#define dbg_zonediff(msg, ...)
#define dbg_zonediff_hex(data, len)
#endif
/* Verbose messages. */
#ifdef DEBUG_ENABLE_VERBOSE
#define dbg_zonediff_verb(msg...) fprintf(stderr, msg)
#define dbg_zonediff_verb(msg, ...) fprintf(stderr, msg, ##__VA_ARGS__)
#define dbg_zonediff_hex_verb(data, len) hex_print((data), (len))
#else
#define dbg_zonediff_verb(msg...)
#define dbg_zonediff_verb(msg, ...)
#define dbg_zonediff_hex_verb(data, len)
#endif
/* Detail messages. */
#ifdef DEBUG_ENABLE_DETAILS
#define dbg_zonediff_detail(msg...) fprintf(stderr, msg)
#define dbg_zonediff_detail(msg, ...) fprintf(stderr, msg, ##__VA_ARGS__)
#define dbg_zonediff_hex_detail(data, len) hex_print((data), (len))
#define dbg_zonediff_exec_detail(cmds) do { cmds } while (0)
#else
#define dbg_zonediff_detail(msg...)
#define dbg_zonediff_detail(msg, ...)
#define dbg_zonediff_hex_detail(data, len)
#define dbg_zonediff_exec_detail(cmds)
#endif
/* No messages. */
#else
#define dbg_zonediff(msg...)
#define dbg_zonediff(msg, ...)
#define dbg_zonediff_hex(data, len)
#define dbg_zonediff_verb(msg...)
#define dbg_zonediff_verb(msg, ...)
#define dbg_zonediff_hex_verb(data, len)
#define dbg_zonediff_detail(msg...)
#define dbg_zonediff_detail(msg, ...)
#define dbg_zonediff_hex_detail(data, len)
#define dbg_zonediff_exec_detail(cmds)
#endif
......@@ -199,46 +199,46 @@
/* Brief messages. */
#ifdef DEBUG_ENABLE_BRIEF
#define dbg_dnssec(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_dnssec(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_dnssec_hex(data, len) hex_log((data), (len))
#define dbg_dnssec_exec(cmds) do { cmds } while (0)
#else
#define dbg_dnssec(msg...)
#define dbg_dnssec(msg, ...)
#define dbg_dnssec_hex(data, len)
#define dbg_dnssec_exec(cmds)
#endif
/* Verbose messages. */
#ifdef DEBUG_ENABLE_VERBOSE
#define dbg_dnssec_verb(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_dnssec_verb(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_dnssec_hex_verb(data, len) hex_log((data), (len))
#define dbg_dnssec_exec_verb(cmds) do { cmds } while (0)
#else
#define dbg_dnssec_verb(msg...)
#define dbg_dnssec_verb(msg, ...)
#define dbg_dnssec_hex_verb(data, len)
#define dbg_dnssec_exec_verb(cmds)
#endif
/* Detail messages. */
#ifdef DEBUG_ENABLE_DETAILS
#define dbg_dnssec_detail(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_dnssec_detail(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_dnssec_hex_detail(data, len) hex_log((data), (len))
#define dbg_dnssec_exec_detail(cmds) do { cmds } while (0)
#else
#define dbg_dnssec_detail(msg...)
#define dbg_dnssec_detail(msg, ...)
#define dbg_dnssec_hex_detail(data, len)
#define dbg_dnssec_exec_detail(cmds)
#endif
/* No messages. */
#else
#define dbg_dnssec(msg...)
#define dbg_dnssec(msg, ...)
#define dbg_dnssec_hex(data, len)
#define dbg_dnssec_exec(cmds)
#define dbg_dnssec_verb(msg...)
#define dbg_dnssec_verb(msg, ...)
#define dbg_dnssec_hex_verb(data, len)
#define dbg_dnssec_exec_verb(cmds)
#define dbg_dnssec_detail(msg...)
#define dbg_dnssec_detail(msg, ...)
#define dbg_dnssec_hex_detail(data, len)
#define dbg_dnssec_exec_detail(cmds)
#endif
......@@ -249,38 +249,38 @@
/* Brief messages. */
#ifdef DEBUG_ENABLE_BRIEF
#define dbg_server(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_server(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_server_hex(data, len) hex_log((data), (len))
#else
#define dbg_server(msg...)
#define dbg_server(msg, ...)
#define dbg_server_hex(data, len)
#endif
/* Verbose messages. */
#ifdef DEBUG_ENABLE_VERBOSE
#define dbg_server_verb(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_server_verb(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_server_hex_verb(data, len) hex_log((data), (len))
#else
#define dbg_server_verb(msg...)
#define dbg_server_verb(msg, ...)
#define dbg_server_hex_verb(data, len)
#endif
/* Detail messages. */
#ifdef DEBUG_ENABLE_DETAILS
#define dbg_server_detail(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_server_detail(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_server_hex_detail(data, len) hex_log((data), (len))
#else
#define dbg_server_detail(msg...)
#define dbg_server_detail(msg, ...)
#define dbg_server_hex_detail(data, len)
#endif
/* No messages. */
#else
#define dbg_server(msg...)
#define dbg_server(msg, ...)
#define dbg_server_hex(data, len)
#define dbg_server_verb(msg...)
#define dbg_server_verb(msg, ...)
#define dbg_server_hex_verb(data, len)
#define dbg_server_detail(msg...)
#define dbg_server_detail(msg, ...)
#define dbg_server_hex_detail(data, len)
#endif
......@@ -290,38 +290,38 @@
/* Brief messages. */
#ifdef DEBUG_ENABLE_BRIEF
#define dbg_net(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_net(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_net_hex(data, len) hex_log((data), (len))
#else
#define dbg_net(msg...)
#define dbg_net(msg, ...)
#define dbg_net_hex(data, len)
#endif
/* Verbose messages. */
#ifdef DEBUG_ENABLE_VERBOSE
#define dbg_net_verb(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_net_verb(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_net_hex_verb(data, len) hex_log((data), (len))
#else
#define dbg_net_verb(msg...)
#define dbg_net_verb(msg, ...)
#define dbg_net_hex_verb(data, len)
#endif
/* Detail messages. */
#ifdef DEBUG_ENABLE_DETAILS
#define dbg_net_detail(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_net_detail(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_net_hex_detail(data, len) hex_log((data), (len))
#else
#define dbg_net_detail(msg...)
#define dbg_net_detail(msg, ...)
#define dbg_net_hex_detail(data, len)
#endif
/* No messages. */
#else
#define dbg_net(msg...)
#define dbg_net(msg, ...)
#define dbg_net_hex(data, len)
#define dbg_net_verb(msg...)
#define dbg_net_verb(msg, ...)
#define dbg_net_hex_verb(data, len)
#define dbg_net_detail(msg...)
#define dbg_net_detail(msg, ...)
#define dbg_net_hex_detail(data, len)
#endif
......@@ -331,38 +331,38 @@
/* Brief messages. */
#ifdef DEBUG_ENABLE_BRIEF
#define dbg_rrl(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_rrl(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_rrl_hex(data, len) hex_log((data), (len))
#else
#define dbg_rrl(msg...)
#define dbg_rrl(msg, ...)
#define dbg_rrl_hex(data, len)
#endif
/* Verbose messages. */
#ifdef DEBUG_ENABLE_VERBOSE
#define dbg_rrl_verb(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_rrl_verb(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_rrl_hex_verb(data, len) hex_log((data), (len))
#else
#define dbg_rrl_verb(msg...)
#define dbg_rrl_verb(msg, ...)
#define dbg_rrl_hex_verb(data, len)
#endif
/* Detail messages. */
#ifdef DEBUG_ENABLE_DETAILS
#define dbg_rrl_detail(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_rrl_detail(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_rrl_hex_detail(data, len) hex_log((data), (len))
#else
#define dbg_rrl_detail(msg...)
#define dbg_rrl_detail(msg, ...)
#define dbg_rrl_hex_detail(data, len)
#endif
/* No messages. */
#else
#define dbg_rrl(msg...)
#define dbg_rrl(msg, ...)
#define dbg_rrl_hex(data, len)
#define dbg_rrl_verb(msg...)
#define dbg_rrl_verb(msg, ...)
#define dbg_rrl_hex_verb(data, len)
#define dbg_rrl_detail(msg...)
#define dbg_rrl_detail(msg, ...)
#define dbg_rrl_hex_detail(data, len)
#endif
......@@ -372,38 +372,38 @@
/* Brief messages. */
#ifdef DEBUG_ENABLE_BRIEF
#define dbg_dt(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_dt(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_dt_hex(data, len) hex_log((data), (len))
#else
#define dbg_dt(msg...)
#define dbg_dt(msg, ...)
#define dbg_dt_hex(data, len)
#endif
/* Verbose messages. */
#ifdef DEBUG_ENABLE_VERBOSE
#define dbg_dt_verb(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_dt_verb(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_dt_hex_verb(data, len) hex_log((data), (len))
#else
#define dbg_dt_verb(msg...)
#define dbg_dt_verb(msg, ...)
#define dbg_dt_hex_verb(data, len)
#endif
/* Detail messages. */
#ifdef DEBUG_ENABLE_DETAILS
#define dbg_dt_detail(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_dt_detail(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_dt_hex_detail(data, len) hex_log((data), (len))
#else
#define dbg_dt_detail(msg...)
#define dbg_dt_detail(msg, ...)
#define dbg_dt_hex_detail(data, len)
#endif
/* No messages. */
#else
#define dbg_dt(msg...)
#define dbg_dt(msg, ...)
#define dbg_dt_hex(data, len)
#define dbg_dt_verb(msg...)
#define dbg_dt_verb(msg, ...)
#define dbg_dt_hex_verb(data, len)
#define dbg_dt_detail(msg...)
#define dbg_dt_detail(msg, ...)
#define dbg_dt_hex_detail(data, len)
#endif
......@@ -413,38 +413,38 @@
/* Brief messages. */
#ifdef DEBUG_ENABLE_BRIEF
#define dbg_journal(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_journal(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_journal_hex(data, len) hex_log((data), (len))
#else
#define dbg_journal(msg...)
#define dbg_journal(msg, ...)
#define dbg_journal_hex(data, len)
#endif
/* Verbose messages. */
#ifdef DEBUG_ENABLE_VERBOSE
#define dbg_journal_verb(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_journal_verb(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_journal_hex_verb(data, len) hex_log((data), (len))
#else
#define dbg_journal_verb(msg...)
#define dbg_journal_verb(msg, ...)
#define dbg_journal_hex_verb(data, len)
#endif
/* Detail messages. */
#ifdef DEBUG_ENABLE_DETAILS
#define dbg_journal_detail(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_journal_detail(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_journal_hex_detail(data, len) hex_log((data), (len))
#else
#define dbg_journal_detail(msg...)
#define dbg_journal_detail(msg, ...)
#define dbg_journal_hex_detail(data, len)
#endif
/* No messages. */
#else
#define dbg_journal(msg...)
#define dbg_journal(msg, ...)
#define dbg_journal_hex(data, len)
#define dbg_journal_verb(msg...)
#define dbg_journal_verb(msg, ...)
#define dbg_journal_hex_verb(data, len)
#define dbg_journal_detail(msg...)
#define dbg_journal_detail(msg, ...)
#define dbg_journal_hex_detail(data, len)
#endif
......@@ -454,40 +454,40 @@
/* Brief messages. */
#ifdef DEBUG_ENABLE_BRIEF
#define dbg_zload(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_zload(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_zload_hex(data, len) hex_log((data), (len))
#else
#define dbg_zload(msg...)
#define dbg_zload(msg, ...)
#define dbg_zload_hex(data, len)
#endif
/* Verbose messages. */
#ifdef DEBUG_ENABLE_VERBOSE
#define dbg_zload_verb(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_zload_verb(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_zload_hex_verb(data, len) hex_log((data), (len))
#else
#define dbg_zload_verb(msg...)
#define dbg_zload_verb(msg, ...)
#define dbg_zload_hex_verb(data, len)
#endif
/* Detail messages. */
#ifdef DEBUG_ENABLE_DETAILS
#define dbg_zload_detail(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_zload_detail(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_zload_hex_detail(data, len) hex_log((data), (len))
#define dbg_zload_exec_detail(cmds) do { cmds } while (0)
#else
#define dbg_zload_detail(msg...)
#define dbg_zload_detail(msg, ...)
#define dbg_zload_hex_detail(data, len)
#define dbg_zload_exec_detail(cmds)
#endif
/* No messages. */
#else
#define dbg_zload(msg...)
#define dbg_zload(msg, ...)
#define dbg_zload_hex(data, len)
#define dbg_zload_verb(msg...)
#define dbg_zload_verb(msg, ...)
#define dbg_zload_hex_verb(data, len)
#define dbg_zload_detail(msg...)
#define dbg_zload_detail(msg, ...)
#define dbg_zload_hex_detail(data, len)
#define dbg_zload_exec_detail(cmds)
#endif
......@@ -498,40 +498,40 @@
/* Brief messages. */
#ifdef DEBUG_ENABLE_BRIEF
#define dbg_semcheck(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_semcheck(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_semcheck_hex(data, len) hex_log((data), (len))
#else
#define dbg_semcheck(msg...)
#define dbg_semcheck(msg, ...)
#define dbg_semcheck_hex(data, len)
#endif
/* Verbose messages. */
#ifdef DEBUG_ENABLE_VERBOSE
#define dbg_semcheck_verb(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_semcheck_verb(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_semcheck_hex_verb(data, len) hex_log((data), (len))
#else
#define dbg_semcheck_verb(msg...)
#define dbg_semcheck_verb(msg, ...)
#define dbg_semcheck_hex_verb(data, len)
#endif
/* Detail messages. */
#ifdef DEBUG_ENABLE_DETAILS
#define dbg_semcheck_detail(msg...) log_msg(LOG_DEBUG, msg)
#define dbg_semcheck_detail(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define dbg_semcheck_hex_detail(data, len) hex_log((data), (len))
#define dbg_semcheck_exec_detail(cmds) do { cmds } while (0)
#else
#define dbg_semcheck_detail(msg...)
#define dbg_semcheck_detail(msg, ...)
#define dbg_semcheck_hex_detail(data, len)
#define dbg_semcheck_exec_detail(cmds)
#endif
/* No messages. */
#else
#define dbg_semcheck(msg...)
#define dbg_semcheck(msg, ...)
#define dbg_semcheck_hex(data, len)
#define dbg_semcheck_verb(msg...)
#define dbg_semcheck_verb(msg, ...)
#define dbg_semcheck_hex_verb(data, len)
#define dbg_semcheck_detail(msg...)
#define dbg_semcheck_detail(msg, ...)
#define dbg_semcheck_hex_detail(data, len)
#define dbg_semcheck_exec_detail(cmds)
#endif
......
......@@ -154,26 +154,26 @@ int log_msg_zone_str(int priority, const char *zone, const char *fmt, ...)
/* Convenient logging. */
#define log_fatal(msg...) log_msg(LOG_CRIT, msg)
#define log_error(msg...) log_msg(LOG_ERR, msg)
#define log_warning(msg...) log_msg(LOG_WARNING, msg)
#define log_notice(msg...) log_msg(LOG_NOTICE, msg)
#define log_info(msg...) log_msg(LOG_INFO, msg)
#define log_debug(msg...) log_msg(LOG_DEBUG, msg)
#define log_zone_fatal(zone, msg...) log_msg_zone(LOG_CRIT, zone, msg)
#define log_zone_error(zone, msg...) log_msg_zone(LOG_ERR, zone, msg)
#define log_zone_warning(zone, msg...) log_msg_zone(LOG_WARNING, zone, msg)
#define log_zone_notice(zone, msg...) log_msg_zone(LOG_NOTICE, zone, msg)
#define log_zone_info(zone, msg...) log_msg_zone(LOG_INFO, zone, msg)
#define log_zone_debug(zone, msg...) log_msg_zone(LOG_DEBUG, zone, msg)
#define log_zone_str_fatal(zone, msg...) log_msg_zone_str(LOG_CRIT, zone, msg)
#define log_zone_str_error(zone, msg...) log_msg_zone_str(LOG_ERR, zone, msg)
#define log_zone_str_warning(zone, msg...) log_msg_zone_str(LOG_WARNING, zone, msg)
#define log_zone_str_notice(zone, msg...) log_msg_zone_str(LOG_NOTICE, zone, msg)
#define log_zone_str_info(zone, msg...) log_msg_zone_str(LOG_INFO, zone, msg)
#define log_zone_str_debug(zone, msg...) log_msg_zone_str(LOG_DEBUG, zone, msg)
#define log_fatal(msg, ...) log_msg(LOG_CRIT, msg, ##__VA_ARGS__)
#define log_error(msg, ...) log_msg(LOG_ERR, msg, ##__VA_ARGS__)
#define log_warning(msg, ...) log_msg(LOG_WARNING, msg, ##__VA_ARGS__)
#define log_notice(msg, ...) log_msg(LOG_NOTICE, msg, ##__VA_ARGS__)
#define log_info(msg, ...) log_msg(LOG_INFO, msg, ##__VA_ARGS__)
#define log_debug(msg, ...) log_msg(LOG_DEBUG, msg, ##__VA_ARGS__)
#define log_zone_fatal(zone, msg, ...) log_msg_zone(LOG_CRIT, zone, msg, ##__VA_ARGS__)
#define log_zone_error(zone, msg, ...) log_msg_zone(LOG_ERR, zone, msg, ##__VA_ARGS__)
#define log_zone_warning(zone, msg, ...) log_msg_zone(LOG_WARNING, zone, msg, ##__VA_ARGS__)
#define log_zone_notice(zone, msg, ...) log_msg_zone(LOG_NOTICE, zone, msg, ##__VA_ARGS__)
#define log_zone_info(zone, msg, ...) log_msg_zone(LOG_INFO, zone, msg, ##__VA_ARGS__)
#define log_zone_debug(zone, msg, ...) log_msg_zone(LOG_DEBUG, zone, msg, ##__VA_ARGS__)
#define log_zone_str_fatal(zone, msg, ...) log_msg_zone_str(LOG_CRIT, zone, msg, ##__VA_ARGS__)
#define log_zone_str_error(zone, msg, ...) log_msg_zone_str(LOG_ERR, zone, msg, ##__VA_ARGS__)
#define log_zone_str_warning(zone, msg, ...) log_msg_zone_str(LOG_WARNING, zone, msg, ##__VA_ARGS__)
#define log_zone_str_notice(zone, msg, ...) log_msg_zone_str(LOG_NOTICE, zone, msg, ##__VA_ARGS__)
#define log_zone_str_info(zone, msg, ...) log_msg_zone_str(LOG_INFO, zone, msg, ##__VA_ARGS__)
#define log_zone_str_debug(zone, msg, ...) log_msg_zone_str(LOG_DEBUG, zone, msg, ##__VA_ARGS__)
/*!
* \brief Update open files ownership.
......
......@@ -31,7 +31,7 @@ const yp_item_t scheme_mod_dnsproxy[] = {
};
/* Defines. */
#define MODULE_ERR(msg...) log_error("module 'dnsproxy', " msg)
#define MODULE_ERR(msg, ...) log_error("module 'dnsproxy', " msg, ##__VA_ARGS__)
struct dnsproxy {
struct sockaddr_storage remote;
......
......@@ -36,7 +36,7 @@ const yp_item_t scheme_mod_dnstap[] = {
};
/* Defines. */
#define MODULE_ERR(msg...) log_error("module 'dnstap', " msg)
#define MODULE_ERR(msg, ...) log_error("module 'dnstap', " msg, ##__VA_ARGS__)
static int log_message(int state, const knot_pkt_t *pkt, struct query_data *qdata, void *ctx)
{
......
......@@ -340,7 +340,7 @@ int cache_remove(MDB_txn *txn, MDB_dbi dbi, const knot_dname_t *name)
#define DEFAULT_PORT 514
#define SYSLOG_BUFLEN 1024 /* RFC3164, 4.1 message size. */
#define SYSLOG_FACILITY 3 /* System daemon. */
#define MODULE_ERR(msg...) log_error("module 'rose', " msg)
#define MODULE_ERR(msg, ...) log_error("module 'rose', " msg, ##__VA_ARGS__)
/*! \brief Safe stream skipping. */
static int stream_skip(char **stream, size_t *maxlen, int nbytes)
......@@ -356,8 +356,8 @@ static int stream_skip(char **stream, size_t *maxlen, int nbytes)
}
/*! \brief Stream write with constraints checks. */
#define STREAM_WRITE(stream, maxlen, fn, args...) \
if (stream_skip(&(stream), (maxlen), fn(stream, *(maxlen), args)) != KNOT_EOK) { \
#define STREAM_WRITE(stream, maxlen, fn, args, ...) \
if (stream_skip(&(stream), (maxlen), fn(stream, *(maxlen), args, ##__VA_ARGS__)) != KNOT_EOK) { \