Created attachment 524963 [details] [diff] [review] Change the calling convention CanvasStyleSetterType and CanvasStyleSetterType are declared with NS_STDCALL but are used with methods declared with NS_DEFCALL. Clang complains with: In file included from dom_quickstubs.cpp:241:../../../../dist/include/CustomQS_Canvas2D.h:139:12: error: no matching function for call to 'Canvas2D_SetStyleHelper' return Canvas2D_SetStyleHelper(cx, obj, id, vp, &nsIDOMCanvasRenderingContext2D::SetStrokeStyle_multi); ^~~~~~~~~~~~~~~~~~~~~~~ ../../../../dist/include/CustomQS_Canvas2D.h:51:1: note: candidate function not viable: no known conversion from 'nsresult (nsIDOMCanvasRenderingContext2D::*)(const nsAString_internal &, nsISupports *) __attr ibute__((cdecl))' to 'CanvasStyleSetterType' (aka 'nsresult (nsIDOMCanvasRenderingContext2D::*)(const nsAString_internal &, nsISupports *)') for 5th argument Canvas2D_SetStyleHelper(JSContext *cx, JSObject *obj, jsid id, jsval *vp, ^
Created attachment 524965 [details] [diff] [review] Change the calling convention
Uh... nsCanvasRenderingContext2D::SetStrokeStyle_multi is stdcall, no? At least in all situations in which the typedef is stdcall. Or put another way, does your patch compile on Windows?
Oh, I see what's going on here. SetStrokeStyle_multi is defined as NS_IMETHOD, which means one of the following things: __stdcall (on Windows) nothing special (on OS/2) NS_DEFCALL (elsewhere) When __GNUC__ is defined on i386, NS_DEFCALL expands to: __attribute__ ((regparm (0), cdecl)) and otherwise it means nothing special. The typedef is using NS_STDCALL, which means the following: __stdcall on windows nothing special elsewhere So the current code is correct on Windows (and your new code is wrong there), but broken on a compiler that defines __GNUC__. The right thing to do here seems to be to use the NS_STDCALL_FUNCPROTO macros to define the typedefs, right? At least assuming the __GNUC__ bit of those works in clang.
Also, you should be requesting review from specific people if you want the review request to be seen. :(
Created attachment 524970 [details] [diff] [review] NS_STDCALL_FUNCPROTO
7 years ago
Comment on attachment 524970 [details] [diff] [review] NS_STDCALL_FUNCPROTO r=me. Sorry for the lag here...
6 years ago
Rafael, could you please prepare patches as described on <https://developer.mozilla.org/en/Mercurial_FAQ#How_can_I_generate_a_patch_for_somebody_else_to_check-in_for_me.3f>? That would make it much easier to push them.
Created attachment 525999 [details] [diff] [review] hg generated patch