From cdd712f1534ffb0dc2d90e86781bef08451bc41b Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 15 Aug 2023 20:11:14 +0000 Subject: [PATCH] Bug 1848746 - Avoid problems when is included before . r=firefox-build-system-reviewers,ahochheiden Differential Revision: https://phabricator.services.mozilla.com/D186201 --- config/msvc-stl-wrapper.template.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config/msvc-stl-wrapper.template.h b/config/msvc-stl-wrapper.template.h index 2834b2823256..fe9be05011e4 100644 --- a/config/msvc-stl-wrapper.template.h +++ b/config/msvc-stl-wrapper.template.h @@ -56,6 +56,13 @@ #ifdef MOZ_INCLUDE_MOZALLOC_H_FROM_${HEADER} // See if we're in code that can use mozalloc. # if !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC) +// In recent versions of MSVC, , which mozalloc.h includes, uses +// without including it. Before MSVC 17.7, this worked +// fine because included , which includes . +// That is still the case, but it now also includes before +// , so when something includes before , +// we get here before is included, which ends up not working. +# include # include "mozilla/mozalloc.h" # else # error "STL code can only be used with infallible ::operator new()"