Path: blob/main/contrib/llvm-project/llvm/include/llvm-c/Visibility.h
213766 views
/*===-- llvm-c/Visibility.h - Visibility macros for llvm-c ------*- C++ -*-===*\1|* *|2|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|3|* 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|* This header defines visibility macros used for the LLVM C interface. These *|10|* macros are used to annotate C functions that should be exported as part of *|11|* a shared library or DLL. *|12|* *|13\*===----------------------------------------------------------------------===*/1415#ifndef LLVM_C_VISIBILITY_H16#define LLVM_C_VISIBILITY_H1718#include "llvm/Config/llvm-config.h"1920/// LLVM_C_ABI is the export/visibility macro used to mark symbols declared in21/// llvm-c as exported when built as a shared library.2223#if !defined(LLVM_ABI_GENERATING_ANNOTATIONS)24// TODO(https://github.com/llvm/llvm-project/issues/145406): eliminate need for25// two preprocessor definitions to gate LLVM_ABI macro definitions.26#if defined(LLVM_ENABLE_LLVM_C_EXPORT_ANNOTATIONS) && \27!defined(LLVM_BUILD_STATIC)28#if defined(_WIN32) && !defined(__MINGW32__)29#if defined(LLVM_EXPORTS)30#define LLVM_C_ABI __declspec(dllexport)31#else32#define LLVM_C_ABI __declspec(dllimport)33#endif34#elif defined(__has_attribute) && __has_attribute(visibility)35#define LLVM_C_ABI __attribute__((visibility("default")))36#endif37#endif38#if !defined(LLVM_C_ABI)39#define LLVM_C_ABI40#endif41#endif4243#endif444546