Skip to content

Commit f28a15b

Browse files
authored
Wrap wasi_socket_ext api with extern "C" (#1575)
Fix wasi_socket_ext library failed to link with cxx project
1 parent e53ab91 commit f28a15b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

core/iwasm/libraries/lib-socket/inc/wasi_socket_ext.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212

1313
/*Be a part of <wasi/api.h>*/
1414

15+
#ifdef __cplusplus
16+
extern "C" {
17+
#endif
18+
1519
typedef enum {
1620
SOCKET_DGRAM = 0,
1721
SOCKET_STREAM,
@@ -987,4 +991,9 @@ __wasi_sock_get_ipv6_only(__wasi_fd_t fd, bool *option)
987991
* since don't want to re-compile the wasi-libc,
988992
* we tend to keep original implentations of recv() and send().
989993
*/
994+
995+
#ifdef __cplusplus
996+
}
997+
#endif
998+
990999
#endif

0 commit comments

Comments
 (0)