Platform.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*===-- clang-c/Platform.h - C Index platform decls -------------*- 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 provides platform specific macros (dllimport, deprecated, ...) *|
  11. |* *|
  12. \*===----------------------------------------------------------------------===*/
  13. #ifndef LLVM_CLANG_C_PLATFORM_H
  14. #define LLVM_CLANG_C_PLATFORM_H
  15. #include "clang-c/ExternC.h"
  16. LLVM_CLANG_C_EXTERN_C_BEGIN
  17. /* Windows DLL import/export. */
  18. #ifndef CINDEX_NO_EXPORTS
  19. #define CINDEX_EXPORTS
  20. #endif
  21. #ifdef _WIN32
  22. #ifdef CINDEX_EXPORTS
  23. #ifdef _CINDEX_LIB_
  24. #define CINDEX_LINKAGE __declspec(dllexport)
  25. #else
  26. #define CINDEX_LINKAGE __declspec(dllimport)
  27. #endif
  28. #endif
  29. #elif defined(CINDEX_EXPORTS) && defined(__GNUC__)
  30. #define CINDEX_LINKAGE __attribute__((visibility("default")))
  31. #endif
  32. #ifndef CINDEX_LINKAGE
  33. #define CINDEX_LINKAGE
  34. #endif
  35. #ifdef __GNUC__
  36. #define CINDEX_DEPRECATED __attribute__((deprecated))
  37. #else
  38. #ifdef _MSC_VER
  39. #define CINDEX_DEPRECATED __declspec(deprecated)
  40. #else
  41. #define CINDEX_DEPRECATED
  42. #endif
  43. #endif
  44. LLVM_CLANG_C_EXTERN_C_END
  45. #endif