summaryrefslogtreecommitdiffstats
path: root/ctrl/libhicnctrl
diff options
context:
space:
mode:
authorJordan Augé <jordan.auge+fdio@cisco.com>2020-02-03 10:38:56 +0000
committerGerrit Code Review <gerrit@fd.io>2020-02-03 10:38:56 +0000
commite90a3ec9cbc98d73dfeb2175ee12edfb56af11ee (patch)
tree77b833e5189847e84933ce3269aaa05ffda24138 /ctrl/libhicnctrl
parentb289a24a07d9fe67e8cd9ea0247987e009df6d50 (diff)
parent55f2219ab98b039f256671c5e584a61ab52bfed0 (diff)
Merge "[HICN-489] Add iOS support to hicn stack"
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 63e27ba42..15425b513 100644
--- a/ctrl/libhicnctrl/CMakeLists.txt
+++ b/ctrl/libhicnctrl/CMakeLists.txt
@@ -63,7 +63,7 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
${SAFE_VAPI_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;