aboutsummaryrefslogtreecommitdiffstats
path: root/src/libdash/source/portable/Networking.h
blob: 6239c3a3fbefb3e8b1a68074c7c21aabcca86b73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef PORTABLE_NETWORKING_H_
#define PORTABLE_NETWORKING_H_

#if defined _WIN32 || defined _WIN64

#include <WinSock2.h>
#include <WS2tcpip.h>

#else

#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h> /* superset of previous */ 
#include <netdb.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>

#define closesocket(socket) close(socket)
#define WSAStartup(wVersionRequested, lpWSAData) 0
#define WSACleanup() {}

typedef unsigned char WSADATA;

#endif

#endif  // PORTABLE_NETWORKING_H_