From 06f15fcc365ff55a3c1e9ef92cb4793b70d830e0 Mon Sep 17 00:00:00 2001 From: Alberto Escolar Piedras Date: Thu, 28 Dec 2023 12:11:32 +0100 Subject: [PATCH] subsys shell devmem_service: Fix includes * The include for the host libC should be guarded with using the host libC instead of the POSIX arch, as this supports other C libraries. * This code uses getopt, which is an extension to the C library. Let's explicity select one of the extensions which includes it instead of relaying on somebody having set it for this file somewhere else. Signed-off-by: Alberto Escolar Piedras --- subsys/shell/modules/devmem_service.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/subsys/shell/modules/devmem_service.c b/subsys/shell/modules/devmem_service.c index 60c51d07fae..e5a7a06f35b 100644 --- a/subsys/shell/modules/devmem_service.c +++ b/subsys/shell/modules/devmem_service.c @@ -6,15 +6,18 @@ * SPDX-License-Identifier: Apache-2.0 */ +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 200809L + #include -#include -#include -#include -#ifdef CONFIG_ARCH_POSIX +#ifdef CONFIG_NATIVE_LIBC #include #else #include #endif +#include +#include +#include static inline bool is_ascii(uint8_t data) {