[asterisk-dev] Re: [asterisk-commits] rizzo: trunk r51312 - /trunk/include/asterisk/strings.h

Kevin P. Fleming kpfleming at digium.com
Fri Jan 19 14:59:09 MST 2007


asterisk-commits at lists.digium.com wrote:
> +/*
> + * AST_INLINE_API() is a macro that takes a block of code as an argument.
> + * Using preprocessor #directives in the argument is not supported by all
> + * compilers, and it is a bit of an obfuscation anyways, so avoid it.
> + * As a workaround, define a macro that produces either its argument
> + * or nothing, and use that instead of #ifdef/#endif within the
> + * argument to AST_INLINE_API().
> + */
> +#if defined(DEBUG_THREADLOCALS)
> +#define	_DB1(x)	x
> +#else
> +#define _DB1(x)
> +#endif
> +

Is there any reason to call this _DB1 instead of DEBUG_THREADLOCAL or
something similar? Obscure macro names (even when they are only used a
few lines later) really don't help anyone trying to understand the code.


More information about the asterisk-dev mailing list