diff --git a/dom/base/nsContentPolicy.h b/dom/base/nsContentPolicy.h index 729037af0084b..dbb3f11520aab 100644 --- a/dom/base/nsContentPolicy.h +++ b/dom/base/nsContentPolicy.h @@ -35,19 +35,8 @@ class nsContentPolicy : public nsIContentPolicy nsCOMPtr mCSPService; //Helper type for CheckPolicy - typedef - NS_STDCALL_FUNCPROTO(nsresult, CPMethod, nsIContentPolicy, - ShouldProcess, - (uint32_t, nsIURI*, nsIURI*, nsISupports*, - const nsACString &, nsISupports*, nsIPrincipal*, - int16_t*)); - - typedef - NS_STDCALL_FUNCPROTO(nsresult, SCPMethod, nsISimpleContentPolicy, - ShouldProcess, - (uint32_t, nsIURI*, nsIURI*, nsIDOMElement*, bool, - const nsACString &, nsISupports*, nsIPrincipal*, - int16_t*)); + typedef decltype(&nsIContentPolicy::ShouldProcess) CPMethod; + typedef decltype(&nsISimpleContentPolicy::ShouldProcess) SCPMethod; //Helper method that applies policyMethod across all policies in mPolicies // with the given parameters diff --git a/layout/style/nsCSSRules.h b/layout/style/nsCSSRules.h index f800d666c1f23..882dce3abf937 100644 --- a/layout/style/nsCSSRules.h +++ b/layout/style/nsCSSRules.h @@ -567,8 +567,7 @@ class nsCSSCounterStyleRule final : public mozilla::css::Rule, JS::Handle aGivenProto) override; private: - typedef NS_STDCALL_FUNCPROTO(nsresult, Getter, nsCSSCounterStyleRule, - GetSymbols, (nsAString&)); + typedef decltype(&nsCSSCounterStyleRule::GetSymbols) Getter; static const Getter kGetters[]; nsresult GetDescriptor(nsCSSCounterDesc aDescID, nsAString& aValue); diff --git a/rdf/base/nsRDFContentSink.cpp b/rdf/base/nsRDFContentSink.cpp index df52b738c744c..c886d898120da 100644 --- a/rdf/base/nsRDFContentSink.cpp +++ b/rdf/base/nsRDFContentSink.cpp @@ -85,17 +85,8 @@ enum RDFContentSinkParseMode { eRDFContentSinkParseMode_Date }; -typedef -NS_STDCALL_FUNCPROTO(nsresult, - nsContainerTestFn, - nsIRDFContainerUtils, IsAlt, - (nsIRDFDataSource*, nsIRDFResource*, bool*)); - -typedef -NS_STDCALL_FUNCPROTO(nsresult, - nsMakeContainerFn, - nsIRDFContainerUtils, MakeAlt, - (nsIRDFDataSource*, nsIRDFResource*, nsIRDFContainer**)); +typedef decltype(&nsIRDFContainerUtils::IsAlt) nsContainerTestFn; +typedef decltype(&nsIRDFContainerUtils::MakeAlt) nsMakeContainerFn; class RDFContentSinkImpl : public nsIRDFContentSink, public nsIExpatSink diff --git a/toolkit/components/places/nsNavHistoryQuery.cpp b/toolkit/components/places/nsNavHistoryQuery.cpp index 1a7b1c2390e2c..65390121f0108 100644 --- a/toolkit/components/places/nsNavHistoryQuery.cpp +++ b/toolkit/components/places/nsNavHistoryQuery.cpp @@ -56,12 +56,9 @@ static nsresult ParseQueryBooleanString(const nsCString& aString, bool* aValue); // query getters -typedef NS_STDCALL_FUNCPROTO(nsresult, BoolQueryGetter, nsINavHistoryQuery, - GetOnlyBookmarked, (bool*)); -typedef NS_STDCALL_FUNCPROTO(nsresult, Uint32QueryGetter, nsINavHistoryQuery, - GetBeginTimeReference, (uint32_t*)); -typedef NS_STDCALL_FUNCPROTO(nsresult, Int64QueryGetter, nsINavHistoryQuery, - GetBeginTime, (int64_t*)); +typedef decltype(&nsINavHistoryQuery::GetOnlyBookmarked) BoolQueryGetter; +typedef decltype(&nsINavHistoryQuery::GetBeginTimeReference) Uint32QueryGetter; +typedef decltype(&nsINavHistoryQuery::GetBeginTime) Int64QueryGetter; static void AppendBoolKeyValueIfTrue(nsACString& aString, const nsCString& aName, nsINavHistoryQuery* aQuery, @@ -76,12 +73,9 @@ static void AppendInt64KeyValueIfNonzero(nsACString& aString, Int64QueryGetter getter); // query setters -typedef NS_STDCALL_FUNCPROTO(nsresult, BoolQuerySetter, nsINavHistoryQuery, - SetOnlyBookmarked, (bool)); -typedef NS_STDCALL_FUNCPROTO(nsresult, Uint32QuerySetter, nsINavHistoryQuery, - SetBeginTimeReference, (uint32_t)); -typedef NS_STDCALL_FUNCPROTO(nsresult, Int64QuerySetter, nsINavHistoryQuery, - SetBeginTime, (int64_t)); +typedef decltype(&nsINavHistoryQuery::SetOnlyBookmarked) BoolQuerySetter; +typedef decltype(&nsINavHistoryQuery::SetBeginTimeReference) Uint32QuerySetter; +typedef decltype(&nsINavHistoryQuery::SetBeginTime) Int64QuerySetter; static void SetQueryKeyBool(const nsCString& aValue, nsINavHistoryQuery* aQuery, BoolQuerySetter setter); static void SetQueryKeyUint32(const nsCString& aValue, nsINavHistoryQuery* aQuery, @@ -90,15 +84,9 @@ static void SetQueryKeyInt64(const nsCString& aValue, nsINavHistoryQuery* aQuery Int64QuerySetter setter); // options setters -typedef NS_STDCALL_FUNCPROTO(nsresult, BoolOptionsSetter, - nsINavHistoryQueryOptions, - SetExpandQueries, (bool)); -typedef NS_STDCALL_FUNCPROTO(nsresult, Uint32OptionsSetter, - nsINavHistoryQueryOptions, - SetMaxResults, (uint32_t)); -typedef NS_STDCALL_FUNCPROTO(nsresult, Uint16OptionsSetter, - nsINavHistoryQueryOptions, - SetResultType, (uint16_t)); +typedef decltype(&nsINavHistoryQueryOptions::SetExpandQueries) BoolOptionsSetter; +typedef decltype(&nsINavHistoryQueryOptions::SetMaxResults) Uint32OptionsSetter; +typedef decltype(&nsINavHistoryQueryOptions::SetResultType) Uint16OptionsSetter; static void SetOptionsKeyBool(const nsCString& aValue, nsINavHistoryQueryOptions* aOptions, BoolOptionsSetter setter); diff --git a/widget/cocoa/nsMenuItemIconX.mm b/widget/cocoa/nsMenuItemIconX.mm index 261e63b061db0..1970eda9672a8 100644 --- a/widget/cocoa/nsMenuItemIconX.mm +++ b/widget/cocoa/nsMenuItemIconX.mm @@ -50,8 +50,7 @@ static const uint32_t kIconWidth = 16; static const uint32_t kIconHeight = 16; -typedef NS_STDCALL_FUNCPROTO(nsresult, GetRectSideMethod, nsIDOMRect, - GetBottom, (nsIDOMCSSPrimitiveValue**)); +typedef decltype(&nsIDOMRect::GetBottom) GetRectSideMethod; NS_IMPL_ISUPPORTS(nsMenuItemIconX, imgINotificationObserver) diff --git a/xpcom/base/nscore.h b/xpcom/base/nscore.h index f40f0d20b12dc..658c9be16cfb1 100644 --- a/xpcom/base/nscore.h +++ b/xpcom/base/nscore.h @@ -133,33 +133,6 @@ #define NS_IMETHOD NS_IMETHOD_(nsresult) #define NS_IMETHODIMP NS_IMETHODIMP_(nsresult) -/** - * Macro for creating typedefs for pointer-to-member types which are - * declared with stdcall. It is important to use this for any type which is - * declared as stdcall (i.e. NS_IMETHOD). For example, instead of writing: - * - * typedef nsresult (nsIFoo::*someType)(nsISupports* arg); - * - * you should write: - * - * typedef - * NS_STDCALL_FUNCPROTO(nsresult, someType, nsIFoo, typeFunc, (nsISupports*)); - * - * where nsIFoo::typeFunc is any method declared as - * NS_IMETHOD typeFunc(nsISupports*); - * - * XXX this can be simplified to always use the non-typeof implementation - * when http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11893 is fixed. - */ - -#ifdef __GNUC__ -#define NS_STDCALL_FUNCPROTO(ret, name, class, func, args) \ - typeof(&class::func) name -#else -#define NS_STDCALL_FUNCPROTO(ret, name, class, func, args) \ - ret (NS_STDCALL class::*name) args -#endif - /** * Deprecated declarations. */