Fixes for building on FreeBSD.
This commit is contained in:
parent
e240a692a7
commit
0ec090f31a
@ -39,6 +39,7 @@ Clients:
|
|||||||
|
|
||||||
Build:
|
Build:
|
||||||
- Fixes for building on NetBSD. Closes #258.
|
- Fixes for building on NetBSD. Closes #258.
|
||||||
|
- Fixes for building on FreeBSD.
|
||||||
|
|
||||||
|
|
||||||
1.5 - 20180502
|
1.5 - 20180502
|
||||||
|
8
config.h
8
config.h
@ -29,13 +29,13 @@
|
|||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
# define __DARWIN_C_SOURCE
|
# 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
|
#else
|
||||||
# define _DEFAULT_SOURCE 1
|
# define _DEFAULT_SOURCE 1
|
||||||
# define _POSIX_C_SOURCE 200809L
|
# define _POSIX_C_SOURCE 200809L
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__SYMBIAN32__) || defined(__QNX__)
|
|
||||||
# define HAVE_NETINET_IN_H
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -15,6 +15,7 @@ Contributors:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@ -68,8 +69,6 @@ Contributors:
|
|||||||
#include "time_mosq.h"
|
#include "time_mosq.h"
|
||||||
#include "util_mosq.h"
|
#include "util_mosq.h"
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#ifdef WITH_TLS
|
#ifdef WITH_TLS
|
||||||
int tls_ex_index_mosq = -1;
|
int tls_ex_index_mosq = -1;
|
||||||
#endif
|
#endif
|
||||||
|
@ -17,7 +17,7 @@ Contributors:
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <unistd.h>
|
#include <time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mosquitto_internal.h"
|
#include "mosquitto_internal.h"
|
||||||
@ -80,6 +80,11 @@ void *mosquitto__thread_main(void *obj)
|
|||||||
{
|
{
|
||||||
struct mosquitto *mosq = obj;
|
struct mosquitto *mosq = obj;
|
||||||
int state;
|
int state;
|
||||||
|
#ifndef WIN32
|
||||||
|
struct timespec ts;
|
||||||
|
ts.tv_sec = 0;
|
||||||
|
ts.tv_nsec = 10000000;
|
||||||
|
#endif
|
||||||
|
|
||||||
if(!mosq) return NULL;
|
if(!mosq) return NULL;
|
||||||
|
|
||||||
@ -91,7 +96,7 @@ void *mosquitto__thread_main(void *obj)
|
|||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
Sleep(10);
|
Sleep(10);
|
||||||
#else
|
#else
|
||||||
usleep(10000);
|
nanosleep(&ts, NULL);
|
||||||
#endif
|
#endif
|
||||||
}else{
|
}else{
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user