xref: /netbsd-src/external/apache2/llvm/dist/clang/include/clang-c/ExternC.h (revision e038c9c4676b0f19b1b7dd08a940c6ed64a6d5ae)
1*e038c9c4Sjoerg /*===- clang-c/ExternC.h - Wrapper for 'extern "C"' ---------------*- C -*-===*\
2*e038c9c4Sjoerg |*                                                                            *|
3*e038c9c4Sjoerg |* Part of the LLVM Project, under the Apache License v2.0 with LLVM          *|
4*e038c9c4Sjoerg |* Exceptions.                                                                *|
5*e038c9c4Sjoerg |* See https://llvm.org/LICENSE.txt for license information.                  *|
6*e038c9c4Sjoerg |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception                    *|
7*e038c9c4Sjoerg |*                                                                            *|
8*e038c9c4Sjoerg |*===----------------------------------------------------------------------===*|
9*e038c9c4Sjoerg |*                                                                            *|
10*e038c9c4Sjoerg |* This file defines an 'extern "C"' wrapper.                                 *|
11*e038c9c4Sjoerg |*                                                                            *|
12*e038c9c4Sjoerg \*===----------------------------------------------------------------------===*/
13*e038c9c4Sjoerg 
14*e038c9c4Sjoerg #ifndef LLVM_CLANG_C_EXTERN_C_H
15*e038c9c4Sjoerg #define LLVM_CLANG_C_EXTERN_C_H
16*e038c9c4Sjoerg 
17*e038c9c4Sjoerg #ifdef __clang__
18*e038c9c4Sjoerg #define LLVM_CLANG_C_STRICT_PROTOTYPES_BEGIN                                   \
19*e038c9c4Sjoerg   _Pragma("clang diagnostic push")                                             \
20*e038c9c4Sjoerg       _Pragma("clang diagnostic error \"-Wstrict-prototypes\"")
21*e038c9c4Sjoerg #define LLVM_CLANG_C_STRICT_PROTOTYPES_END _Pragma("clang diagnostic pop")
22*e038c9c4Sjoerg #else
23*e038c9c4Sjoerg #define LLVM_CLANG_C_STRICT_PROTOTYPES_BEGIN
24*e038c9c4Sjoerg #define LLVM_CLANG_C_STRICT_PROTOTYPES_END
25*e038c9c4Sjoerg #endif
26*e038c9c4Sjoerg 
27*e038c9c4Sjoerg #ifdef __cplusplus
28*e038c9c4Sjoerg #define LLVM_CLANG_C_EXTERN_C_BEGIN                                            \
29*e038c9c4Sjoerg   extern "C" {                                                                 \
30*e038c9c4Sjoerg   LLVM_CLANG_C_STRICT_PROTOTYPES_BEGIN
31*e038c9c4Sjoerg #define LLVM_CLANG_C_EXTERN_C_END                                              \
32*e038c9c4Sjoerg   LLVM_CLANG_C_STRICT_PROTOTYPES_END                                           \
33*e038c9c4Sjoerg   }
34*e038c9c4Sjoerg #else
35*e038c9c4Sjoerg #define LLVM_CLANG_C_EXTERN_C_BEGIN LLVM_CLANG_C_STRICT_PROTOTYPES_BEGIN
36*e038c9c4Sjoerg #define LLVM_CLANG_C_EXTERN_C_END LLVM_CLANG_C_STRICT_PROTOTYPES_END
37*e038c9c4Sjoerg #endif
38*e038c9c4Sjoerg 
39*e038c9c4Sjoerg #endif
40