libpayload: Fix build when both USB and PS/2 keyboard support is disabled
libpayload uses -Werror for some reason right now, and the variable 'c' in curses_getchar is only used if CONFIG_USB_HID or CONFIG_PC_KEYBOARD is defined, giving an unused variable warning that gets promoted to an error. So wrap the variable declaration around appropriate #ifdef's
Signed-off-by: Mart Raudsepp leio@gentoo.org --- libpayload/curses/keyboard.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/libpayload/curses/keyboard.c b/libpayload/curses/keyboard.c index 4a96428..4a83391 100644 --- a/libpayload/curses/keyboard.c +++ b/libpayload/curses/keyboard.c @@ -146,7 +146,9 @@ static int cook_serial(unsigned char ch)
static int curses_getchar(int delay) { +#if defined(CONFIG_USB_HID) || defined(CONFIG_PC_KEYBOARD) unsigned short c; +#endif
do { #ifdef CONFIG_USB_HID