From 4092a75d850ab5f9ec4bc8941f6d5c28f44422e7 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 2 Dec 2019 09:13:23 +0100 Subject: [PATCH] Avoid collision with MacOS LIST_HEAD macro after #6384. --- src/zmalloc.c | 8 ++++++++ src/zmalloc.h | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/zmalloc.c b/src/zmalloc.c index ec7fcc03..639a5fe2 100644 --- a/src/zmalloc.c +++ b/src/zmalloc.c @@ -388,6 +388,14 @@ int jemalloc_purge() { #endif +#if defined(__APPLE__) +/* For proc_pidinfo() used later in zmalloc_get_smap_bytes_by_field(). + * Note that this file cannot be included in zmalloc.h because it includes + * a Darwin queue.h file where there is a "LIST_HEAD" macro (!) defined + * conficting with Redis user code. */ +#include +#endif + /* Get the sum of the specified field (converted form kb to bytes) in * /proc/self/smaps. The field must be specified with trailing ":" as it * apperas in the smaps output. diff --git a/src/zmalloc.h b/src/zmalloc.h index d32698e6..b136a910 100644 --- a/src/zmalloc.h +++ b/src/zmalloc.h @@ -57,7 +57,6 @@ #elif defined(__APPLE__) #include -#include #define HAVE_MALLOC_SIZE 1 #define zmalloc_size(p) malloc_size(p) #endif