Closed
Bug 925382
Opened 12 years ago
Closed 12 years ago
Make bindings not compile if they include Windows system headers
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla28
People
(Reporter: mccr8, Assigned: bzbarsky)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
|
2.07 KB,
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
from bz: "I found the include chain involved and told qDot how to break it so he
can land his patch, but we should actually go ahead and make bindings
not compile if they include Windows headers"
If you end up including them into the bindings code, you get a weird linking error:
LINK : warning LNK4199: /DELAYLOAD:VCCORLIB110D.DLL ignored; no imports found from VCCORLIB110D.DLL
UnifiedBindings4.obj : error LNK2019: unresolved external symbol "public: struct already_AddRefed<class nsDOMEvent> __thiscall nsIDocument::CreateEventW(class nsAString_internal const &,class mozilla::ErrorResult &)const " (?CreateEventW@nsIDocument@@QBE?AU?$already_AddRefed@VnsDOMEvent@@@@ABVnsAString_internal@@AAVErrorResult@mozilla@@@Z) referenced in function "bool __cdecl mozilla::dom::DocumentBinding::createEvent(struct JSContext *,class JS::Handle<class JSObject *>,class nsIDocument *,class JSJitMethodCallArgs const &)" (?createEvent@DocumentBinding@dom@mozilla@@YA_NPAUJSContext@@V?$Handle@PAVJSObject@@@JS@@PAVnsIDocument@@ABVJSJitMethodCallArgs@@@Z)
xul.dll : fatal error LNK1120: 1 unresolved externals
| Assignee | ||
Comment 1•12 years ago
|
||
Oh, and the reason you get that error is because window.h has:
#define CreateEvent CreateEventW
or some such. And many more beside.
Maybe it's as "simple" as throwing
#ifdef _WINDOWS_
#error "Foo.cpp included windows.h"
#endif
in the unified files after each .cpp #include and then seeing whether we compile...
| Reporter | ||
Comment 2•12 years ago
|
||
bz has a patch for this, so reassigning to him. He can actually build on Windows locally so that makes him a better fit for this. ;)
Assignee: continuation → bzbarsky
| Assignee | ||
Comment 3•12 years ago
|
||
Attachment #824173 -
Flags: review?(nfroyd)
| Assignee | ||
Comment 4•12 years ago
|
||
Hackytry at https://tbpl.mozilla.org/?tree=Try&rev=14bee79e261f (pending the peerconnectionimpl stuff being fixed).
Comment 5•12 years ago
|
||
Comment on attachment 824173 [details] [diff] [review]
Error out of unified bindings if one of them includes windows.h.
Review of attachment 824173 [details] [diff] [review]:
-----------------------------------------------------------------
::: python/mozbuild/mozbuild/backend/recursivemake.py
@@ +609,5 @@
> # handle source files being added/removed/renamed. Therefore, we
> # generate them here also to make sure everything's up-to-date.
> with self._write_file(os.path.join(output_directory, unified_file)) as f:
> + includeTemplate = '#include "%(cppfile)s"'
> + if unified_prefix == "UnifiedBindings":
Let's make this check a keyword argument, defaulting to false, to the function instead. poison_windows_h?
Attachment #824173 -
Flags: review?(nfroyd) → review+
| Assignee | ||
Comment 6•12 years ago
|
||
| Assignee | ||
Comment 7•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/9e70cbddf7fb
Gregory, as a heads-up this might conflict slightly with your bindings build system changes; if you want prefer I can do the merge there.
Target Milestone: --- → mozilla28
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•