-
Notifications
You must be signed in to change notification settings - Fork 9
/
compat.h
38 lines (29 loc) · 886 Bytes
/
compat.h
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
28
29
30
31
32
33
34
35
36
37
38
#ifndef COMPAT_H
#define COMPAT_H
#ifndef _WIN32
typedef unsigned short WORD;
typedef unsigned int DWORD;
typedef unsigned char BYTE;
typedef unsigned char byte;
typedef unsigned short SHORT;
#define _stricmp strcasecmp
#define stricmp strcasecmp
#define min(a, b) (((a) < (b)) ? (a) : (b))
#define max(a, b) (((a) > (b)) ? (a) : (b))
#define _mkdir( x ) mkdir( x, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH )
#define socketError errno
#define EXPORT __attribute__((visibility("default")))
#else
#define ioctl ioctlsocket
#define close closesocket
#define socketError WSAGetLastError()
#define EWOULDBLOCK WSAEWOULDBLOCK
#define ECONNRESET WSAECONNRESET
#define EMSGSIZE WSAEMSGSIZE
#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
#define EHOSTUNREACH WSAEHOSTUNREACH
#define ENETUNREACH WSAENETUNREACH
#define EAFNOSUPPORT WSAEAFNOSUPPORT
#define EXPORT __declspec(dllexport)
#endif
#endif