Skip to content

Commit 78be6ef

Browse files
empyricalfacebook-github-bot
authored andcommitted
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](https://github.com/facebook/react-native/blob/8beb4bb58ab93af8c95af6844230d62c85ccab78/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: #23367 Differential Revision: D14032507 Pulled By: cpojer fbshipit-source-id: 701c13e3509cc244dbe0c15f92067fae4382bee2
1 parent aefb059 commit 78be6ef

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ReactCommon/jsi/jsi.h

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Facebook, Inc. and its affiliates.
22
//
33
// This source code is licensed under the MIT license found in the
4-
// LICENSE file in the root directory of this source tree.
4+
// LICENSE file in the root directory of this source tree.
55

66
#pragma once
77

@@ -14,8 +14,12 @@
1414
#include <vector>
1515

1616
#ifndef JSI_EXPORT
17+
#ifdef _MSC_VER
18+
#define JSI_EXPORT
19+
#else
1720
#define JSI_EXPORT __attribute__((visibility("default")))
1821
#endif
22+
#endif
1923

2024
class FBJSRuntime;
2125
namespace facebook {
@@ -300,8 +304,8 @@ class PropNameID : public Pointer {
300304
public:
301305
using Pointer::Pointer;
302306

303-
PropNameID(Runtime& runtime, const PropNameID& other)
304-
: PropNameID(runtime.clonePropNameID(other.ptr_)) {}
307+
PropNameID(Runtime &runtime, const PropNameID &other)
308+
: Pointer(runtime.clonePropNameID(other.ptr_)) {}
305309

306310
PropNameID(PropNameID&& other) = default;
307311
PropNameID& operator=(PropNameID&& other) = default;

0 commit comments

Comments
 (0)