blob: 2b9240fbc41b9a3cd0a52d707b2eabd72946f74c [file] [log] [blame]
Derek Lambertiafe78892019-05-10 11:24:12 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#pragma once
7
8#if __GNUC__
9# define ARMNN_NO_DEPRECATE_WARN_BEGIN \
10 _Pragma("GCC diagnostic push") \
11 _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
12
13# define ARMNN_NO_DEPRECATE_WARN_END \
14 _Pragma("GCC diagnostic pop")
15
16#elif __clang__
17# define ARMNN_NO_DEPRECATE_WARN_BEGIN \
18 _Pragma("clang diagnostic push") \
19 _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
20
21# define ARMNN_NO_DEPRECATE_WARN_END \
22 _Pragma("clang diagnostic pop")
23
24#elif defined (_MSC_VER)
25# define ARMNN_NO_DEPRECATE_WARN_BEGIN \
26 __pragma(warning( push )) \
27 __pragma(warning(disable : 4996))
28
29# define ARMNN_NO_DEPRECATE_WARN_END \
30 __pragma(warning( pop ))
31
32#else
33# define ARMNN_NO_DEPRECATE_WARN_BEGIN
34# define ARMNN_NO_DEPRECATE_WARN_END
35#endif
36
37#define ARMNN_SUPRESS_DEPRECATE_WARNING(func) \
38ARMNN_NO_DEPRECATE_WARN_BEGIN \
39func; \
40ARMNN_NO_DEPRECATE_WARN_END
41
42#define ARMNN_DEPRECATED [[deprecated]]
Derek Lamberti41e92b02020-01-21 13:43:21 +000043#define ARMNN_DEPRECATED_MSG(message) [[deprecated(message)]]
44
Derek Lambertid466a542020-01-22 15:37:29 +000045#if defined(__GNUC__) && (__GNUC__ < 6)
Derek Lamberti41e92b02020-01-21 13:43:21 +000046# define ARMNN_DEPRECATED_ENUM
47# define ARMNN_DEPRECATED_ENUM_MSG(message)
48#else
49# define ARMNN_DEPRECATED_ENUM ARMNN_DEPRECATED
50# define ARMNN_DEPRECATED_ENUM_MSG(message) ARMNN_DEPRECATED_MSG(message)
51#endif