From 8436e88a0718af8614714bacfdff4cf45958def5 Mon Sep 17 00:00:00 2001 From: dongsheng28849455 <68947925+dongsheng28849455@users.noreply.github.com> Date: Tue, 27 Sep 2022 09:00:38 +0800 Subject: [PATCH] Fix link error for ESP-IDF 4.4.2 (#1520) Fix the issue reported by #1484: Platform ESP-IDF broken for WAMR 1.0.0 with ESP-IDF 4.4.2 Let the dummy ftruncate only work with ESP-IDF earlier than 4.4.2 --- core/shared/platform/esp-idf/espidf_platform.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/shared/platform/esp-idf/espidf_platform.c b/core/shared/platform/esp-idf/espidf_platform.c index 896190db..d05b19f5 100644 --- a/core/shared/platform/esp-idf/espidf_platform.c +++ b/core/shared/platform/esp-idf/espidf_platform.c @@ -228,12 +228,14 @@ fdopendir(int fd) return NULL; } +#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(4, 4, 2) int ftruncate(int fd, off_t length) { errno = ENOSYS; return -1; } +#endif int futimens(int fd, const struct timespec times[2])