drivers: native_posix_console: Fix if printk is not selected
We should only try to register a printk backend if printk is compiled in, otherwise we get a link error. Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
parent
1e1f3ba73c
commit
7a541714f9
1 changed files with 2 additions and 0 deletions
|
|
@ -39,8 +39,10 @@ static void native_posix_stdout_init(void)
|
|||
setvbuf(stdout, NULL, _IOLBF, 512);
|
||||
setvbuf(stderr, NULL, _IOLBF, 512);
|
||||
|
||||
#ifdef CONFIG_PRINTK
|
||||
extern void __printk_hook_install(int (*fn)(int));
|
||||
__printk_hook_install(putchar);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue