avoid duplicate function declarations on windows
Этот коммит содержится в:
родитель
e5a36fb1cf
Коммит
e45bddb9fd
@ -127,26 +127,11 @@ static inline int writev(int sock, struct iovec *iov, int nvecs)
|
|||||||
#include <mswsock.h>
|
#include <mswsock.h>
|
||||||
#include <ws2tcpip.h>
|
#include <ws2tcpip.h>
|
||||||
|
|
||||||
/* same as WSABUF */
|
|
||||||
struct iovec {
|
|
||||||
u_long iov_len;
|
|
||||||
char *iov_base;
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
/* "inline" keyword is valid only with C++ engine! */
|
/* "inline" keyword is valid only with C++ engine! */
|
||||||
#define inline __inline
|
#define inline __inline
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline int writev(int sock, struct iovec *iov, int nvecs)
|
|
||||||
{
|
|
||||||
DWORD ret;
|
|
||||||
if (WSASend(sock, (LPWSABUF)iov, nvecs, &ret, 0, NULL, NULL) == 0) {
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* not really usleep, but safe for the way we use it in this lib */
|
/* not really usleep, but safe for the way we use it in this lib */
|
||||||
static inline int usleep(int udelay)
|
static inline int usleep(int udelay)
|
||||||
{
|
{
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user