From f28a15bf2f6ded8ed2e6b4df41d132977664b80b Mon Sep 17 00:00:00 2001 From: Hanged Fish <94267867+hangedfish@users.noreply.github.com> Date: Wed, 12 Oct 2022 15:51:07 +0800 Subject: [PATCH] Wrap wasi_socket_ext api with `extern "C"` (#1575) Fix wasi_socket_ext library failed to link with cxx project --- core/iwasm/libraries/lib-socket/inc/wasi_socket_ext.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/iwasm/libraries/lib-socket/inc/wasi_socket_ext.h b/core/iwasm/libraries/lib-socket/inc/wasi_socket_ext.h index 602237f63..c9a07eb72 100644 --- a/core/iwasm/libraries/lib-socket/inc/wasi_socket_ext.h +++ b/core/iwasm/libraries/lib-socket/inc/wasi_socket_ext.h @@ -12,6 +12,10 @@ /*Be a part of */ +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { SOCKET_DGRAM = 0, SOCKET_STREAM, @@ -987,4 +991,9 @@ __wasi_sock_get_ipv6_only(__wasi_fd_t fd, bool *option) * since don't want to re-compile the wasi-libc, * we tend to keep original implentations of recv() and send(). */ + +#ifdef __cplusplus +} +#endif + #endif