Bug 662224 - Define NS_ATTR_MALLOC and NS_WARN_UNUSED_RESULT in xpcom-config.h, and include it from mozalloc.h. r=bsmedberg
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 07 Jun 2011 03:09:46 +0200
changeset 71422 d959aeca8307517e81edca5cba749dfb12b27214
parent 71421 7360bb236cc10f568255dd9a4344686bc40b1c4e
child 71423 52d981b8e75d8c87e9fa144079b02e4d6332c883
push id159
push usereakhgari@mozilla.com
push dateTue, 16 Aug 2011 17:53:11 +0000
treeherdermozilla-esr52@cba007ad1747 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs662224
milestone7.0a1
Bug 662224 - Define NS_ATTR_MALLOC and NS_WARN_UNUSED_RESULT in xpcom-config.h, and include it from mozalloc.h. r=bsmedberg
memory/mozalloc/Makefile.in
memory/mozalloc/mozalloc.h
xpcom/xpcom-config.h.in
--- a/memory/mozalloc/Makefile.in
+++ b/memory/mozalloc/Makefile.in
@@ -109,9 +109,11 @@ endif #}
 endif #}
 
 ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
 SDK_LIBRARY = $(IMPORT_LIBRARY)
 else
 SDK_LIBRARY = $(SHARED_LIBRARY)
 endif
 
+LOCAL_INCLUDES += -I$(DEPTH)/xpcom
+
 include $(topsrcdir)/config/rules.mk
--- a/memory/mozalloc/mozalloc.h
+++ b/memory/mozalloc/mozalloc.h
@@ -45,17 +45,17 @@
  * https://bugzilla.mozilla.org/show_bug.cgi?id=427099
  */
 
 #include <stdlib.h>
 #include <string.h>
 #if defined(__cplusplus)
 #  include <new>
 #endif
-
+#include "xpcom-config.h"
 
 #define MOZALLOC_HAVE_XMALLOC
 
 #if defined(MOZALLOC_EXPORT)
 /* do nothing: it's been defined to __declspec(dllexport) by
  * mozalloc*.cpp on platforms where that's required. */
 #elif defined(XP_WIN) || (defined(XP_OS2) && defined(__declspec))
 #  define MOZALLOC_EXPORT __declspec(dllimport)
--- a/xpcom/xpcom-config.h.in
+++ b/xpcom/xpcom-config.h.in
@@ -60,9 +60,15 @@
 /* Define if the c++ compiler requires implementations of 
  * unused virtual methods
  */
 #undef NEED_CPP_UNUSED_IMPLEMENTATIONS
 
 /* Define to either <new> or <new.h> */
 #undef NEW_H
 
+/* Define to either __attribute__((malloc)) or nothing */
+#undef NS_ATTR_MALLOC
+
+/* Define to either __attribute__((warn_unused_result)) or nothing */
+#undef NS_WARN_UNUSED_RESULT
+
 #endif /* _XPCOM_CONFIG_H_ */