..
This commit is contained in:
parent
a42dfefc55
commit
14fe868ded
1 changed files with 23 additions and 1 deletions
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <endian.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
@ -28,6 +27,29 @@
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
|
#include <endian.h>
|
||||||
|
#include <byteswap.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __MACH__
|
||||||
|
#include <mach/mach.h>
|
||||||
|
#include <machine/endian.h>
|
||||||
|
|
||||||
|
#define htobe16(value) OSSwapHostToBigInt16(value)
|
||||||
|
#define be16toh(value) OSSwapBigToHostInt16(value)
|
||||||
|
#define htobe32(value) OSSwapHostToBigInt32(value)
|
||||||
|
#define be32toh(value) OSSwapBigToHostInt32(value)
|
||||||
|
|
||||||
|
#define htole16(value) OSSwapHostToLittleInt16(value)
|
||||||
|
#define le16toh(value) OSSwapLittleToHostInt16(value)
|
||||||
|
#define htole32(value) OSSwapHostToLittleInt32(value)
|
||||||
|
#define le32toh(value) OSSwapLittleToHostInt32(value)
|
||||||
|
|
||||||
|
#define __bswap_16(value) OSSwapConstInt16(value)
|
||||||
|
#define __bswap_32(value) OSSwapConstInt32(value)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define BUFFER_SIZE 256
|
#define BUFFER_SIZE 256
|
||||||
|
|
||||||
#define CONNECTION_ATTEMPT_COUNT 5
|
#define CONNECTION_ATTEMPT_COUNT 5
|
||||||
|
|
Loading…
Add table
Reference in a new issue