Bug 1407601 Revert to the previous behavior in MozGrMalloc.h for Linux, and add extern C to correct Solaris build break r=baku

MozReview-Commit-ID: GP6N6pcqQp

--HG--
extra : rebase_source : a51cbdffcb05631876d458f7a19b295fc0bb4642
This commit is contained in:
Tom Ritter 2017-10-11 10:16:32 -05:00
Родитель 6bf7c6882a
Коммит fc2f75822a
1 изменённых файлов: 17 добавлений и 3 удалений

Просмотреть файл

@ -12,19 +12,33 @@
#include "mozilla/mozalloc.h"
inline void* malloc(size_t size)
#if defined(XP_LINUX)
#define malloc moz_xmalloc
#define calloc moz_xcalloc
#define realloc moz_xrealloc
#else
// extern "C" is needed for the Solaris build, while the inline
// functions are needed for the MinGW build. They break gcc 5.4.0
// on Linux however, so keep the old #define's above for Linux
extern "C" inline void* malloc(size_t size)
{
return moz_xmalloc(size);
}
inline void* calloc(size_t nmemb, size_t size)
extern "C" inline void* calloc(size_t nmemb, size_t size)
{
return moz_xcalloc(nmemb, size);
}
inline void* realloc(void *ptr, size_t size)
extern "C" inline void* realloc(void *ptr, size_t size)
{
return moz_xrealloc(ptr, size);
}
#endif // defined(XP_LINUX)
#endif // MOZ_GR_MALLOC_H