On 10/27/17 12:33 PM, Steve Fink wrote:
Within Spidermonkey, our rule is to never #include windows.h directly, but always via jswin.h
Ah, I thought I'd seen this sort of thing somewhere; I had recalled a header that you could include to under "all the bad windows.h stuff"...
This approach doesn't work for Gecko out of the box, because there's third-party code Gecko uses whose headers include windows.h, as you note.
Now the Gecko approach is being extended to creating a WebIDL attribute for this. What are the objections to doing things the jswin.h way?
Expediency, in this case...
I understand there may be difficulties with third party code including windows.h, but that just means that you additionally need to include mozwin.h (or whatever we choose to call it) after including those header files
The hard part is finding where all "those header files" are included. They're everywhere, unfortunately, because the chromium-ipc headers include windows.h. :(
And you can't easily use try to get your way around this, because msvc very helpfully doesn't give include paths for its errors.
Then if you need to define a webidl constant that conflicts with windows.h damage, you'd add it to mozwin.h with no magic attribute required.
Yes, this would be absolutely ideal from my point of view. It's a much bigger project than I could justify asking Kyle to do for what was fundamentally a spare-time patch....
-Boris _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform