Commit 1fec5012 authored by Daniel Black's avatar Daniel Black

mallinfo2: include malloc header even if mallinfo undetected

It may be the case that for some reason, -Werror deprecated
for instance, that mallinfo isn't detected. In this case the
malloc.h headers won't be included which defined the mallinfo2
function and its structure.

Re-organise so that either function pulls in the header.
parent 705f7ab6
......@@ -27,11 +27,13 @@
#include "my_json_writer.h"
#include <hash.h>
#include <thr_alarm.h>
#if defined(HAVE_MALLINFO) && defined(HAVE_MALLOC_H)
#if defined(HAVE_MALLINFO) || defined(HAVE_MALLINFO2)
#if defined(HAVE_MALLOC_H)
#include <malloc.h>
#elif defined(HAVE_MALLINFO) && defined(HAVE_SYS_MALLOC_H)
#elif defined(HAVE_SYS_MALLOC_H)
#include <sys/malloc.h>
#endif
#endif
#ifdef HAVE_EVENT_SCHEDULER
#include "events.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment