Skip to content

Commit

Permalink
Fix memory tracking not being available on FreeBSD or macOS.
Browse files Browse the repository at this point in the history
Closes #2096. Thanks to blusewang.
  • Loading branch information
ralight committed Feb 25, 2021
1 parent 12ff9d5 commit 2190e98
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog.txt
Expand Up @@ -7,6 +7,7 @@ Broker:
plugin should not be accessing them.
- Give compile time warning if libwebsockets compiled without external poll
support. Closes #2060.
- Fix memory tracking not being available on FreeBSD or macOS. Closes #2096.

Client library:
- Fix mosquitto_{pub|sub}_topic_check() functions not returning MOSQ_ERR_INVAL
Expand Down
6 changes: 4 additions & 2 deletions lib/memory_mosq.h
Expand Up @@ -22,8 +22,10 @@ SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#include <stdio.h>
#include <sys/types.h>

#if defined(WITH_MEMORY_TRACKING) && defined(WITH_BROKER) && defined(__GLIBC__)
#define REAL_WITH_MEMORY_TRACKING
#if defined(WITH_MEMORY_TRACKING) && defined(WITH_BROKER)
# if defined(__APPLE__) || defined(__FreeBSD__) || defined(__GLIBC__)
# define REAL_WITH_MEMORY_TRACKING
# endif
#endif

void *mosquitto__calloc(size_t nmemb, size_t size);
Expand Down

0 comments on commit 2190e98

Please sign in to comment.