Skip to content

Commit

Permalink
QNX: Add in build support
Browse files Browse the repository at this point in the history
Support compiling QNX 7 SDK.
  • Loading branch information
mrdeep1 committed Mar 6, 2024
1 parent 1039f05 commit db6409b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ check_function_exists(if_nametoindex HAVE_IF_NAMETOINDEX)
if(WIN32 AND NOT MINGW)
set(HAVE_STRUCT_CMSGHDR 1)
message(STATUS "setting HAVE_STRUCT_CMSGHDR")
elseif(${CMAKE_SYSTEM_NAME} STREQUAL QNX)
set(HAVE_STRUCT_CMSGHDR 0)
else()
check_symbol_exists(
CMSG_FIRSTHDR
Expand Down
5 changes: 5 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,11 @@ case $host in
LIBS="${LIBS} -lws2_32"
;;

*-qnx*)
AC_MSG_RESULT([QNX])
ADDITIONAL_CFLAGS="-D_QNX_SOURCE"
;;

*xtensa-esp32-elf*)
AC_MSG_RESULT([XtensaEsp32Elf])
ADDITIONAL_CFLAGS="-D_GNU_SOURCE -DWITH_POSIX"
Expand Down
2 changes: 1 addition & 1 deletion src/coap_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ static __declspec(thread) LPFN_WSARECVMSG lpWSARecvMsg = NULL;
#define iov_len_t size_t
#endif

#if defined(_CYGWIN_ENV)
#if defined(_CYGWIN_ENV) || defined(__QNXNTO__)
#define ipi_spec_dst ipi_addr
#endif

Expand Down
1 change: 1 addition & 0 deletions src/coap_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -4333,6 +4333,7 @@ coap_join_mcast_group_intf(coap_context_t *ctx, const char *group_name,
"cannot get interface index for '%s'\n",
ifname);
}
#elif defined(__QNXNTO__)
#else /* !HAVE_IF_NAMETOINDEX */
result = ioctl(ctx->endpoint->sock.fd, SIOCGIFINDEX, &ifr);
if (result != 0) {
Expand Down

0 comments on commit db6409b

Please sign in to comment.