mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-23 11:44:53 +00:00
23 lines
556 B
C
23 lines
556 B
C
#pragma once
|
|
|
|
#if defined(MG_ENABLE_RL) && MG_ENABLE_RL
|
|
#include <rl_net.h>
|
|
|
|
#define closesocket(x) closesocket(x)
|
|
|
|
#define TCP_NODELAY SO_KEEPALIVE
|
|
|
|
#define MG_SOCK_ERR(errcode) ((errcode) < 0 ? (errcode) : 0)
|
|
|
|
#define MG_SOCK_PENDING(errcode) \
|
|
((errcode) == BSD_EWOULDBLOCK || (errcode) == BSD_EALREADY || \
|
|
(errcode) == BSD_EINPROGRESS)
|
|
|
|
#define MG_SOCK_RESET(errcode) \
|
|
((errcode) == BSD_ECONNABORTED || (errcode) == BSD_ECONNRESET)
|
|
|
|
#define MG_SOCK_INTR(fd) (fd == BSD_EWOULDBLOCK)
|
|
|
|
#define socklen_t int
|
|
#endif
|