diff options
author | Angelo Mantellini <manangel@cisco.com> | 2019-01-30 16:47:41 +0100 |
---|---|---|
committer | Angelo Mantellini <manangel@cisco.com> | 2019-01-30 17:43:09 +0100 |
commit | 67371907c2433f5233d4a669a1c9176539e9928f (patch) | |
tree | b4b5119c495fde382fc7c70d4398c943364c2372 /lib/src/common.h | |
parent | e5145b878f9de35676085409878a66899d2ee4f2 (diff) |
[HICN-19] Add support for Windows 10 x64 for libhicn (lib)
Change-Id: I5109d5ce293265fca557c2ef952fcb1c13b9d816
Signed-off-by: Angelo Mantellini <manangel@cisco.com>
Diffstat (limited to 'lib/src/common.h')
-rw-r--r-- | lib/src/common.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/lib/src/common.h b/lib/src/common.h index dd488d43b..57b9078ff 100644 --- a/lib/src/common.h +++ b/lib/src/common.h @@ -74,13 +74,36 @@ typedef uint8_t u8; #define ATTR_INIT(key, value) value #endif -/* Endianness detection for Windows platforms */ #ifdef _WIN32 + /* Endianness detection for Windows platforms */ #define __ORDER_LITTLE_ENDIAN__ 0x41424344UL #define __ORDER_BIG_ENDIAN__ 0x44434241UL #define __BYTE_ORDER__ ('ABCD') + + /* Windows compatibility headers*/
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <winsock2.h>
+#include <ws2ipdef.h>
+#include <Ws2tcpip.h>
+#include <In6addr.h> + +#define __attribute__(A) + +#ifndef IOVEC
+#define IOVEC
+#define UIO_MAXIOV 16
+#define IOV_MAX UIO_MAXIOV
+struct iovec {
+ void* iov_base;
+ size_t iov_len;
+};
+#endif + #endif + + /* * IP address types */ @@ -92,8 +115,10 @@ typedef uint8_t u8; #else -#include <netinet/in.h> +#ifndef _WIN32 +#include <netinet/in.h> +#endif typedef union { u32 as_u32; |