diff --git a/config.h b/config.h index ecb4ed4f..99915f4b 100644 --- a/config.h +++ b/config.h @@ -1,3 +1,4 @@ +#ifndef CONFIG_H /* ============================================================ * Control compile time options. * ============================================================ @@ -28,5 +29,7 @@ #define uthash_malloc(sz) mosquitto__malloc(sz) #define uthash_free(ptr,sz) mosquitto__free(ptr) -#define _BSD_SOURCE +#define _DEFAULT_SOURCE 1 #define _POSIX_C_SOURCE 200809L + +#endif diff --git a/src/Makefile b/src/Makefile index ee79bd39..227f6623 100644 --- a/src/Makefile +++ b/src/Makefile @@ -200,7 +200,7 @@ mosquitto_passwd : mosquitto_passwd.o ${CROSS_COMPILE}${CC} $^ -o $@ ${LDFLAGS} $(PASSWD_LIBS) mosquitto_passwd.o : mosquitto_passwd.c - ${CROSS_COMPILE}${CC} $(CFLAGS) ${CPPFLAGS} -c $< -o $@ + ${CROSS_COMPILE}${CC} -I.. $(CFLAGS) ${CPPFLAGS} -c $< -o $@ plugin_defer.so : plugin_defer.c mosquitto_plugin.h mosquitto_broker.h mosquitto_broker_internal.h ${CROSS_COMPILE}${CC} -I. -I../lib -fPIC -shared $< -o $@ diff --git a/src/mosquitto.c b/src/mosquitto.c index 590a3cb8..1829c5e8 100644 --- a/src/mosquitto.c +++ b/src/mosquitto.c @@ -18,7 +18,6 @@ Contributors: #ifndef WIN32 /* For initgroups() */ -# define _DEFAULT_SOURCE # include # include # include diff --git a/src/mosquitto_passwd.c b/src/mosquitto_passwd.c index 8cad3b12..1b479a4f 100644 --- a/src/mosquitto_passwd.c +++ b/src/mosquitto_passwd.c @@ -14,8 +14,7 @@ Contributors: Roger Light - initial implementation and documentation. */ -#define _POSIX_C_SOURCE 200809L -#define _DEFAULT_SOURCE +#include "config.h" #include #include