[asterisk-dev] 0006889: [patch] Convert ast_verbose into macros

casper at casper.org.ua casper at casper.org.ua
Wed Apr 5 13:05:04 MST 2006


> But failing to terminate ast_verbose strings with a newline is a
> feature, not a bug.  It allows us to send a full line with multiple
> calls to ast_verbose.  It is intentionally done that way.

There are other macros to handle this:
#define AST_VERBOSE_RAW(level, args, ...) \
        if (option_verbose >= level) ; else \
                ast_verbose(args, ## __VA_ARGS__);

#define AST_VERBOSE_RAW_IF(level, cond, args, ...) \
        if ((option_verbose >= level) && (cond)) ; else \
                ast_verbose(args, ## __VA_ARGS__);

That way anybody is pretty sure it's done intentionally.

Other possibility is not to use macros for such cases.



More information about the asterisk-dev mailing list