Closed Bug 1656587 Opened 4 years ago Closed 4 years ago

Retrieve Default Printer Name Using CUPS on macOS

Categories

(Core :: Printing: Setup, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: nordzilla, Assigned: nordzilla)

References

Details

(Whiteboard: [print2020_v81])

Attachments

(1 file)

Now that we can retrieve printers through CUPS, we can retrieve the default printer name this way as well.

Depends on: 1656384
Blocks: 1657518
Pushed by csabou@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/451369452f15 Retrieve Default Printer Name Using CUPS r=AlaskanEmily

Apparently there are some C++ compilers that have an issue with, for example:

void foo(int) {}

class bar {
  decltype(foo)* foo;
};

Other compilers (such as the ones I tested with) do not.

So to avoid this inconsistency in com, we're going to have to be explicit about the global scope.
To fix the example, this would mean:

  decltype(::foo)* foo;

To fix this code, we'll have to change the declaration macro from

#define CUPS_SHIM_FUNC_DECL(X) decltype(X)* X;

to

#define CUPS_SHIM_FUNC_DECL(X) decltype(::X)* X;

so that we are explicit about decltypeing from the globally scoped function that exists in cups.h

I believe that should fix the issue.

Flags: needinfo?(enordin)
Pushed by cbrindusan@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/abd5a8175a5c Retrieve Default Printer Name Using CUPS r=AlaskanEmily
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: