1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_windows_h
8 #define mozilla_windows_h
10 // Include the "real" windows.h header. On clang/gcc, this can be done with the
11 // `include_next` feature, however MSVC requires a direct include path.
13 // Also turn off deprecation warnings, as we may be wrapping deprecated fns.
15 #if defined(__GNUC__) || defined(__clang__)
16 # pragma GCC system_header
17 # include_next <windows.h>
19 # pragma GCC diagnostic push
20 # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
22 # include <${header_path}>
24 # pragma warning(push)
25 # pragma warning(disable: 4996 4995)
26 #endif // defined(__GNUC__) || defined(__clang__)
28 // Check if the header should be disabled
29 #if defined(MOZ_DISABLE_WINDOWS_WRAPPER)
30 #define MOZ_WINDOWS_WRAPPER_DISABLED_REASON "explicitly disabled"
32 #elif !defined(__cplusplus)
33 #define MOZ_WINDOWS_WRAPPER_DISABLED_REASON "non-C++ source file"
35 #elif !defined(__GNUC__) && !defined(__clang__) && !defined(_DLL)
36 #define MOZ_WINDOWS_WRAPPER_DISABLED_REASON "non-dynamic RTL"
39 // We're allowed to wrap in the current context. Define `MOZ_WRAPPED_WINDOWS_H`
40 // to note that fact, and perform the wrapping.
41 #define MOZ_WRAPPED_WINDOWS_H
49 #if defined(__GNUC__) || defined(__clang__)
50 # pragma GCC diagnostic pop
53 #endif // defined(__GNUC__) || defined(__clang__)
55 #endif // !defined(mozilla_windows_h)