Skip to content

Commit 9b28a8a

Browse files
authoredApr 11, 2024
Update esp-idf platform support in main (bytecodealliance#3304)
1. Fix API "futimens" and "utimensat" compiling error in different esp-idf version 2. Update component registry description file ps. refer to PR bytecodealliance#3296 on branch release/1.3x
1 parent 4e634be commit 9b28a8a

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed
 

‎core/shared/platform/esp-idf/espidf_platform.c

+20-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
#include "platform_api_vmcore.h"
77
#include "platform_api_extension.h"
88

9+
#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)) \
10+
&& (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 2, 0))
11+
#define UTIMENSAT_TIMESPEC_POINTER 1
12+
#define FUTIMENS_TIMESPEC_POINTER 1
13+
#endif
14+
915
int
1016
bh_platform_init()
1117
{
@@ -234,7 +240,13 @@ unlinkat(int fd, const char *path, int flag)
234240
}
235241

236242
int
237-
utimensat(int fd, const char *path, const struct timespec ts[2], int flag)
243+
utimensat(int fd, const char *path,
244+
#if UTIMENSAT_TIMESPEC_POINTER
245+
const struct timespec *ts,
246+
#else
247+
const struct timespec ts[2],
248+
#endif
249+
int flag)
238250
{
239251
errno = ENOSYS;
240252
return -1;
@@ -257,7 +269,13 @@ ftruncate(int fd, off_t length)
257269
#endif
258270

259271
int
260-
futimens(int fd, const struct timespec times[2])
272+
futimens(int fd,
273+
#if FUTIMENS_TIMESPEC_POINTER
274+
const struct timespec *times
275+
#else
276+
const struct timespec times[2]
277+
#endif
278+
)
261279
{
262280
errno = ENOSYS;
263281
return -1;

‎idf_component.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,11 @@ repository: https://github.com/bytecodealliance/wasm-micro-runtime.git
55
documentation: https://wamr.gitbook.io/
66
issues: https://github.com/bytecodealliance/wasm-micro-runtime/issues
77
dependencies:
8-
idf: ">=4.4"
8+
idf: ">=4.4"
9+
targets:
10+
- esp32
11+
- esp32s3
12+
- esp32c3
13+
- esp32c6
14+
examples:
15+
- path: product-mini/platforms/esp-idf
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## IDF Component Manager Manifest File
22
dependencies:
33
wasm-micro-runtime:
4-
version: ">=2.0"
4+
version: "^2"
55
override_path: "../../../.."
66
idf:
77
version: ">=4.4"

0 commit comments

Comments
 (0)
Please sign in to comment.