Skip to content

Commit dc49561

Browse files
cjihrigaddaleax
authored andcommitted
deps: update to uvwasi 0.0.10
Notable changes: - The uvwasi_preopen_t now uses const char* for the mapped_path and real_path fields. Previously, these were not `const`. - uvwasi_path_filestat_get() now properly handles the UVWASI_LOOKUP_SYMLINK_FOLLOW flag. - uvwasi_options_init() has been added to reduce the boilerplate code associated with initializing uvwasi_options_t's. - The DEBUG() macro has been renamed to UVWASI_DEBUG() to reduce naming conflicts with other projects. - A compilation error on NetBSD 8.2 has been fixed. - The uvwasi_fd_filestat_set_times() and uvwasi_path_filestat_set_times() functions now have proper implementations. Fixes: #34510 PR-URL: #34623 Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent d8e0dea commit dc49561

File tree

5 files changed

+387
-256
lines changed

5 files changed

+387
-256
lines changed

deps/uvwasi/include/uvwasi.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ extern "C" {
1010

1111
#define UVWASI_VERSION_MAJOR 0
1212
#define UVWASI_VERSION_MINOR 0
13-
#define UVWASI_VERSION_PATCH 9
13+
#define UVWASI_VERSION_PATCH 10
1414
#define UVWASI_VERSION_HEX ((UVWASI_VERSION_MAJOR << 16) | \
1515
(UVWASI_VERSION_MINOR << 8) | \
1616
(UVWASI_VERSION_PATCH))
@@ -50,8 +50,8 @@ typedef struct uvwasi_s {
5050
} uvwasi_t;
5151

5252
typedef struct uvwasi_preopen_s {
53-
char* mapped_path;
54-
char* real_path;
53+
const char* mapped_path;
54+
const char* real_path;
5555
} uvwasi_preopen_t;
5656

5757
typedef struct uvwasi_options_s {
@@ -70,6 +70,7 @@ typedef struct uvwasi_options_s {
7070
/* Embedder API. */
7171
uvwasi_errno_t uvwasi_init(uvwasi_t* uvwasi, uvwasi_options_t* options);
7272
void uvwasi_destroy(uvwasi_t* uvwasi);
73+
void uvwasi_options_init(uvwasi_options_t* options);
7374
/* Use int instead of uv_file to avoid needing uv.h */
7475
uvwasi_errno_t uvwasi_embedder_remap_fd(uvwasi_t* uvwasi,
7576
const uvwasi_fd_t fd,

deps/uvwasi/include/wasi_serdes.h

+6-8
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,20 @@
55

66
/* Basic uint{8,16,32,64}_t read/write functions. */
77

8-
#define BASIC_TYPE_(name, type) \
8+
#define BASIC_TYPE(name, type) \
99
void uvwasi_serdes_write_##name(void* ptr, size_t offset, type value); \
1010
type uvwasi_serdes_read_##name(const void* ptr, size_t offset); \
1111

12-
#define BASIC_TYPE(type) BASIC_TYPE_(type, type)
13-
#define BASIC_TYPE_UVWASI(type) BASIC_TYPE_(type, uvwasi_##type)
12+
#define BASIC_TYPE_UVWASI(type) BASIC_TYPE(type, uvwasi_##type)
1413

1514
#define UVWASI_SERDES_SIZE_uint8_t sizeof(uint8_t)
16-
BASIC_TYPE(uint8_t)
15+
BASIC_TYPE(uint8_t, uint8_t)
1716
#define UVWASI_SERDES_SIZE_uint16_t sizeof(uint16_t)
18-
BASIC_TYPE(uint16_t)
17+
BASIC_TYPE(uint16_t, uint16_t)
1918
#define UVWASI_SERDES_SIZE_uint32_t sizeof(uint32_t)
20-
BASIC_TYPE(uint32_t)
19+
BASIC_TYPE(uint32_t, uint32_t)
2120
#define UVWASI_SERDES_SIZE_uint64_t sizeof(uint64_t)
22-
BASIC_TYPE(uint64_t)
21+
BASIC_TYPE(uint64_t, uint64_t)
2322

2423
#define UVWASI_SERDES_SIZE_advice_t sizeof(uvwasi_advice_t)
2524
BASIC_TYPE_UVWASI(advice_t)
@@ -80,7 +79,6 @@ BASIC_TYPE_UVWASI(whence_t)
8079

8180
#undef BASIC_TYPE_UVWASI
8281
#undef BASIC_TYPE
83-
#undef BASIC_TYPE_
8482

8583
/* WASI structure read/write functions. */
8684

deps/uvwasi/src/debug.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
#define __UVWASI_DEBUG_H__
33

44
#ifdef UVWASI_DEBUG_LOG
5+
#ifndef __STDC_FORMAT_MACROS
56
# define __STDC_FORMAT_MACROS
7+
#endif
68
# include <inttypes.h>
7-
# define DEBUG(fmt, ...) \
9+
# define UVWASI_DEBUG(fmt, ...) \
810
do { fprintf(stderr, fmt, __VA_ARGS__); } while (0)
911
#else
10-
# define DEBUG(fmt, ...)
12+
# define UVWASI_DEBUG(fmt, ...)
1113
#endif
1214

1315
#endif /* __UVWASI_DEBUG_H__ */

0 commit comments

Comments
 (0)