Deprecated.h 1.9 KB

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