From 95d26bb0e658614f6770f9510815c49c37c0b3c2 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Wed, 2 May 2018 11:50:47 +0100 Subject: [PATCH] Fix build warnings on Mac. --- config.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/config.h b/config.h index 99915f4b..906fad48 100644 --- a/config.h +++ b/config.h @@ -9,8 +9,6 @@ /* ============================================================ * Compatibility defines - * - * Generally for Windows native support. * ============================================================ */ #if defined(_MSC_VER) && _MSC_VER < 1900 # define snprintf sprintf_s @@ -29,7 +27,11 @@ #define uthash_malloc(sz) mosquitto__malloc(sz) #define uthash_free(ptr,sz) mosquitto__free(ptr) -#define _DEFAULT_SOURCE 1 -#define _POSIX_C_SOURCE 200809L +#ifdef __APPLE__ +# define __DARWIN_C_SOURCE +#else +# define _DEFAULT_SOURCE 1 +# define _POSIX_C_SOURCE 200809L +#endif #endif