Bug 682066 - Drop NS_DEFCALL. r=benjamin.
authorRafael Ávila de Espíndola <respindola@mozilla.com>
Tue, 30 Aug 2011 14:22:00 -0400
changeset 76223 7fa469f47cbbaf2d3da4a6a382cbf644733ac41c
parent 76222 21a91ca8622754ae97ebe9660a7df836df186d74
child 76224 4d07f8ccbbaf941d9506bcf092ebcee978f1c594
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersbenjamin
bugs682066
milestone9.0a1
Bug 682066 - Drop NS_DEFCALL. r=benjamin. Having NS_DEFCALL around causes problems for clang since it uses the regpart attribute when deciding template instantiations. In particular, it would not use the generic method specialization of nsRunnableMethodTraits.
xpcom/base/nscore.h
--- a/xpcom/base/nscore.h
+++ b/xpcom/base/nscore.h
@@ -159,27 +159,16 @@
 #elif defined(XP_WIN) && !defined(_WIN64)
 #define NS_FASTCALL __fastcall
 #define NS_CONSTRUCTOR_FASTCALL
 #else
 #define NS_FASTCALL
 #define NS_CONSTRUCTOR_FASTCALL
 #endif
 
-/*
- * NS_DEFCALL undoes the effect of a global regparm/stdcall setting
- * so that xptcall works correctly.
- */
-#if defined(__i386__) && defined(__GNUC__) && \
-    (__GNUC__ >= 3) && !defined(XP_OS2)
-#define NS_DEFCALL __attribute__ ((regparm (0), cdecl))
-#else
-#define NS_DEFCALL
-#endif
-
 #ifdef NS_WIN32
 
 #define NS_IMPORT __declspec(dllimport)
 #define NS_IMPORT_(type) __declspec(dllimport) type __stdcall
 #define NS_EXPORT __declspec(dllexport)
 #define NS_EXPORT_(type) __declspec(dllexport) type __stdcall
 #define NS_IMETHOD_(type) virtual type __stdcall
 #define NS_IMETHODIMP_(type) type __stdcall
@@ -212,17 +201,17 @@
 #define NS_IMPORT_STATIC_MEMBER_(type) NS_EXTERNAL_VIS_(type)
 
 #else
 
 #define NS_IMPORT NS_EXTERNAL_VIS
 #define NS_IMPORT_(type) NS_EXTERNAL_VIS_(type)
 #define NS_EXPORT NS_EXTERNAL_VIS
 #define NS_EXPORT_(type) NS_EXTERNAL_VIS_(type)
-#define NS_IMETHOD_(type) virtual IMETHOD_VISIBILITY type NS_DEFCALL
+#define NS_IMETHOD_(type) virtual IMETHOD_VISIBILITY type
 #define NS_IMETHODIMP_(type) type
 #define NS_METHOD_(type) type
 #define NS_CALLBACK_(_type, _name) _type (* _name)
 #define NS_STDCALL
 #define NS_FROZENCALL
 #define NS_EXPORT_STATIC_MEMBER_(type) NS_EXTERNAL_VIS_(type)
 #define NS_IMPORT_STATIC_MEMBER_(type) NS_EXTERNAL_VIS_(type)