[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / llvm / include / llvm-c / ExternC.h
blobdfa21bdc08572304649c16a8dda1cdc9a34d6054
1 /*===- llvm-c/ExternC.h - Wrapper for 'extern "C"' ----------------*- 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 file defines an 'extern "C"' wrapper *|
11 |* *|
12 \*===----------------------------------------------------------------------===*/
14 #ifndef LLVM_C_EXTERNC_H
15 #define LLVM_C_EXTERNC_H
17 #ifdef __clang__
18 #define LLVM_C_STRICT_PROTOTYPES_BEGIN \
19 _Pragma("clang diagnostic push") \
20 _Pragma("clang diagnostic error \"-Wstrict-prototypes\"")
21 #define LLVM_C_STRICT_PROTOTYPES_END _Pragma("clang diagnostic pop")
22 #else
23 #define LLVM_C_STRICT_PROTOTYPES_BEGIN
24 #define LLVM_C_STRICT_PROTOTYPES_END
25 #endif
27 #ifdef __cplusplus
28 #define LLVM_C_EXTERN_C_BEGIN \
29 extern "C" { \
30 LLVM_C_STRICT_PROTOTYPES_BEGIN
31 #define LLVM_C_EXTERN_C_END \
32 LLVM_C_STRICT_PROTOTYPES_END \
34 #else
35 #define LLVM_C_EXTERN_C_BEGIN LLVM_C_STRICT_PROTOTYPES_BEGIN
36 #define LLVM_C_EXTERN_C_END LLVM_C_STRICT_PROTOTYPES_END
37 #endif
39 #endif