v8/test/unittests/avoid-windows-h-includes.cc
Bruce Dawson 62bd6a628a 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/+/3223960
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77404}
2021-10-14 21:18:51 +00:00

14 lines
538 B
C++

// 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_)