From 0899638ecee6ef91fac48353e1ca777d4df17612 Mon Sep 17 00:00:00 2001 From: Georgii Rylov Date: Fri, 12 May 2023 00:49:21 +0100 Subject: [PATCH] Use a manual flag to disable clock_nanosleep on the unsupported platforms (#2176) For some platforms WAMR gets compiled with `CONFIG_HAS_CLOCK_NANOSLEEP=1`, while `clock_nanosleep` is not present at the platform, which causes compilation error. Add check for macro `DISABLE_CLOCK_NANOSLEEP` to resolve the issue, only when the macro isn't defined can the macro `CONFIG_HAS_CLOCK_NANOSLEEP` take effect. --- .../libc-wasi/sandboxed-system-primitives/src/ssp_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 d5babd02b..7f6e9b941 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 @@ -41,7 +41,7 @@ #endif #if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__EMSCRIPTEN__) \ - && !defined(ESP_PLATFORM) + && !defined(ESP_PLATFORM) && !defined(DISABLE_CLOCK_NANOSLEEP) #define CONFIG_HAS_CLOCK_NANOSLEEP 1 #else #define CONFIG_HAS_CLOCK_NANOSLEEP 0