summaryrefslogtreecommitdiff
path: root/libs/libmosquitto/include/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/libmosquitto/include/config.h')
-rw-r--r--libs/libmosquitto/include/config.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/libs/libmosquitto/include/config.h b/libs/libmosquitto/include/config.h
new file mode 100644
index 0000000000..f717d00c8a
--- /dev/null
+++ b/libs/libmosquitto/include/config.h
@@ -0,0 +1,69 @@
+#ifndef CONFIG_H
+#define CONFIG_H
+/* ============================================================
+ * Platform options
+ * ============================================================ */
+
+#ifdef __APPLE__
+# define __DARWIN_C_SOURCE
+#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__SYMBIAN32__) || defined(__QNX__)
+# define _XOPEN_SOURCE 700
+# define __BSD_VISIBLE 1
+# define HAVE_NETINET_IN_H
+#else
+# define _XOPEN_SOURCE 700
+# define _DEFAULT_SOURCE 1
+# define _POSIX_C_SOURCE 200809L
+#endif
+
+#define _GNU_SOURCE
+
+#define OPENSSL_LOAD_CONF
+
+/* ============================================================
+ * Compatibility defines
+ * ============================================================ */
+#if defined(_MSC_VER) && _MSC_VER < 1900
+# define snprintf sprintf_s
+# define EPROTO ECONNABORTED
+#endif
+
+#ifdef WIN32
+# ifndef strcasecmp
+# define strcasecmp strcmpi
+# endif
+# define strtok_r strtok_s
+# define strerror_r(e, b, l) strerror_s(b, l, e)
+#endif
+
+
+#define uthash_malloc(sz) mosquitto__malloc(sz)
+#define uthash_free(ptr,sz) mosquitto__free(ptr)
+
+
+#ifdef WITH_TLS
+# include <openssl/opensslconf.h>
+# if defined(WITH_TLS_PSK) && !defined(OPENSSL_NO_PSK)
+# define FINAL_WITH_TLS_PSK
+# endif
+#endif
+
+
+#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
+
+#define UNUSED(A) (void)(A)
+
+/* Android Bionic libpthread implementation doesn't have pthread_cancel */
+#ifndef ANDROID
+# define HAVE_PTHREAD_CANCEL
+#endif
+
+#endif