|
| 1 | +/*===-- Demangle/Visibility.h - Visibility macros for Demangle --*- 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 header defines visibility macros used for the Demangle library. These *| |
| 11 | +|* macros are used to annotate functions that should be exported as part of a *| |
| 12 | +|* shared library or DLL. *| |
| 13 | +|* *| |
| 14 | +\*===----------------------------------------------------------------------===*/ |
| 15 | + |
| 16 | +#ifndef LLVM_DEMANGLE_VISIBILITY_H |
| 17 | +#define LLVM_DEMANGLE_VISIBILITY_H |
| 18 | + |
| 19 | +#include "llvm/Config/llvm-config.h" |
| 20 | +#include "llvm/Demangle/DemangleConfig.h" |
| 21 | + |
| 22 | +/// DEMANGLE_ABI is the export/visibility macro used to mark symbols delcared in |
| 23 | +/// llvm/Demangle as exported when built as a shared library. |
| 24 | + |
| 25 | +#if !defined(LLVM_ABI_GENERATING_ANNOTATIONS) |
| 26 | +#if defined(LLVM_ENABLE_DEMANGLE_EXPORT_ANNOTATIONS) && \ |
| 27 | + !defined(LLVM_BUILD_STATIC) |
| 28 | +#if defined(_WIN32) && !defined(__MINGW32__) |
| 29 | +#if defined(LLVM_EXPORTS) |
| 30 | +#define DEMANGLE_ABI __declspec(dllexport) |
| 31 | +#else |
| 32 | +#define DEMANGLE_ABI __declspec(dllimport) |
| 33 | +#endif |
| 34 | +#elif __has_attribute(visibility) |
| 35 | +#define DEMANGLE_ABI __attribute__((visibility("default"))) |
| 36 | +#endif |
| 37 | +#endif |
| 38 | +#if !defined(DEMANGLE_ABI) |
| 39 | +#define DEMANGLE_ABI |
| 40 | +#endif |
| 41 | +#endif |
| 42 | + |
| 43 | +#endif |
0 commit comments