aboutsummaryrefslogtreecommitdiffstats
path: root/ctrl/libhicnctrl
diff options
context:
space:
mode:
authorAngelo Mantellini <angelo.mantellini@cisco.com>2020-01-30 10:44:19 +0100
committerAngelo Mantellini <angelo.mantellini@cisco.com>2020-02-03 10:18:52 +0000
commit55f2219ab98b039f256671c5e584a61ab52bfed0 (patch)
treed97fbf6a57dfdb4335bba979f27bd18f4999c492 /ctrl/libhicnctrl
parentbe54ac541c9700eaa9085bc8b4ee21b7a5f7e30a (diff)
[HICN-489] Add iOS support to hicn stack
Signed-off-by: Angelo Mantellini <angelo.mantellini@cisco.com> Change-Id: I8fa8c4eaa3218eb4be46f713b15ab789c6930aa0
Diffstat (limited to 'ctrl/libhicnctrl')
-rw-r--r--ctrl/libhicnctrl/CMakeLists.txt2
-rw-r--r--ctrl/libhicnctrl/src/CMakeLists.txt4
-rw-r--r--ctrl/libhicnctrl/src/api.c8
3 files changed, 7 insertions, 7 deletions
diff --git a/ctrl/libhicnctrl/CMakeLists.txt b/ctrl/libhicnctrl/CMakeLists.txt
index ff586ff22..f96bf13a6 100644
--- a/ctrl/libhicnctrl/CMakeLists.txt
+++ b/ctrl/libhicnctrl/CMakeLists.txt
@@ -61,7 +61,7 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
${HICNPLUGIN_INCLUDE_DIRS})
else()
- if (${CMAKE_SYSTEM_NAME} STREQUAL "Android")
+ if (DISABLE_SHARED_LIBRARIES)
set(HICN_LIBRARIES ${LIBHICN_STATIC} log)
list(APPEND DEPENDENCIES
${LIBHICN_STATIC}
diff --git a/ctrl/libhicnctrl/src/CMakeLists.txt b/ctrl/libhicnctrl/src/CMakeLists.txt
index 6f4066238..00661a2a0 100644
--- a/ctrl/libhicnctrl/src/CMakeLists.txt
+++ b/ctrl/libhicnctrl/src/CMakeLists.txt
@@ -54,7 +54,7 @@ set(INCLUDE_DIRS
)
# Android requires static libraries
-if (${CMAKE_SYSTEM_NAME} STREQUAL "Android")
+if (DISABLE_SHARED_LIBRARIES)
set(LIBRARIES ${LIBRARIES} ${LIBHICN_STATIC})
set(LINK_TYPE STATIC)
else ()
@@ -73,7 +73,7 @@ build_library(${LIBHICNCTRL}
DEFINITIONS ${COMPILER_DEFINITIONS}
)
-if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Android" AND NOT COMPILE_FOR_IOS)
+if (NOT DISABLE_EXECUTABLES)
set(LIBRARIES ${LIBRARIES} ${LIBHICN_SHARED} ${LIBHICNCTRL_SHARED})
list(APPEND DAEMON_SRC
diff --git a/ctrl/libhicnctrl/src/api.c b/ctrl/libhicnctrl/src/api.c
index 7e6a80254..8dcb978e0 100644
--- a/ctrl/libhicnctrl/src/api.c
+++ b/ctrl/libhicnctrl/src/api.c
@@ -444,7 +444,7 @@ hc_sock_parse_url(const char * url, struct sockaddr * sa)
#ifdef __linux__
srand(time(NULL) ^ getpid() ^ gettid());
#else
- srand(time(NULL) ^ getpid());
+ srand((unsigned int )(time(NULL) ^ getpid()));
#endif /* __linux__ */
/*
@@ -574,7 +574,7 @@ hc_sock_connect(hc_sock_t * s)
size_t size = ss.ss_family == AF_INET
? sizeof(struct sockaddr_in)
: sizeof(struct sockaddr_in6);
- if (connect(s->fd, (struct sockaddr *)&ss, size) < 0) //sizeof(struct sockaddr)) < 0)
+ if (connect(s->fd, (struct sockaddr *)&ss, (socklen_t)size) < 0) //sizeof(struct sockaddr)) < 0)
goto ERR_CONNECT;
return 0;
@@ -589,7 +589,7 @@ hc_sock_send(hc_sock_t * s, hc_msg_t * msg, size_t msglen, int seq)
{
int rc;
msg->hdr.seqNum = seq;
- rc = send(s->fd, msg, msglen, 0);
+ rc = (int)send(s->fd, msg, msglen, 0);
if (rc < 0) {
perror("hc_sock_send");
return -1;
@@ -617,7 +617,7 @@ hc_sock_recv(hc_sock_t * s)
*/
assert(RECV_BUFLEN - s->woff > MIN_BUFLEN);
- rc = recv(s->fd, s->buf + s->woff, RECV_BUFLEN - s->woff, 0);
+ rc = (int)recv(s->fd, s->buf + s->woff, RECV_BUFLEN - s->woff, 0);
if (rc == 0) {
/* Connection has been closed */
return 0;