Closed Bug 1659521 Opened 5 months ago Closed 5 months ago

Add a header that exports the CDM header and undefines problematic macros from X11


(Core :: Audio/Video: GMP, task, P3)




81 Branch
Tracking Status
firefox81 --- fixed


(Reporter: bryce, Assigned: bryce)




(1 file)

X11 defines various macros that end up clashing with common names like 'None' and 'Status'. There's existing are to work around this[0], and we've got some code in Media that sidesteps the problem via undefs[1].

I would like to use some of the CDM enums in ipdl (see bug 1654383). However that currently fails due to the ipc codegen bringing in the X11 headers which define a Status macro which then tramples the Status in the CDM headers. Because I can't #undef in ipdl I think having a header that wraps the CDM headers and does the undeffing is the next best thing. If we put this new header in the gmp-api dir it also shows that we use the CDM symbols as part of the GMP-API (though the whole documenting of the GMP-API has grown a little wonky over time).

The other way we could deal with this is to prevent X11 headers being dragged into the IPC codegen, but that's a bigger and non-media specific task. We already have a bandaid in place for this[1] which I'm okay with expanding a bit.


When using the CDM headers in ipc codegen we run into issues where X11 defines
a Status macro that tramples the CDM headers. Since we can't undef Status in
ipdl we can instead add a header that ipdl can include which does the undef.

Pushed by
Add file that exposes CDM symbols and undefs clashing X11 macros. r=alwu
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
You need to log in before you can comment on or make changes to this bug.