JSI: Minor tweaks for building on MSVC (#23367)

Summary:
This pull request makes two minor changes to `jsi.h`:

 * Tweak the `JSI_EXPORT` macro to automatically set itself to an empty value if `_MSC_VER` is defined - like how was done by acoates-ms [here](8beb4bb58a/ReactCommon/cxxreact/JSBigString.h (L15-L21)).
 * Tweak the call to constructor `Pointer(Runtime::PointerValue* ptr)` in the constructor for `PropNameID`. I am not sure why MSVC wasn't working with the original version, but it compiles after I tweak that.

[General] [Fixed] - Tweaked `jsi.h` to build on MSVC
Pull Request resolved: https://github.com/facebook/react-native/pull/23367

Differential Revision: D14032507

Pulled By: cpojer

fbshipit-source-id: 701c13e3509cc244dbe0c15f92067fae4382bee2
This commit is contained in:
empyrical
2019-02-11 15:37:00 -08:00
committed by Facebook Github Bot
parent aefb05941a
commit 78be6efda9

View File

@@ -1,7 +1,7 @@
// Copyright (c) Facebook, Inc. and its affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
// LICENSE file in the root directory of this source tree.
#pragma once
@@ -14,8 +14,12 @@
#include <vector>
#ifndef JSI_EXPORT
#ifdef _MSC_VER
#define JSI_EXPORT
#else
#define JSI_EXPORT __attribute__((visibility("default")))
#endif
#endif
class FBJSRuntime;
namespace facebook {
@@ -300,8 +304,8 @@ class PropNameID : public Pointer {
public:
using Pointer::Pointer;
PropNameID(Runtime& runtime, const PropNameID& other)
: PropNameID(runtime.clonePropNameID(other.ptr_)) {}
PropNameID(Runtime &runtime, const PropNameID &other)
: Pointer(runtime.clonePropNameID(other.ptr_)) {}
PropNameID(PropNameID&& other) = default;
PropNameID& operator=(PropNameID&& other) = default;