aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/hicn/transport/portability
diff options
context:
space:
mode:
authorAngelo Mantellini <manangel@cisco.com>2019-01-30 12:11:34 +0100
committerAngelo Mantellini <manangel@cisco.com>2019-01-30 15:23:44 +0100
commite5145b878f9de35676085409878a66899d2ee4f2 (patch)
tree177f77810901921ee03d1d3b850600c5f2cd1ef9 /libtransport/src/hicn/transport/portability
parent30061551cd39c9f30280bfa0cf3cc909f4fac015 (diff)
[HICN-18] first commit of libtransport for windows
Change-Id: I3a43b22194aa13ae5de1746e3d4bd9a275070261 Signed-off-by: Angelo Mantellini <manangel@cisco.com>
Diffstat (limited to 'libtransport/src/hicn/transport/portability')
-rw-r--r--[-rwxr-xr-x]libtransport/src/hicn/transport/portability/CMakeLists.txt6
-rw-r--r--[-rwxr-xr-x]libtransport/src/hicn/transport/portability/c_portability.h0
-rw-r--r--[-rwxr-xr-x]libtransport/src/hicn/transport/portability/portability.h4
-rw-r--r--libtransport/src/hicn/transport/portability/win_portability.h38
4 files changed, 48 insertions, 0 deletions
diff --git a/libtransport/src/hicn/transport/portability/CMakeLists.txt b/libtransport/src/hicn/transport/portability/CMakeLists.txt
index eee973c2d..5ad3c8207 100755..100644
--- a/libtransport/src/hicn/transport/portability/CMakeLists.txt
+++ b/libtransport/src/hicn/transport/portability/CMakeLists.txt
@@ -22,5 +22,11 @@ list(APPEND SOURCE_FILES
""
)
+if(WIN32)
+ list(APPEND HEADER_FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/win_portability.h
+ )
+endif()
+
set(SOURCE_FILES ${SOURCE_FILES} PARENT_SCOPE)
set(HEADER_FILES ${HEADER_FILES} PARENT_SCOPE) \ No newline at end of file
diff --git a/libtransport/src/hicn/transport/portability/c_portability.h b/libtransport/src/hicn/transport/portability/c_portability.h
index 71e976a81..71e976a81 100755..100644
--- a/libtransport/src/hicn/transport/portability/c_portability.h
+++ b/libtransport/src/hicn/transport/portability/c_portability.h
diff --git a/libtransport/src/hicn/transport/portability/portability.h b/libtransport/src/hicn/transport/portability/portability.h
index 7063e1822..1d97a346e 100755..100644
--- a/libtransport/src/hicn/transport/portability/portability.h
+++ b/libtransport/src/hicn/transport/portability/portability.h
@@ -17,6 +17,10 @@
#pragma once
+#ifdef _WIN32
+#include <hicn/transport/portability/win_portability.h>
+#endif
+
#include <hicn/transport/portability/c_portability.h>
#include <string.h>
diff --git a/libtransport/src/hicn/transport/portability/win_portability.h b/libtransport/src/hicn/transport/portability/win_portability.h
new file mode 100644
index 000000000..f1d6e2b0e
--- /dev/null
+++ b/libtransport/src/hicn/transport/portability/win_portability.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2017-2019 Cisco and/or its affiliates.
+ * Copyright 2017 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+#define WIN32_LEAN_AND_MEAN
+#define NOMINMAX
+#include <parc/windows/parc_Utils.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+#include <windows.h>
+#include <winsock2.h>
+#include <ws2ipdef.h>
+#include <ws2tcpip.h>
+#include <algorithm>
+
+#define __ORDER_LITTLE_ENDIAN__ 0x41424344UL
+#define __ORDER_BIG_ENDIAN__ 0x44434241UL
+#define __BYTE_ORDER__ ('ABCD')
+#undef DELETE
+
+#define HAVE_STRUCT_TIMESPEC
+#include <pthread.h> \ No newline at end of file