Have SpiderMonkey public Headers work on Visual Studio too
Categories
(Core :: MFBT, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox75 | --- | fixed |
People
(Reporter: fanc999, Assigned: Waldo)
Details
Attachments
(2 files)
1.60 KB,
patch
|
Details | Diff | Splinter Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0
Steps to reproduce:
- Build and install SpiderMonkey 68.4.2 from the ThunderBird 68.4.2 sources, using LLVM 9.0.0 (clang-cl)
- Build GJS (https://gitlab.gnome.org/GNOME/gjs) with Visual Studio 2017 15.9.16
Actual results:
-
For files that included mozilla/DbgMacro.h, error C2010 is thrown because GCC-specific varargs syntax is used in the definition of the macros MOZ_DBG and MOZ_DEFINE_DBG.
-
C2487 (member of dll interface class may not be declared with dll interface) is thrown when the file js/AllocPolicy.h is included, for the methods 'onOutOfMemory()' and 'reportAllocOverflow()' of the class 'class TempAllocPolicy : public AllocPolicyBase' are marked with 'JS_FRIEND_API', which is defined as 'MOZ_IMPORT_API', which in turn is defined as '__declspec(dllimport)'. I am not sure of the best way to fix this overall, but it is fixable by removing the 'JS_FRIEND_API' decoration from the prototypes of the afore-mentioned method definitions when I am building against it.
I am attaching a patch for mozilla/DbgMacro.h as a result.
Expected results:
GJS should have built and linked successfully.
Comment 2•4 years ago
|
||
@fanc999: thanks for the patch! Unfortunately I think it will become increasingly difficult to maintain this configuration as headers will probably start relying on more features not supported by MSVC :/
Waldo, can you look at this MFBT patch?
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Pushed by jwalden@mit.edu: https://hg.mozilla.org/integration/autoland/rev/0f4fc4e582d3 Make mfbt/DbgMacro.h use standard variadic macro syntax, not gcc/clang extension syntax. r=froydnj
Comment 5•4 years ago
|
||
bugherder |
Description
•