From b92d13555bbc4da33b1ed2b4beb85adf98864e40 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Sun, 26 Jun 2022 11:06:34 +0900 Subject: [PATCH] Fix macro redifinition warning for NuttX (#1250) Fix the following warning introduced by the recent change. ``` In file included from wamr/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/locking.h:17, from wamr/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.h:18, from wamr/core/iwasm/aot/../common/wasm_runtime_common.h:18, from wamr/core/iwasm/aot/aot_runtime.h:10, from wamr/core/iwasm/aot/aot_loader.c:6: wamr/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/ssp_config.h:55: error: "CONFIG_HAS_ISATTY" redefined [-Werror] #define CONFIG_HAS_ISATTY 1 In file included from wamr/core/shared/utils/../platform/include/platform_common.h:13, from wamr/core/shared/utils/bh_platform.h:9, from wamr/core/iwasm/aot/aot_runtime.h:9, from wamr/core/iwasm/aot/aot_loader.c:6: wamr/core/shared/platform/nuttx/platform_internal.h:75: note: this is the location of the previous definition #define CONFIG_HAS_ISATTY 0 ``` --- .../libc-wasi/sandboxed-system-primitives/src/ssp_config.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/ssp_config.h b/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/ssp_config.h index 5ffcb6b37..47b65ca82 100644 --- a/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/ssp_config.h +++ b/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/ssp_config.h @@ -51,11 +51,17 @@ #define CONFIG_HAS_FDATASYNC 0 #endif +/* + * For NuttX, CONFIG_HAS_ISATTY is provided by its platform header. + * (platform_internal.h) + */ +#ifndef __NuttX__ #ifndef __CloudABI__ #define CONFIG_HAS_ISATTY 1 #else #define CONFIG_HAS_ISATTY 0 #endif +#endif #ifndef __APPLE__ #define CONFIG_HAS_POSIX_FALLOCATE 1