mosquitto/config.h
Bernd Kuhls 80f3bc4812 _GNU_SOURCE needed for EAI_INPROGRESS
Define of _GNU_SOURCE is needed to be able to use EAI_INPROGRESS in
loop.c.

This patch fixes a build error

loop.c:334:17: error: ‘EAI_INPROGRESS’ undeclared (first use in this function)
        if(rc == EAI_INPROGRESS){

occuring with a glibc-2.27-based buildroot toolchain for sparc64

Target: sparc64-buildroot-linux-gnu
[...]
gcc version 6.4.0 (Buildroot 2018.05)

Source:
http://autobuild.buildroot.org/toolchains/tarballs/br-sparc64-full-2018.05.tar.bz2
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
2018-11-06 23:16:29 +00:00

41 lines
1.0 KiB
C

#ifndef 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
/* ============================================================
* 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)
#endif