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