Bug 1298472 - part 2 - use #include_next in STL header wrappers for clang-cl; r=glandium
authorNathan Froyd <froydnj@mozilla.com>
Fri, 09 Sep 2016 09:01:14 -0400
changeset 355102 99183448b819dc701ea6c314b937ae38160c5ca4
parent 355101 dab403941f77ba8480394bd2ec31e98bc1851ec2
child 355103 b2166c12cbbe850f8f903e40ffa1f85efc5d8bdd
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1298472
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1298472 - part 2 - use #include_next in STL header wrappers for clang-cl; r=glandium clang-cl's system header detection doesn't kick in if we're using full paths to the STL headers we need to include. And if certain headers aren't recognized as system headers, we get a pile of warnings from said headers. Use #include_next to ensure that system headers are recognized as such, and suppress the warnings. MozReview-Commit-ID: 4ZlAAGa49M1
config/msvc-stl-wrapper.template.h
--- a/config/msvc-stl-wrapper.template.h
+++ b/config/msvc-stl-wrapper.template.h
@@ -54,17 +54,21 @@
 
 // C4275: When _HAS_EXCEPTIONS is set to 0, system STL header
 //        will generate the warning which we can't modify.
 // C4530: We know that code won't be able to catch exceptions,
 //        but that's OK because we're not throwing them.
 #pragma warning( push )
 #pragma warning( disable : 4275 4530 )
 
+#ifdef __clang__
+#include_next <${HEADER}>
+#else
 #include <${HEADER_PATH}>
+#endif
 
 #pragma warning( pop )
 
 #ifdef MOZ_INCLUDE_MOZALLOC_H_FROM_${HEADER}
 // See if we're in code that can use mozalloc.  NB: this duplicates
 // code in nscore.h because nscore.h pulls in prtypes.h, and chromium
 // can't build with that being included before base/basictypes.h.
 #  if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC)