Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out)

if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU")
list(APPEND uvwasi_cflags -fvisibility=hidden --std=gnu89)
add_compile_definitions(NEED_UVWASI_EXPORT)

list(APPEND uvwasi_cflags -Wall -Wsign-compare -Wextra -Wstrict-prototypes)
list(APPEND uvwasi_cflags -Wno-unused-parameter)
endif()
Expand Down
5 changes: 5 additions & 0 deletions include/wasi_serdes.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
/* Basic uint{8,16,32,64}_t read/write functions. */

#define BASIC_TYPE(name, type) \
UVWASI_EXPORT \
void uvwasi_serdes_write_##name(void* ptr, size_t offset, type value); \
UVWASI_EXPORT \
type uvwasi_serdes_read_##name(const void* ptr, size_t offset); \

#define BASIC_TYPE_UVWASI(type) BASIC_TYPE(type, uvwasi_##type)
Expand Down Expand Up @@ -83,15 +85,18 @@ BASIC_TYPE_UVWASI(whence_t)
/* WASI structure read/write functions. */

#define STRUCT(name) \
UVWASI_EXPORT \
void uvwasi_serdes_write_##name(void* ptr, \
size_t offset, \
const uvwasi_##name* value); \
UVWASI_EXPORT \
void uvwasi_serdes_read_##name(const void* ptr, \
size_t offset, \
uvwasi_##name* value);

/* iovs currently only need to be read from WASM memory. */
#define IOVS_STRUCT(name) \
UVWASI_EXPORT \
uvwasi_errno_t uvwasi_serdes_read_##name(const void* ptr, \
size_t end, \
size_t offset, \
Expand Down
8 changes: 4 additions & 4 deletions include/wasi_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,10 @@ typedef uint8_t uvwasi_whence_t;
#define UVWASI_WHENCE_CUR 1
#define UVWASI_WHENCE_END 2

#if defined(_WIN32) || defined(__CYGWIN__)
#define UVWASI_EXPORT
#else
#ifdef NEED_UVWASI_EXPORT
#define UVWASI_EXPORT __attribute__((visibility("default")))
#endif
#else
#define UVWASI_EXPORT
#endif /* NEED_UVWASI_EXPORT */

#endif /* __UVWASI_WASI_TYPES_H__ */
Loading