Closed Bug 1498392 Opened 2 years ago Closed 2 years ago

JsAccount broken by switch to clang-cl


(MailNews Core :: Backend, defect)

Windows 10
Not set


(Not tracked)

Thunderbird 64.0


(Reporter: neil, Assigned: neil)




(1 file)

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.
Attached patch Proposed patchSplinter Review
Try run:

(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
Switch from __FUNCTION__ to the standard __func__ to unbreak JsAccount on clang-cl builds. r=jorgk
Closed: 2 years 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.