Closed Bug 1812276 Opened 1 year ago Closed 1 year ago

Undefine windows macro GetAcceptLanguages in unified build

Categories

(Core :: General, defect)

defect

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: jjaschke, Assigned: glandium)

References

Details

Attachments

(1 file, 1 obsolete file)

As seen in Bug 1803355, adding new files to the unified build introduced Bug 1812021. This was due to file contents being moved from one unified source to another, which happened to have different sets of includes. On Windows, one include had the side effect of defining

#define GetAcceptLanguages GetAcceptLanguagesW

which changed mozilla::dom::Navigator::GetAcceptLanguages. Adding new files and thus moving content from one unified build to another leads to one unified source defining the macro and another one not defining it.

Moving source code from one unified source file to another may lead to inconsistencies where one file defines GetAcceptLanguages whereas the other one doesn't.
This can cause Undefined Symbol link errors on certain windows build configurations.

Here's a try run with the patch on m-c.
Here's a try run with the patch on top of Bug 1803355.

This should fix the immediate issue, but random Windows.h macros floating around really isn't ideal.

I guess in the long term it would be better to wrap all Windows.h usages in a way that #include <Windows.h> only occurs in non-unified cpp files.

I guess in the long term it would be better to wrap all Windows.h usages in a way that #include <Windows.h> only occurs in non-unified cpp files.

We ... actually already have that. Check $objdir/dist/stl_wrappers/windows.h. But that doesn't handle shlwapi.h, which is where GetAcceptLanguages is.

Assignee: jjaschke → mh+mozilla
Attachment #9314045 - Attachment is obsolete: true
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/dc600ee31d6f
Add a minimal shlwapi.h wrapper, like we do with windows.h. r=nika

Backed out for causing shlwapi.h related bustages on Windows.

Flags: needinfo?(mh+mozilla)
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/213ac6d669bb
Add a minimal shlwapi.h wrapper, like we do with windows.h. r=nika
Flags: needinfo?(mh+mozilla)
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: