From 418184ca8e35d6ced451d97fdcdda5b42ad14194 Mon Sep 17 00:00:00 2001 From: Julian Büning Date: Sat, 16 Jun 2018 17:05:24 +0200 Subject: CMake: check for ctype and mallinfo functions with CXX instead of C compiler --- lib/Support/MemoryUsage.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/Support') diff --git a/lib/Support/MemoryUsage.cpp b/lib/Support/MemoryUsage.cpp index f1757ad3..2f62dc80 100644 --- a/lib/Support/MemoryUsage.cpp +++ b/lib/Support/MemoryUsage.cpp @@ -18,7 +18,7 @@ #ifdef HAVE_MALLINFO #include #endif -#ifdef HAVE_MALLOC_MALLOC_H +#ifdef HAVE_MALLOC_ZONE_STATISTICS #include #endif @@ -95,7 +95,7 @@ size_t util::GetTotalMallocUsage() { MallocExtension::instance()->GetNumericProperty( "generic.current_allocated_bytes", &value); return value; -#elif HAVE_MALLINFO +#elif defined(HAVE_MALLINFO) struct mallinfo mi = ::mallinfo(); // The malloc implementation in glibc (pmalloc2) // does not include mmap()'ed memory in mi.uordblks @@ -106,7 +106,7 @@ size_t util::GetTotalMallocUsage() { return (unsigned)mi.uordblks; #endif -#elif defined(HAVE_MALLOC_ZONE_STATISTICS) && defined(HAVE_MALLOC_MALLOC_H) +#elif defined(HAVE_MALLOC_ZONE_STATISTICS) // Support memory usage on Darwin. malloc_statistics_t Stats; -- cgit 1.4.1