Revert "simplify and centralize SK_API"

This reverts commit 7f960d2083.

Reason for revert: Chrome roll again

Original change's description:
> simplify and centralize SK_API
> 
> Attempt two, this time not setting visibility("default")
> unless SKIA_IMPLEMENTATION is defined.
> 
> Bug: skia:8975
> Change-Id: I8d4e2071f1a8ee8a5702ac62ffc4000379d4fc43
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207854
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,brianosman@google.com,chinmaygarde@google.com

Change-Id: I0f9e6e5da2c17f789a4599042b9ae3a1ba412987
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8975
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209680
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This commit is contained in:
Mike Klein 2019-04-22 18:09:35 +00:00 committed by Skia Commit-Bot
parent 5f78adf890
commit 86e61993a9
3 changed files with 38 additions and 24 deletions

View File

@ -13,7 +13,6 @@
#include <stdint.h>
#include <stddef.h>
#include "SkApi.h"
#ifdef __cplusplus
#define SK_C_PLUS_PLUS_BEGIN_GUARD extern "C" {
@ -24,6 +23,22 @@
#define SK_C_PLUS_PLUS_END_GUARD
#endif
#if !defined(SK_API)
#if defined(SKIA_DLL)
#if defined(_MSC_VER)
#if SKIA_IMPLEMENTATION
#define SK_API __declspec(dllexport)
#else
#define SK_API __declspec(dllimport)
#endif
#else
#define SK_API __attribute__((visibility("default")))
#endif
#else
#define SK_API
#endif
#endif
///////////////////////////////////////////////////////////////////////////////////////
SK_C_PLUS_PLUS_BEGIN_GUARD

View File

@ -1,21 +0,0 @@
/*
* Copyright 2019 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkApi_DEFINED
#define SkApi_DEFINED
#if defined(SKIA_IMPLEMENTATION)
#if defined(_MSC_VER)
#define SK_API __declspec(dllexport)
#else
#define SK_API __attribute__((visibility("default")))
#endif
#else
#define SK_API
#endif
#endif//SkApi_DEFINED

View File

@ -10,8 +10,6 @@
#ifndef SkPreConfig_DEFINED
#define SkPreConfig_DEFINED
#include "SkApi.h"
// Allows embedders that want to disable macros that take arguments to just
// define that symbol to be one of these
#define SK_NOTHING_ARG1(arg1)
@ -177,4 +175,26 @@
#define SK_ARM_HAS_CRC32
#endif
//////////////////////////////////////////////////////////////////////
#if !defined(SKIA_IMPLEMENTATION)
#define SKIA_IMPLEMENTATION 0
#endif
#if !defined(SK_API)
#if defined(SKIA_DLL)
#if defined(_MSC_VER)
#if SKIA_IMPLEMENTATION
#define SK_API __declspec(dllexport)
#else
#define SK_API __declspec(dllimport)
#endif
#else
#define SK_API __attribute__((visibility("default")))
#endif
#else
#define SK_API
#endif
#endif
#endif