1*d415bd75Srobert /*===-- llvm-c/Deprecated.h - Deprecation macro -------------------*- C -*-===*\
2*d415bd75Srobert |*                                                                            *|
3*d415bd75Srobert |* Part of the LLVM Project, under the Apache License v2.0 with LLVM          *|
4*d415bd75Srobert |* Exceptions.                                                                *|
5*d415bd75Srobert |* See https://llvm.org/LICENSE.txt for license information.                  *|
6*d415bd75Srobert |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception                    *|
7*d415bd75Srobert |*                                                                            *|
8*d415bd75Srobert |*===----------------------------------------------------------------------===*|
9*d415bd75Srobert |*                                                                            *|
10*d415bd75Srobert |* This header declares LLVM_ATTRIBUTE_C_DEPRECATED() macro, which can be     *|
11*d415bd75Srobert |* used to deprecate functions in the C interface.                            *|
12*d415bd75Srobert |*                                                                            *|
13*d415bd75Srobert \*===----------------------------------------------------------------------===*/
14*d415bd75Srobert 
15*d415bd75Srobert #ifndef LLVM_C_DEPRECATED_H
16*d415bd75Srobert #define LLVM_C_DEPRECATED_H
17*d415bd75Srobert 
18*d415bd75Srobert #ifndef __has_feature
19*d415bd75Srobert # define __has_feature(x) 0
20*d415bd75Srobert #endif
21*d415bd75Srobert 
22*d415bd75Srobert // This is a variant of LLVM_ATTRIBUTE_DEPRECATED() that is compatible with
23*d415bd75Srobert // C compilers.
24*d415bd75Srobert #if __has_feature(attribute_deprecated_with_message)
25*d415bd75Srobert # define LLVM_ATTRIBUTE_C_DEPRECATED(decl, message) \
26*d415bd75Srobert   decl __attribute__((deprecated(message)))
27*d415bd75Srobert #elif defined(__GNUC__)
28*d415bd75Srobert # define LLVM_ATTRIBUTE_C_DEPRECATED(decl, message) \
29*d415bd75Srobert   decl __attribute__((deprecated))
30*d415bd75Srobert #elif defined(_MSC_VER)
31*d415bd75Srobert # define LLVM_ATTRIBUTE_C_DEPRECATED(decl, message) \
32*d415bd75Srobert   __declspec(deprecated(message)) decl
33*d415bd75Srobert #else
34*d415bd75Srobert # define LLVM_ATTRIBUTE_C_DEPRECATED(decl, message) \
35*d415bd75Srobert   decl
36*d415bd75Srobert #endif
37*d415bd75Srobert 
38*d415bd75Srobert #endif /* LLVM_C_DEPRECATED_H */
39