On Tue, Aug 6, 2019 at 8:54 PM Kris Maglione <kmagli...@mozilla.com> wrote: > > On Tue, Aug 06, 2019 at 10:56:55AM +0300, Henri Sivonen wrote: > > Do we have some #ifdef for excluding parts of mfbt/ when mfbt/ is being used > > in a non-SpiderMonkey/Gecko context? > > #ifdef MOZ_HAS_MOZGLUE
Thanks. This appears to be undefined for gtests that call in to libxul code. (Is that intentional?) It appears that MOZILLA_INTERNAL_API is needed for covering gtests that call into libxul code. As far as I can tell, after https://bugzilla.mozilla.org/show_bug.cgi?id=1572364 , ".cpp that links with jsrust_shared" is detected by: #if defined(MOZILLA_INTERNAL_API) || \ (defined(MOZ_HAS_MOZGLUE) && defined(ENABLE_WASM_CRANELIFT)) Does that look right? I verified this experimentally by checking that the above evaluates to false when compiling --enable-application=tools/update-packaging or --enable-application=memory. (Despite advice to the contrary, I still think it's important for discoverability to put my code in mfbt/TextUtils.h and having it disabled in contexts that don't link with jsrust_shared. It would be bad if e.g. mozilla::IsAscii taking a single char and mozilla::IsAscii taking mozilla::Span<const char> weren't discoverable in the same place. Or even worse if mozilla::IsAscii taking '\0'-terminated const char* and mozilla::IsAscii taking mozilla::Span<const char> weren't discoverable in the same place.) -- Henri Sivonen hsivo...@mozilla.com _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform