JsAccount broken by switch to clang-cl

RESOLVED FIXED in Thunderbird 64.0


9 months ago
9 months ago


(Reporter: neil, Assigned: neil)


Thunderbird 64.0
Windows 10
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)



(1 attachment)

At the time, JsAccount had to use the nonstandard __FUNCTION__ predefined macro as part of its mechanism to know which functions were being overridden. In particular, the macro has a different value in Visual Studio than in gcc or clang, but JsAccount had an #ifdef to accommodate for the difference.

Unfortunately clang-cl emulates the macros used to detect regular cl, so JsAccount thinks that clang-cl is Visual Studio and so its assumption of the value of the __FUNCTION__ macro is no longer correct.

Fortunately (as mentioned in the comments) the standard __func__ value has been available since Visual Studio 2015 anyway.
Try run: https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=7abe5e48aaa67d74ef32ab289a905aa804f196c8

(Sorry, but after getting my fingers burned on 1492889, I'm wary of trimming the number of Try builds right now.)
Assignee: nobody → neil
Attachment #9016466 - Flags: review?(jorgk)
Comment on attachment 9016466 [details] [diff] [review]
Proposed patch

>   /// Method name to delegate to JavaScript.
>-  void add(in string aMethod);
>+  void add(in ACString aMethod);
This is to allow the simplification of the C++ implementation, which can now pass its parameter directly through to the hashtable.
>+  mMethods.Put(aMethodName, true);

(By the way I've tried this locally on both Win32 and Linux64 so I know that the code works.)
Comment on attachment 9016466 [details] [diff] [review]
Proposed patch

Wow, and you've also fixed the mystery of bug 1475166 where a test started to fail when switching to clang-cl. I'll re-enable that now, thanks!!
Attachment #9016466 - Flags: review?(jorgk) → review+
Oh, wow, take 2, a proper patch with HG header ;-)
Pushed by mozilla@jorgk.com:
Switch from __FUNCTION__ to the standard __func__ to unbreak JsAccount on clang-cl builds. r=jorgk
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 64.0
Blocks: 1475166
You need to log in before you can comment on or make changes to this bug.