Unlike Windows, which has distinct export/import annotations, POSIX programs need to use default visibility consistently across shared libraries. If they don't, inline code will be duplicated in each library, which can cause very subtle bugs. Bug: chromium:368047728 Change-Id: I8d356c637b497b32f73fb4cbbb128a0829523433 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6371928 Commit-Queue: Devon Loehr <dloehr@google.com> Reviewed-by: Toon Verwaest <verwaest@chromium.org> Reviewed-by: Mark Mentovai <mark@chromium.org> Auto-Submit: Devon Loehr <dloehr@google.com> Cr-Commit-Position: refs/heads/main@{#99529}
30 lines
886 B
C
30 lines
886 B
C
// Copyright 2016 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_
|
|
#define V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#ifdef BUILDING_V8_PLATFORM_SHARED
|
|
#define V8_PLATFORM_EXPORT __declspec(dllexport)
|
|
#elif USING_V8_PLATFORM_SHARED
|
|
#define V8_PLATFORM_EXPORT __declspec(dllimport)
|
|
#else
|
|
#define V8_PLATFORM_EXPORT
|
|
#endif // BUILDING_V8_PLATFORM_SHARED
|
|
|
|
#else // defined(_WIN32)
|
|
|
|
// Setup for Linux shared library export.
|
|
#if defined(BUILDING_V8_PLATFORM_SHARED) || USING_V8_PLATFORM_SHARED
|
|
#define V8_PLATFORM_EXPORT __attribute__((visibility("default")))
|
|
#else
|
|
#define V8_PLATFORM_EXPORT
|
|
#endif // defined(BUILDING_V8_PLATFORM_SHARED) || ...
|
|
|
|
#endif // defined(_WIN32)
|
|
|
|
#endif // V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_
|