173
|
1 //===-- runtime/c-or-cpp.h --------------------------------------*- C++ -*-===//
|
|
2 //
|
|
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
4 // See https://llvm.org/LICENSE.txt for license information.
|
|
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
6 //
|
|
7 //===----------------------------------------------------------------------===//
|
|
8
|
|
9 #ifndef FORTRAN_RUNTIME_C_OR_CPP_H_
|
|
10 #define FORTRAN_RUNTIME_C_OR_CPP_H_
|
|
11
|
|
12 #ifdef __cplusplus
|
|
13 #define IF_CPLUSPLUS(x) x
|
|
14 #define IF_NOT_CPLUSPLUS(x)
|
|
15 #define DEFAULT_VALUE(x) = (x)
|
|
16 #else
|
|
17 #include <stdbool.h>
|
|
18 #define IF_CPLUSPLUS(x)
|
|
19 #define IF_NOT_CPLUSPLUS(x) x
|
|
20 #define DEFAULT_VALUE(x)
|
|
21 #endif
|
|
22
|
|
23 #define FORTRAN_EXTERN_C_BEGIN IF_CPLUSPLUS(extern "C" {)
|
|
24 #define FORTRAN_EXTERN_C_END IF_CPLUSPLUS( \
|
|
25 })
|
|
26 #define NORETURN IF_CPLUSPLUS([[noreturn]])
|
|
27 #define NO_ARGUMENTS IF_NOT_CPLUSPLUS(void)
|
|
28
|
|
29 #endif // FORTRAN_RUNTIME_C_OR_CPP_H_
|