Bug 1609564 [wpt PR 21209] - Update wpt metadata, a=testonly
[gecko.git] / config / windows-h-wrapper.template.h
blobcbefb046f30aff879afa0ea5161f67938e2c7406
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"
21 #else
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"
38 #else
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
42 extern "C++" {
44 ${decls}
46 } // extern "C++"
48 #undef GetCurrentTime // Use GetTickCount() instead.
50 #endif // enabled
52 #if defined(__GNUC__) || defined(__clang__)
53 # pragma GCC diagnostic pop
54 #else
55 # pragma warning(pop)
56 #endif // defined(__GNUC__) || defined(__clang__)
58 #endif // !defined(mozilla_windows_h)