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