1 //===-------------------------- __cxxabi_config.h -------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef ____CXXABI_CONFIG_H
10 #define ____CXXABI_CONFIG_H
12 #if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \
13 !defined(__ARM_DWARF_EH__)
14 #define _LIBCXXABI_ARM_EHABI
17 #if !defined(__has_attribute)
18 #define __has_attribute(_attribute_) 0
22 #if defined(_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS)
23 #define _LIBCXXABI_HIDDEN
24 #define _LIBCXXABI_DATA_VIS
25 #define _LIBCXXABI_FUNC_VIS
26 #define _LIBCXXABI_TYPE_VIS
27 #elif defined(_LIBCXXABI_BUILDING_LIBRARY)
28 #define _LIBCXXABI_HIDDEN
29 #define _LIBCXXABI_DATA_VIS __declspec(dllexport)
30 #define _LIBCXXABI_FUNC_VIS __declspec(dllexport)
31 #define _LIBCXXABI_TYPE_VIS __declspec(dllexport)
33 #define _LIBCXXABI_HIDDEN
34 #define _LIBCXXABI_DATA_VIS __declspec(dllimport)
35 #define _LIBCXXABI_FUNC_VIS __declspec(dllimport)
36 #define _LIBCXXABI_TYPE_VIS __declspec(dllimport)
39 #if !defined(_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS)
40 #define _LIBCXXABI_HIDDEN __attribute__((__visibility__("hidden")))
41 #define _LIBCXXABI_DATA_VIS __attribute__((__visibility__("default")))
42 #define _LIBCXXABI_FUNC_VIS __attribute__((__visibility__("default")))
43 #if __has_attribute(__type_visibility__)
44 #define _LIBCXXABI_TYPE_VIS __attribute__((__type_visibility__("default")))
46 #define _LIBCXXABI_TYPE_VIS __attribute__((__visibility__("default")))
49 #define _LIBCXXABI_HIDDEN
50 #define _LIBCXXABI_DATA_VIS
51 #define _LIBCXXABI_FUNC_VIS
52 #define _LIBCXXABI_TYPE_VIS
57 #define _LIBCXXABI_WEAK
59 #define _LIBCXXABI_WEAK __attribute__((__weak__))
62 #if defined(__clang__)
63 #define _LIBCXXABI_COMPILER_CLANG
64 #elif defined(__GNUC__)
65 #define _LIBCXXABI_COMPILER_GCC
68 #if __has_attribute(__no_sanitize__) && defined(_LIBCXXABI_COMPILER_CLANG)
69 #define _LIBCXXABI_NO_CFI __attribute__((__no_sanitize__("cfi")))
71 #define _LIBCXXABI_NO_CFI
74 // wasm32 follows the arm32 ABI convention of using 32-bit guard.
75 #if defined(__arm__) || defined(__wasm32__)
76 # define _LIBCXXABI_GUARD_ABI_ARM
79 #endif // ____CXXABI_CONFIG_H