Platform.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. /*===-- clang-c/Platform.h - C Index platform decls -------------*- 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 provides platform specific macros (dllimport, deprecated, ...) *|
  16. |* *|
  17. \*===----------------------------------------------------------------------===*/
  18. #ifndef LLVM_CLANG_C_PLATFORM_H
  19. #define LLVM_CLANG_C_PLATFORM_H
  20. #include "clang-c/ExternC.h"
  21. LLVM_CLANG_C_EXTERN_C_BEGIN
  22. /* Windows DLL import/export. */
  23. #ifndef CINDEX_NO_EXPORTS
  24. #define CINDEX_EXPORTS
  25. #endif
  26. #ifdef _WIN32
  27. #ifdef CINDEX_EXPORTS
  28. #ifdef _CINDEX_LIB_
  29. #define CINDEX_LINKAGE __declspec(dllexport)
  30. #else
  31. #define CINDEX_LINKAGE __declspec(dllimport)
  32. #endif
  33. #endif
  34. #elif defined(CINDEX_EXPORTS) && defined(__GNUC__)
  35. #define CINDEX_LINKAGE __attribute__((visibility("default")))
  36. #endif
  37. #ifndef CINDEX_LINKAGE
  38. #define CINDEX_LINKAGE
  39. #endif
  40. #ifdef __GNUC__
  41. #define CINDEX_DEPRECATED __attribute__((deprecated))
  42. #else
  43. #ifdef _MSC_VER
  44. #define CINDEX_DEPRECATED __declspec(deprecated)
  45. #else
  46. #define CINDEX_DEPRECATED
  47. #endif
  48. #endif
  49. LLVM_CLANG_C_EXTERN_C_END
  50. #endif
  51. #ifdef __GNUC__
  52. #pragma GCC diagnostic pop
  53. #endif