Bug 1860298 [wpt PR 42668] - [FedCM] Check "same origin with ancestors" for subresour...
[gecko.git] / gfx / layers / BuildConstants.h
blob6db150d136ebf130947cd1fc22930a862b0ec0c6
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=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 BUILD_CONSTANTS_H_
8 #define BUILD_CONSTANTS_H_
10 /**
11 * Why not just use ifdefs?
12 * ifdefs tend to result in code that compiles on one platform but not another.
13 * Given the number of build and platform configurations we have, it's best to
14 * aim to compile the same on as many platforms as possible, and let the
15 * compiler see the constexprs and handle dead-code elision itself.
18 namespace mozilla {
20 constexpr bool kIsDebug =
21 #ifdef DEBUG
22 true;
23 #else
24 false;
25 #endif
27 constexpr bool kIsWindows =
28 #ifdef XP_WIN
29 true;
30 #else
31 false;
32 #endif
34 constexpr bool kIsMacOS =
35 #ifdef XP_MACOSX
36 true;
37 #else
38 false;
39 #endif
41 constexpr bool kIsLinux =
42 #ifdef MOZ_WIDGET_GTK
43 true;
44 #else
45 false;
46 #endif
48 constexpr bool kIsAndroid =
49 #ifdef MOZ_WIDGET_ANDROID
50 true;
51 #else
52 false;
53 #endif
55 } // namespace mozilla
57 #endif // BUILD_CONSTANTS_H_