Commit be6a9b57 authored by hans@chromium.org's avatar hans@chromium.org

It is important that 'struct mallinfo' is defined in the header file.

Otherwise, Clang will warn about the declaration of 'tc_mallinfo' because it has C-linkage, but has an incomplete return type.

This was sent upstream in http://code.google.com/p/gperftools/issues/detail?id=450

BUG=138571
TEST=it builds without warning


Review URL: https://chromiumcodereview.appspot.com/10818025

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148386 0039d316-1c4b-4281-b951-d872f2087c98
parent b36e6617
...@@ -53,7 +53,17 @@ ...@@ -53,7 +53,17 @@
#define TC_VERSION_PATCH "" #define TC_VERSION_PATCH ""
#define TC_VERSION_STRING "gperftools 2.0" #define TC_VERSION_STRING "gperftools 2.0"
#include <stdlib.h> // for struct mallinfo, if it's defined // For struct mallinfo, it it's defined.
#ifdef HAVE_STRUCT_MALLINFO
// Malloc can be in several places on older versions of OS X.
# if defined(HAVE_MALLOC_H)
# include <malloc.h>
# elif defined(HAVE_SYS_MALLOC_H)
# include <sys/malloc.h>
# elif defined(HAVE_MALLOC_MALLOC_H)
# include <malloc/malloc.h>
# endif
#endif
// Annoying stuff for windows -- makes sure clients can import these functions // Annoying stuff for windows -- makes sure clients can import these functions
#ifndef PERFTOOLS_DLL_DECL #ifndef PERFTOOLS_DLL_DECL
......
...@@ -131,18 +131,6 @@ ...@@ -131,18 +131,6 @@
#include "tcmalloc_guard.h" // for TCMallocGuard #include "tcmalloc_guard.h" // for TCMallocGuard
#include "thread_cache.h" // for ThreadCache #include "thread_cache.h" // for ThreadCache
// We only need malloc.h for struct mallinfo.
#ifdef HAVE_STRUCT_MALLINFO
// Malloc can be in several places on older versions of OS X.
# if defined(HAVE_MALLOC_H)
# include <malloc.h>
# elif defined(HAVE_SYS_MALLOC_H)
# include <sys/malloc.h>
# elif defined(HAVE_MALLOC_MALLOC_H)
# include <malloc/malloc.h>
# endif
#endif
#if (defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)) && !defined(WIN32_OVERRIDE_ALLOCATORS) #if (defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)) && !defined(WIN32_OVERRIDE_ALLOCATORS)
# define WIN32_DO_PATCHING 1 # define WIN32_DO_PATCHING 1
#endif #endif
......
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