Skip to content

Add support for QNX8 #1602

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ elseif(UNIX)
set(LIBS_SYSTEM compat pthread)
elseif(CMAKE_SYSTEM_NAME MATCHES "QNX")
set(LIBS_SYSTEM c)
add_definitions(-D_QNX_SOURCE -DGULLIVER)
else()
set(LIBS_SYSTEM c pthread)
endif()
Expand Down
10 changes: 9 additions & 1 deletion src/MQTTPacket.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@
#include "LinkedList.h"
#include "Clients.h"

typedef unsigned int bool;
#ifdef __cplusplus
#include <stdbool.h>
#else
#ifndef __bool_true_false_are_defined
#ifndef bool
typedef unsigned int bool;
#endif
#endif
#endif
typedef void* (*pf)(int, unsigned char, char*, size_t);

#include "MQTTProperties.h"
Expand Down
7 changes: 7 additions & 0 deletions src/SHA1.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@

#include "SHA1.h"

// In the source files using endian functions (like SHA1.c):
#ifdef QNX_OS
#include <gulliver.h>
#define be32toh(x) ENDIAN_BE32(x)
#define htobe32(x) ENDIAN_BE32(x)
#endif

#if !defined(OPENSSL)
#if defined(_WIN32) || defined(_WIN64)
#pragma comment(lib, "crypt32.lib")
Expand Down
4 changes: 4 additions & 0 deletions src/Thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
#undef ETIMEDOUT
#define ETIMEDOUT WSAETIMEDOUT
#else
#if defined(QNX_OS)
#include <sys/neutrino.h>
#include <process.h>
#endif
#include <pthread.h>

#define thread_type pthread_t
Expand Down