2018-05-02 08:39:36 +00:00
|
|
|
#ifndef CONFIG_H
|
2019-06-04 08:02:58 +00:00
|
|
|
#define CONFIG_H
|
2014-05-07 22:27:00 +00:00
|
|
|
/* ============================================================
|
2018-09-20 15:12:00 +00:00
|
|
|
* Platform options
|
|
|
|
* ============================================================ */
|
|
|
|
|
|
|
|
#ifdef __APPLE__
|
|
|
|
# define __DARWIN_C_SOURCE
|
2020-10-30 14:34:32 +00:00
|
|
|
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__SYMBIAN32__)
|
2018-09-20 15:12:00 +00:00
|
|
|
# define _XOPEN_SOURCE 700
|
|
|
|
# define __BSD_VISIBLE 1
|
|
|
|
# define HAVE_NETINET_IN_H
|
2020-10-30 14:34:32 +00:00
|
|
|
#elif defined(__QNX__)
|
|
|
|
# define _XOPEN_SOURCE 600
|
|
|
|
# define __BSD_VISIBLE 1
|
|
|
|
# define HAVE_NETINET_IN_H
|
2018-09-20 15:12:00 +00:00
|
|
|
#else
|
|
|
|
# define _XOPEN_SOURCE 700
|
|
|
|
# define _DEFAULT_SOURCE 1
|
|
|
|
# define _POSIX_C_SOURCE 200809L
|
|
|
|
#endif
|
2014-05-07 22:27:00 +00:00
|
|
|
|
2019-07-25 20:08:00 +00:00
|
|
|
|
|
|
|
#ifndef _GNU_SOURCE
|
|
|
|
# define _GNU_SOURCE
|
|
|
|
#endif
|
2014-05-07 22:27:00 +00:00
|
|
|
|
2019-02-26 17:11:29 +00:00
|
|
|
#define OPENSSL_LOAD_CONF
|
|
|
|
|
2014-05-07 22:27:00 +00:00
|
|
|
/* ============================================================
|
|
|
|
* Compatibility defines
|
|
|
|
* ============================================================ */
|
2016-03-17 21:24:50 +00:00
|
|
|
#if defined(_MSC_VER) && _MSC_VER < 1900
|
|
|
|
# define snprintf sprintf_s
|
2017-02-20 21:20:00 +00:00
|
|
|
# define EPROTO ECONNABORTED
|
2016-03-17 21:24:50 +00:00
|
|
|
#endif
|
|
|
|
|
2014-05-07 22:27:00 +00:00
|
|
|
#ifdef WIN32
|
2014-10-26 21:17:08 +00:00
|
|
|
# ifndef strcasecmp
|
|
|
|
# define strcasecmp strcmpi
|
|
|
|
# endif
|
2018-08-16 10:16:16 +00:00
|
|
|
# define strtok_r strtok_s
|
|
|
|
# define strerror_r(e, b, l) strerror_s(b, l, e)
|
2014-05-07 22:27:00 +00:00
|
|
|
#endif
|
2014-09-17 21:58:46 +00:00
|
|
|
|
|
|
|
|
2020-09-23 15:13:29 +00:00
|
|
|
#define uthash_malloc(sz) mosquitto_malloc(sz)
|
|
|
|
#define uthash_free(ptr,sz) mosquitto_free(ptr)
|
2014-09-17 21:58:46 +00:00
|
|
|
|
2018-12-09 13:40:38 +00:00
|
|
|
|
|
|
|
#ifdef WITH_TLS
|
|
|
|
# include <openssl/opensslconf.h>
|
|
|
|
# if defined(WITH_TLS_PSK) && !defined(OPENSSL_NO_PSK)
|
|
|
|
# define FINAL_WITH_TLS_PSK
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2019-02-27 10:53:36 +00:00
|
|
|
|
|
|
|
#ifdef __COVERITY__
|
|
|
|
# include <stdint.h>
|
|
|
|
/* These are "wrong", but we don't use them so it doesn't matter */
|
|
|
|
# define _Float32 uint32_t
|
|
|
|
# define _Float32x uint32_t
|
|
|
|
# define _Float64 uint64_t
|
|
|
|
# define _Float64x uint64_t
|
|
|
|
# define _Float128 uint64_t
|
|
|
|
#endif
|
|
|
|
|
2019-03-13 14:11:50 +00:00
|
|
|
#define UNUSED(A) (void)(A)
|
|
|
|
|
2019-06-06 13:04:14 +00:00
|
|
|
/* Android Bionic libpthread implementation doesn't have pthread_cancel */
|
|
|
|
#ifndef ANDROID
|
|
|
|
# define HAVE_PTHREAD_CANCEL
|
|
|
|
#endif
|
|
|
|
|
2020-11-25 16:57:33 +00:00
|
|
|
#ifdef WITH_CJSON
|
|
|
|
# include <cJSON.h>
|
|
|
|
# define CJSON_VERSION_FULL (CJSON_VERSION_MAJOR*1000000+CJSON_VERSION_MINOR*1000+CJSON_VERSION_PATCH)
|
|
|
|
#endif
|
|
|
|
|
2018-05-02 08:39:36 +00:00
|
|
|
#endif
|