Skip to content
Merged
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions core/iwasm/libraries/lib-socket/inc/wasi_socket_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ struct addrinfo {
struct addrinfo *ai_next; /* Pointer to next in list. */
};

#ifdef __cplusplus
extern "C" {
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little strange that the macro only covers part of the code, prefer to wrap the whole file:

#ifndef _WASI_SOCKET_EXT_H_
#define _WASI_SOCKET_EXT_H_

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif
   => leave an empty line
...
   => leave an empty line
#ifdef __cplusplus
}
#endif
   => leave an empty line
#endif /* end of _WASI_SOCKET_EXT_H_ */

#ifndef __WASI_RIGHTS_SOCK_ACCEPT
int
accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
Expand Down Expand Up @@ -191,6 +194,9 @@ getaddrinfo(const char *node, const char *service, const struct addrinfo *hints,

void
freeaddrinfo(struct addrinfo *res);
#ifdef __cplusplus
}
#endif
#endif

/**
Expand Down