mirror of https://github.com/eclipse/paho.mqtt.c
Add QNX support by including necessary header for threads and endian functions.
Signed-off-by: Erlend Ese <erlendese@gmail.com>
This commit is contained in:
parent
9ef8f4d865
commit
2d15027863
|
|
@ -80,6 +80,7 @@ elseif(UNIX)
|
||||||
set(LIBS_SYSTEM compat pthread)
|
set(LIBS_SYSTEM compat pthread)
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "QNX")
|
elseif(CMAKE_SYSTEM_NAME MATCHES "QNX")
|
||||||
set(LIBS_SYSTEM c)
|
set(LIBS_SYSTEM c)
|
||||||
|
add_definitions(-D_QNX_SOURCE -DGULLIVER)
|
||||||
else()
|
else()
|
||||||
set(LIBS_SYSTEM c pthread)
|
set(LIBS_SYSTEM c pthread)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,15 @@
|
||||||
#include "LinkedList.h"
|
#include "LinkedList.h"
|
||||||
#include "Clients.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);
|
typedef void* (*pf)(int, unsigned char, char*, size_t);
|
||||||
|
|
||||||
#include "MQTTProperties.h"
|
#include "MQTTProperties.h"
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,13 @@
|
||||||
|
|
||||||
#include "SHA1.h"
|
#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(OPENSSL)
|
||||||
#if defined(_WIN32) || defined(_WIN64)
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
#pragma comment(lib, "crypt32.lib")
|
#pragma comment(lib, "crypt32.lib")
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,10 @@
|
||||||
#undef ETIMEDOUT
|
#undef ETIMEDOUT
|
||||||
#define ETIMEDOUT WSAETIMEDOUT
|
#define ETIMEDOUT WSAETIMEDOUT
|
||||||
#else
|
#else
|
||||||
|
#if defined(QNX_OS)
|
||||||
|
#include <sys/neutrino.h>
|
||||||
|
#include <process.h>
|
||||||
|
#endif
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
#define thread_type pthread_t
|
#define thread_type pthread_t
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue