mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
esp32: compiler complains about insert_wsi as macro
This commit is contained in:
parent
6b348a54bd
commit
4064daddf8
2 changed files with 19 additions and 4 deletions
|
@ -44,3 +44,15 @@ lws_plat_change_pollfd(struct lws_context *context,
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
insert_wsi(const struct lws_context *context, struct lws *wsi)
|
||||
{
|
||||
assert(context->lws_lookup[wsi->desc.sockfd -
|
||||
lws_plat_socket_offset()] == 0);
|
||||
|
||||
context->lws_lookup[wsi->desc.sockfd - \
|
||||
lws_plat_socket_offset()] = wsi;
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -90,9 +90,12 @@ gai_strerror(int);
|
|||
#define compatible_close(x) close(x)
|
||||
#define lws_plat_socket_offset() LWIP_SOCKET_OFFSET
|
||||
#define wsi_from_fd(A,B) A->lws_lookup[B - lws_plat_socket_offset()]
|
||||
#define insert_wsi(A,B) assert(A->lws_lookup[B->desc.sockfd - \
|
||||
lws_plat_socket_offset()] == 0); \
|
||||
A->lws_lookup[B->desc.sockfd - \
|
||||
lws_plat_socket_offset()] = B
|
||||
|
||||
struct lws_context;
|
||||
struct lws;
|
||||
|
||||
int
|
||||
insert_wsi(const struct lws_context *context, struct lws *wsi);
|
||||
|
||||
#define delete_from_fd(A,B) A->lws_lookup[B - lws_plat_socket_offset()] = 0
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue