| /*===- ExternC.h - C API for the ORC runtime ----------------------*- C -*-===*\ |
| |* *| |
| |* Part of the LLVM Project, under the Apache License v2.0 with LLVM *| |
| |* Exceptions. *| |
| |* See https://llvm.org/LICENSE.txt for license information. *| |
| |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *| |
| |* *| |
| |*===----------------------------------------------------------------------===*| |
| |* *| |
| |* This file defines the C API for the ORC runtime *| |
| |* *| |
| \*===----------------------------------------------------------------------===*/ |
| |
| #ifndef ORC_RT_C_EXTERNC_H |
| #define ORC_RT_C_EXTERNC_H |
| |
| /* Helper to suppress strict prototype warnings. */ |
| #ifdef __clang__ |
| #define ORC_RT_C_STRICT_PROTOTYPES_BEGIN \ |
| _Pragma("clang diagnostic push") \ |
| _Pragma("clang diagnostic error \"-Wstrict-prototypes\"") |
| #define ORC_RT_C_STRICT_PROTOTYPES_END _Pragma("clang diagnostic pop") |
| #else |
| #define ORC_RT_C_STRICT_PROTOTYPES_BEGIN |
| #define ORC_RT_C_STRICT_PROTOTYPES_END |
| #endif |
| |
| /* Helper to wrap C code for C++ */ |
| #ifdef __cplusplus |
| #define ORC_RT_C_EXTERN_C_BEGIN \ |
| extern "C" { \ |
| ORC_RT_C_STRICT_PROTOTYPES_BEGIN |
| #define ORC_RT_C_EXTERN_C_END \ |
| ORC_RT_C_STRICT_PROTOTYPES_END \ |
| } |
| #else |
| #define ORC_RT_C_EXTERN_C_BEGIN ORC_RT_C_STRICT_PROTOTYPES_BEGIN |
| #define ORC_RT_C_EXTERN_C_END ORC_RT_C_STRICT_PROTOTYPES_END |
| #endif |
| |
| #endif /* ORC_RT_C_EXTERNC_H */ |