[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / include / clang-c / Platform.h
blob67c1fff8ff7831e1a27c2e550c3b601c193040fd
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 \*===----------------------------------------------------------------------===*/
14 #ifndef LLVM_CLANG_C_PLATFORM_H
15 #define LLVM_CLANG_C_PLATFORM_H
17 #include "clang-c/ExternC.h"
19 LLVM_CLANG_C_EXTERN_C_BEGIN
21 /* Windows DLL import/export. */
22 #ifndef CINDEX_NO_EXPORTS
23 #define CINDEX_EXPORTS
24 #endif
25 #ifdef _WIN32
26 #ifdef CINDEX_EXPORTS
27 #ifdef _CINDEX_LIB_
28 #define CINDEX_LINKAGE __declspec(dllexport)
29 #else
30 #define CINDEX_LINKAGE __declspec(dllimport)
31 #endif
32 #endif
33 #elif defined(CINDEX_EXPORTS) && defined(__GNUC__)
34 #define CINDEX_LINKAGE __attribute__((visibility("default")))
35 #endif
37 #ifndef CINDEX_LINKAGE
38 #define CINDEX_LINKAGE
39 #endif
41 #ifdef __GNUC__
42 #define CINDEX_DEPRECATED __attribute__((deprecated))
43 #else
44 #ifdef _MSC_VER
45 #define CINDEX_DEPRECATED __declspec(deprecated)
46 #else
47 #define CINDEX_DEPRECATED
48 #endif
49 #endif
51 LLVM_CLANG_C_EXTERN_C_END
53 #endif