• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2021 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // This file is designed to be included if windows.h is included from a source
6 // file that should not need it. Conditionally including this file from a few
7 // key source files will help to stop windows.h from creeping back into the
8 // Chromium build, with the namespace pollution which that implies. Typical
9 // usage is:
10 //
11 // // This should be after all other #includes.
12 // #if defined(_WINDOWS_)  // Detect whether windows.h was included.
13 // #include "base/win/windows_h_disallowed.h"
14 // #endif  // defined(_WINDOWS_)
15 //
16 // See https://crbug.com/796644 for more historical context.
17 
18 #ifndef BASE_WIN_WINDOWS_H_DISALLOWED_H_
19 #define BASE_WIN_WINDOWS_H_DISALLOWED_H_
20 
21 #error Windows.h was included unexpectedly. See comment above for details.
22 
23 #endif  // BASE_WIN_WINDOWS_H_DISALLOWED_H_
24