[tor-commits] [tor-browser/tor-browser-52.7.3esr-8.0-1] Bug 1407601 Revert to the previous behavior in MozGrMalloc.h for Linux, and add extern C to correct Solaris build break r=baku

gk at torproject.org gk at torproject.org
Wed Apr 11 08:29:59 UTC 2018


commit 645b11df3349f9045779d1d6c82d6c3722b6b2b2
Author: Tom Ritter <tom at mozilla.com>
Date:   Wed Oct 11 10:16:32 2017 -0500

    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
---
 gfx/graphite2/src/MozGrMalloc.h | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/gfx/graphite2/src/MozGrMalloc.h b/gfx/graphite2/src/MozGrMalloc.h
index 0a853ab5d322..5d6a9f3910a9 100644
--- a/gfx/graphite2/src/MozGrMalloc.h
+++ b/gfx/graphite2/src/MozGrMalloc.h
@@ -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



More information about the tor-commits mailing list