소스 검색

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.
Georgii Rylov 3 년 전
부모
커밋
0899638ece
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/ssp_config.h

+ 1 - 1
core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/ssp_config.h

@@ -41,7 +41,7 @@
 #endif
 #endif
 
 
 #if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__EMSCRIPTEN__) \
 #if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__EMSCRIPTEN__) \
-    && !defined(ESP_PLATFORM)
+    && !defined(ESP_PLATFORM) && !defined(DISABLE_CLOCK_NANOSLEEP)
 #define CONFIG_HAS_CLOCK_NANOSLEEP 1
 #define CONFIG_HAS_CLOCK_NANOSLEEP 1
 #else
 #else
 #define CONFIG_HAS_CLOCK_NANOSLEEP 0
 #define CONFIG_HAS_CLOCK_NANOSLEEP 0