sys: printk: Fix LOG2 printk support in cpp code

This commit fixes the issue with a compilation of the sample that
uses printk function from cpp code when LOG2 is used and printk
is handled by logging subsystem.

Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
This commit is contained in:
Radoslaw Koppel 2021-06-23 13:45:13 +02:00 committed by Anas Nashif
commit c888ceea32

View file

@ -12,6 +12,9 @@
#include <stddef.h>
#include <stdarg.h>
#include <inttypes.h>
#if defined(CONFIG_LOG_PRINTK) && defined(CONFIG_LOG2)
#include <logging/log.h>
#endif
#ifdef __cplusplus
extern "C" {
@ -47,7 +50,6 @@ extern "C" {
#ifdef CONFIG_PRINTK
#if defined(CONFIG_LOG_PRINTK) && defined(CONFIG_LOG2)
#include <logging/log.h>
#define printk(...) Z_LOG_PRINTK(__VA_ARGS__)
static inline __printf_like(1, 0) void vprintk(const char *fmt, va_list ap)
{