mozjs-140.pc does not contain -DXP_UNIX on Linux
Categories
(Core :: JavaScript Engine, defect, P3)
Tracking
()
People
(Reporter: xry111, Unassigned, NeedInfo)
References
(Blocks 1 open bug)
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/60.5 Safari/605.1.15
Steps to reproduce:
Install SpiderMonkey-140 and attempt to port gjs to it (https://gitlab.gnome.org/xry111/gjs/-/commits/xry111/mozjs-140).
Actual results:
In file included from /usr/include/mozjs-140/mozilla/BaseProfileJSONWriter.h:17,
from /usr/include/mozjs-140/mozilla/BaseProfilerMarkersPrerequisites.h:27,
from /usr/include/mozjs-140/js/ProfilingStack.h:11,
from /usr/include/mozjs-140/js/RootingAPI.h:29,
from /usr/include/mozjs-140/js/GCHashTable.h:14,
from ../gjs/context-private.h:28,
from ../test/gjs-test-utils.cpp:16:
/usr/include/mozjs-140/mozilla/UniquePtrExtensions.h:104:6: error: #error "Unsupported OS?"
104 | # error "Unsupported OS?"
| ^~~~~
Expected results:
As the headers depend on XP_UNIX (or other XP_xxx), it should be defined somewhere (IMO in the pkg-config file).
Updated•4 months ago
|
Comment 1•4 months ago
|
||
You can fix this by adding #undef XP_UNIX and #undef XP_WIN to js/src/js-config.h.in. But I actually suspect that the right solution is to make the header files not platform-dependent! You could figure out the proper typedef for UniquePtrExtensions.h.'s FileHandleType during configure, and define that in js-config.h.in instead.
Comment 2•4 months ago
|
||
I'd be happy to make a patch if I could get some guidance on whether it's OK to expose XP_UNIX and XP_WIN in public headers, or whether it'd be better to create a configure define for FileHandleType.
Comment 3•2 months ago
|
||
Gonna see what sfink thinks about this... he's been closer to the build sun than I have :)
Description
•