1// Copyright 2022 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_COMMON_ALLOW_DEPRECATED_H_
6#define V8_COMMON_ALLOW_DEPRECATED_H_
7
8#if defined(V8_IMMINENT_DEPRECATION_WARNINGS) || \
9    defined(V8_DEPRECATION_WARNINGS)
10
11#if defined(V8_CC_MSVC)
12
13#define START_ALLOW_USE_DEPRECATED() \
14  __pragma(warning(push)) __pragma(warning(disable : 4996))
15
16#define END_ALLOW_USE_DEPRECATED() __pragma(warning(pop))
17
18#else  // !defined(V8_CC_MSVC)
19
20#define START_ALLOW_USE_DEPRECATED() \
21  _Pragma("GCC diagnostic push")     \
22      _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
23
24#define END_ALLOW_USE_DEPRECATED() _Pragma("GCC diagnostic pop")
25
26#endif  // !defined(V8_CC_MSVC)
27
28#else  // !(defined(V8_IMMINENT_DEPRECATION_WARNINGS) ||
29       // defined(V8_DEPRECATION_WARNINGS))
30
31#define START_ALLOW_USE_DEPRECATED()
32#define END_ALLOW_USE_DEPRECATED()
33
34#endif  // !(defined(V8_IMMINENT_DEPRECATION_WARNINGS) ||
35        // defined(V8_DEPRECATION_WARNINGS))
36
37#endif  // V8_COMMON_ALLOW_DEPRECATED_H_
38