Commit 62bd6a62 authored by Bruce Dawson's avatar Bruce Dawson Committed by V8 LUCI CQ

Test that heap-inl.h doesn't include windows.h

In order to avoid namespace pollution and compilation overhead it is
desirable to avoid include windows.h, and this enforces that.

Bug: chromium:796644
Change-Id: I7fdcd3c182a77cee03672bc4324b9e21566896d6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3223960Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77404}
parent 1d661ec3
......@@ -500,7 +500,10 @@ v8_source_set("unittests_sources") {
}
if (is_win) {
sources += [ "wasm/trap-handler-win-unittest.cc" ]
sources += [
"wasm/trap-handler-win-unittest.cc",
"avoid-windows-h-includes.cc",
]
}
# Include this test only on arm64 simulator builds on x64 on Linux, Mac and
......
// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Include heap-inl.h to make sure that neither it nor its transitive includes
// pull in windows.h.
#include "src/heap/heap-inl.h"
// This should be after all other #includes.
#if defined(_WINDOWS_) // Detect whether windows.h was included.
// See base/win/windows_h_disallowed.h for details.
#error Windows.h was included unexpectedly.
#endif // defined(_WINDOWS_)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment