EnumSet::kMaxBits won't initialize
Categories
(Core :: JavaScript Engine, defect, P3)
Tracking
()
People
(Reporter: liamg_uw, Assigned: anba)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-esr102+
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36 Edg/101.0.1210.39
Steps to reproduce:
I am building SpiderMonkey for embedding in a C++ project. First I installed Mozilla Build and bootstrapped the entire mozilla-unified. Then I successfully ran js/src.configure.in, and then ran mozmake.exe and mozmake.exe install. Then I added the include folder to my project, linked mozjs-102a1.lib to my project, and copied mozjs-102a1.dll into my main project folder. Then I tried to compile my project.
Actual results:
I get the following error message on EnumSet.h line 329:
use of undefined type 'mozilla::EnumSet<JS::PropertyAttribute,unsigned char>'
Presumably this is because of some forward declaration issue.
Expected results:
It should compile.
Comment 2•3 years ago
|
||
Did you have a header change that made this work?
I tried specifying the template parameters in EnumSet, and I also tried including some extra headers, but I couldn't get it to work. I wonder if it's an MSCV compiler thing.
Updated•2 years ago
|
Hi,
From 1, the approach I did to resolve the build issue with the headers when building against it with Visual Studio is to update line 329 of mozilla/EnumSet.h
, and change:
static constexpr size_t kMaxBits = EnumSet().MaxBits();
to
size_t kMaxBits = EnumSet().MaxBits();
and the C2027 error (the error reported by the reporter) will go away. I am not that well-aquainted with the SpiderMonkey sources, so that's the best way I could come up with. The project that uses the embedding would run as expected.
With blessings, thank you!
Assignee | ||
Comment 5•2 years ago
|
||
Updated•2 years ago
|
Comment 7•2 years ago
|
||
bugherder |
Comment 8•2 years ago
|
||
Comment on attachment 9289390 [details]
Bug 1768632: Make EnumSet compile for MSVC. r=glandium!
ESR Uplift Approval Request
- If this is not a sec:{high,crit} bug, please state case for ESR consideration: Needed for SpiderMonkey embedders on Windows to be able to build with MSVC.
- User impact if declined: Embedders will have to apply the patch anyway.
- Fix Landed on Version: 105
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Seems like any errors introduced by the patch should be obvious at compile-time.
Comment 9•2 years ago
|
||
Comment on attachment 9289390 [details]
Bug 1768632: Make EnumSet compile for MSVC. r=glandium!
Approved for 102.3esr.
Comment 10•2 years ago
|
||
bugherder uplift |
Description
•