[HICN-703] correct minor cmake issues and memset in manifest_format_fixed.cc 89/32189/5
authorAngelo Mantellini <angelo.mantellini@cisco.com>
Mon, 3 May 2021 10:43:15 +0000 (12:43 +0200)
committerAngelo Mantellini <angelo.mantellini@cisco.com>
Mon, 3 May 2021 11:34:52 +0000 (13:34 +0200)
Signed-off-by: Angelo Mantellini <angelo.mantellini@cisco.com>
Change-Id: I3ed763941fa58bdfc61b9462d3f3bd268d5a76ed

cmake/Modules/BuildMacros.cmake
libtransport/includes/hicn/transport/portability/win_portability.h
libtransport/src/core/manifest_format_fixed.cc
libtransport/src/io_modules/CMakeLists.txt

index 8914d90..c57aaa7 100644 (file)
@@ -262,10 +262,12 @@ macro (build_module module)
 
   if (${CMAKE_SYSTEM_NAME} MATCHES Darwin)
     set(LINK_FLAGS "-Wl,-undefined,dynamic_lookup")
+  elseif(${CMAKE_SYSTEM_NAME} MATCHES iOS)
+    set(LINK_FLAGS "-Wl,-undefined,dynamic_lookup")
   elseif(${CMAKE_SYSTEM_NAME} MATCHES Linux)
     set(LINK_FLAGS "-Wl,-unresolved-symbols=ignore-all")
   elseif(${CMAKE_SYSTEM_NAME} MATCHES Windows)
-    set(LINK_FLAGS "/wd4275") 
+    set(LINK_FLAGS "/wd4275")
   else()
     message(FATAL_ERROR "Trying to build module on a not supportd platform. Aborting.")
   endif()
index bfbe431..246b734 100644 (file)
@@ -17,7 +17,9 @@
 \r
 #pragma once\r
 #define WIN32_LEAN_AND_MEAN\r
+#ifndef NOMINMAX\r
 #define NOMINMAX\r
+#endif\r
 #include <fcntl.h>\r
 #include <io.h>\r
 #include <parc/windows/parc_Utils.h>\r
index 55280b4..7076a4c 100644 (file)
@@ -34,7 +34,7 @@ FixedManifestEncoder::FixedManifestEncoder(Packet &packet,
       current_entry_(0),
       signature_size_(signature_size) {
   if (clear) {
-    *manifest_header_ = {0};
+        memset(manifest_header_, 0, sizeof(*manifest_header_));
   }
 }
 
@@ -51,7 +51,7 @@ FixedManifestEncoder &FixedManifestEncoder::clearImpl() {
   packet_.trimEnd(sizeof(ManifestHeader) +
                   manifest_header_->number_of_entries * sizeof(ManifestEntry));
   current_entry_ = 0;
-  *manifest_header_ = {0};
+      memset(manifest_header_, 0, sizeof(*manifest_header_));
   return *this;
 }
 
index b1d2516..cf46672 100644 (file)
 
 cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
 
-if (${CMAKE_SYSTEM_NAME} MATCHES Android)
-  list(APPEND SOURCE_FILES
-    ${CMAKE_CURRENT_SOURCE_DIR}/udp/hicn_forwarder_module.cc
-    ${CMAKE_CURRENT_SOURCE_DIR}/udp/udp_socket_connector.cc
-  )
+if (${CMAKE_SYSTEM_NAME} MATCHES "^(iOS|Android|Windows)$")
 
-  list(APPEND HEADER_FILES
-    ${CMAKE_CURRENT_SOURCE_DIR}/udp/hicn_forwarder_module.h
-    ${CMAKE_CURRENT_SOURCE_DIR}/udp/udp_socket_connector.h
-  )
-
-  set(SOURCE_FILES ${SOURCE_FILES} PARENT_SCOPE)
-  set(HEADER_FILES ${HEADER_FILES} PARENT_SCOPE)
-elseif (WIN32)
   list(APPEND SOURCE_FILES
     ${CMAKE_CURRENT_SOURCE_DIR}/udp/hicn_forwarder_module.cc
     ${CMAKE_CURRENT_SOURCE_DIR}/udp/udp_socket_connector.cc