Note: There are a few cases of duplicates in user autocompletion which are being worked on.

use jswin.h to clean up from windows.h crapping on STRICT

RESOLVED FIXED in mozilla8

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: sfink, Assigned: sfink)

Tracking

unspecified
mozilla8
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
json.h includes jsbuiltins.h includes nanojit/nanojit.h indirectly includes windows.h, which #defines STRICT. json.h uses STRICT in a DecodingMode enum. Because json.h also #undefs STRICT, it's normally ok.

But then, I modify jsprobes.h to include jswin.h which includes windows.h. Now jsonparser.cpp ends up including json.h first, then jsprobes.h. Mysteriously, windows.h seems to redefine STRICT the second time it's included, too, so jsonparse.cpp ends up compiling with STRICT #defined to something else. (Which happens to compile, but produces the wrong results.)

This seems bizarre, since I would expect windows.h to have protection from multiple inclusion, but that's the observed behavior. And I've fled my Windows dev environment purgatory for now, so I can't dig into it further at the moment. Plus, I don't really care why it was happening.
(Assignee)

Comment 1

6 years ago
Created attachment 544576 [details] [diff] [review]
Move more windows.h handling to jswin.h

Use jswin.h to deal with windows.h. It'd be nice to replace nanojit's windows.h include with jswin.h to catch it at the source, but I don't understand the rules of the nanojit subtree.

Also, this patch could be expanded to handle jstracer.cpp's include of nanojit.h, but that looked like a slippery slope -- to do it right, it seems like jswin.h should also take over the alloca stuff from jstracer.cpp, but that involves

  #ifdef SOLARIS

so it would make jswin.h broader than just Windows, and that starts to feel messy.
Attachment #544576 - Flags: review?(jwalden+bmo)
(Assignee)

Updated

6 years ago
Blocks: 588537
Comment on attachment 544576 [details] [diff] [review]
Move more windows.h handling to jswin.h

Review of attachment 544576 [details] [diff] [review]:
-----------------------------------------------------------------
Attachment #544576 - Flags: review?(jwalden+bmo) → review+
(Assignee)

Comment 3

6 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/4d7f75359cc4
Assignee: general → sphink
Status: NEW → ASSIGNED
Whiteboard: [inbound]
http://hg.mozilla.org/mozilla-central/rev/4d7f75359cc4
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla8
You need to log in before you can comment on or make changes to this bug.