Even the 'unconditional' _alert() macro should be disabled if all debug features are disabled.

This commit is contained in:
Gregory Nutt 2016-06-20 22:38:54 -06:00
parent aab77a944d
commit b82743612f
2 changed files with 14 additions and 10 deletions

View File

@ -113,29 +113,33 @@
# define __arch_syslog syslog
#endif
#ifdef CONFIG_DEBUG_FEATURES
# define _alert(format, ...) \
__arch_syslog(LOG_EMERG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
#else /* CONFIG_DEBUG_ERROR */
# define _alert(x...)
#endif
#ifdef CONFIG_DEBUG_ERROR
# define _err(format, ...) \
__arch_syslog(LOG_ERR, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
#else /* CONFIG_DEBUG_ERROR */
#else
# define _err(x...)
#endif
#ifdef CONFIG_DEBUG_WARN
# define _warn(format, ...) \
__arch_syslog(LOG_WARNING, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
#else /* CONFIG_DEBUG_INFO */
#else
# define _warn(x...)
#endif /* CONFIG_DEBUG_INFO */
#endif
#ifdef CONFIG_DEBUG_INFO
# define _info(format, ...) \
__arch_syslog(LOG_INFO, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
#else /* CONFIG_DEBUG_INFO */
#else
# define _info(x...)
#endif /* CONFIG_DEBUG_INFO */
#endif
/* Subsystem specific debug */
@ -665,7 +669,7 @@
/* Variadic macros NOT supported */
#ifndef CONFIG_ARCH_LOWPUTC
#ifndef CONFIG_DEBUG_FEATURES
# define _alert (void)
# endif
@ -1479,7 +1483,7 @@ void lib_dumpbuffer(FAR const char *msg, FAR const uint8_t *buffer,
*/
#ifndef CONFIG_CPP_HAVE_VARARGS
#ifndef CONFIG_ARCH_LOWPUTC
#ifndef CONFIG_DEBUG_FEATURES
int _alert(const char *format, ...);
#endif

View File

@ -59,7 +59,7 @@
*
****************************************************************************/
#ifdef CONFIG_ARCH_LOWPUTC
#ifdef CONFIG_DEBUG_FEATURES
int _alert(const char *format, ...)
{
va_list ap;
@ -71,7 +71,7 @@ int _alert(const char *format, ...)
return ret;
}
#endif /* CONFIG_ARCH_LOWPUTC */
#endif /* CONFIG_DEBUG_FEATURES */
#ifdef CONFIG_DEBUG_ERROR
int _err(const char *format, ...)