From 1fec50120fb4b08ea76cc79cf65905a0d5027e84 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Wed, 29 Nov 2023 12:23:46 +1100 Subject: [PATCH] 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. --- sql/sql_test.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sql/sql_test.cc b/sql/sql_test.cc index 5ea132c83d4..1470965eefe 100644 --- a/sql/sql_test.cc +++ b/sql/sql_test.cc @@ -27,11 +27,13 @@ #include "my_json_writer.h" #include #include -#if defined(HAVE_MALLINFO) && defined(HAVE_MALLOC_H) +#if defined(HAVE_MALLINFO) || defined(HAVE_MALLINFO2) +#if defined(HAVE_MALLOC_H) #include -#elif defined(HAVE_MALLINFO) && defined(HAVE_SYS_MALLOC_H) +#elif defined(HAVE_SYS_MALLOC_H) #include #endif +#endif #ifdef HAVE_EVENT_SCHEDULER #include "events.h"