Closed Bug 1520530 Opened 5 years ago Closed 5 years ago

Remove the usage of deprecated OSX APIs in nsCommandLineService

Categories

(Core :: Widget: Cocoa, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: mossop, Assigned: mossop)

Details

Attachments

(1 file)

Ive been working on code in toolkit/xre a lot lately and the warning spam from the deprecated API usage in there was quite annoying. So I decided to start fixing some of it.

I converted nsCommandLineService to an obj-c file and used the current APIs for checking if the current app is the foreground app. Then I ended up going on a crazy chase to figure out why then nsUpdateDriver.cpp was then failing to compile with an ambiguous symbol.

It turns out that because we jam all the cpp files together into a unified file for compilation, which file an include of Carbon.h appears in matters. It seems that if it appears before a file that declares "using namespace mozilla;" everything is fine. If it is included after that a use of a TextRange inside OSX headers conflicts with the declaration of mozilla::TextRange. Removing nsCommandLineService from the unified cpp file moved where Carbon.h is included to later causing this issue. So I ended up having to add the include to a file that was early in the unified file, which is kind of ridiculous :(

If you have any other thoughts on how to solve that problem I'm open to ideas.

The addition of the Carbon.h include to CreateAppData.cpp is to ensure that
The OSX API headers are used before conflicting symbols are declared in the
mozilla namespace.

Ugh. I lost track of this review thanks to phabricator. Will look at this shortly.

Priority: -- → P2
Pushed by dtownsend@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7f34f77e6438
Remove the usage of deprecated OSX APIs in nsCommandLineService. r=spohl
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: