Use src/lib/w32/w32sockets.c for client
Move client's w32_connect() to w32sockets.c. Replace w32_recv() and w32_send() by read() and write(). Replace w32_close() by w32_close_function. Replace call of WSAStartup() in w32_sysdep_init() by w32_socket_init(). Remove the identical copies of fd_is_socket(), w32_set_winsock_errno(), w32_socket().
This commit is contained in:
parent
1153d9c995
commit
4d40a27542
12 changed files with 49 additions and 200 deletions
|
@ -39,23 +39,12 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef _WIN32
|
||||
#include "w32types.h"
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include "misc.h"
|
||||
#include "proto.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#define read(sock, buffer, buf_size) \
|
||||
w32_recv((sock), (buffer), (buf_size), 0)
|
||||
#define write(sock, buffer, buf_size) \
|
||||
w32_send((sock), (buffer), (buf_size), 0)
|
||||
#endif
|
||||
|
||||
int
|
||||
recvline(int s, char *buf)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue