Stop including windows.h in Screen.h

RESOLVED FIXED in mozilla28

Status

()

defect
RESOLVED FIXED
6 years ago
3 months ago

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Tracking

unspecified
mozilla28
x86
macOS
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [qa-])

Attachments

(1 attachment)

It's unclean.  Think diseased zombie unclean.

This is coming in via Hal.h and PHal stuff, but we don't actually need Hal.h.  We just need one typedef from there.
Comment on attachment 824168 [details] [diff] [review]
Stop including windows.h (via Hal.h) in Screen.h, so we don't screw up our bindings code.

I'm a bit surprised this compiles. But if nsScreen doesn't complain about
typedef-only ScreenConfigurationObserver, then fine.
Please push to tryserver.
Attachment #824168 - Flags: review?(bugs) → review+
So on its own, this patch does not build on Windows, because of the following issue in nsGlobalWindow.cpp.  Without this patch, we have the following things, in order:

1)  Include nsScreen.h, which pulls in windows.h
2)  Undef CreateEvent.
3)  Include nsDeviceSensors.h, which pulls in windows.h via HalSensor.h/IPCMessageUtils.h
4)  Include nsIDOMDocument.h
5)  Include TabChild.h, which pulls in PCOMContentPermissionRequestChild.h which undefs
    CreateEvent.
6)  Code that calls CreateEvent.

Before this change, step 3 didn't redefine CreateEvent, so everything was OK.

After this change, step 2 is a no-op, step 3 defines CreateEvent, when we include nsIDOMDocument it gets a redefined CreateEvent, and then step 5 undefs it so we don't end up seeing the defined version.

I'm just going to move step 2 to after step 3...
https://hg.mozilla.org/mozilla-central/rev/b2add7fd1a74
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28

Updated

5 years ago
Whiteboard: [qa-]
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.