diff --git a/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp b/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp index d5acc2367ff39c..db4e0aa498449d 100644 --- a/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +++ b/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp @@ -153,7 +153,7 @@ void CatalystInstanceImpl::initializeBridge( moduleMessageQueue_)); instance_->initializeBridge( - folly::make_unique( + std::make_unique( callback, moduleMessageQueue_), jseh->getExecutorFactory(), diff --git a/ReactCommon/cxxreact/Instance.cpp b/ReactCommon/cxxreact/Instance.cpp index 23723fbbe27bce..a9b6bd5623a53c 100644 --- a/ReactCommon/cxxreact/Instance.cpp +++ b/ReactCommon/cxxreact/Instance.cpp @@ -43,7 +43,6 @@ void Instance::initializeBridge( std::shared_ptr moduleRegistry) { callback_ = std::move(callback); moduleRegistry_ = std::move(moduleRegistry); - jsQueue->runOnQueueSync([this, &jsef, jsQueue]() mutable { nativeToJsBridge_ = folly::make_unique( jsef.get(), moduleRegistry_, jsQueue, callback_); diff --git a/ReactCommon/cxxreact/JSBigString.h b/ReactCommon/cxxreact/JSBigString.h index e3cc5af292e7ad..55bc7e8ed1ed01 100644 --- a/ReactCommon/cxxreact/JSBigString.h +++ b/ReactCommon/cxxreact/JSBigString.h @@ -6,6 +6,7 @@ #pragma once #include +#include #include #include diff --git a/ReactCommon/cxxreact/JSExecutor.h b/ReactCommon/cxxreact/JSExecutor.h index c5069df308b249..4e8d682c0fb067 100644 --- a/ReactCommon/cxxreact/JSExecutor.h +++ b/ReactCommon/cxxreact/JSExecutor.h @@ -82,8 +82,7 @@ class RN_EXPORT JSExecutor { */ virtual void invokeCallback(const double callbackId, const folly::dynamic& arguments) = 0; - virtual void setGlobalVariable(std::string propName, - std::unique_ptr jsonValue) = 0; + virtual void setGlobalVariable(std::string propName, std::unique_ptr jsonValue) = 0; virtual void* getJavaScriptContext() { return nullptr; diff --git a/ReactCommon/cxxreact/JsArgumentHelpers-inl.h b/ReactCommon/cxxreact/JsArgumentHelpers-inl.h index f5877556b55375..eaea3d1a081a49 100644 --- a/ReactCommon/cxxreact/JsArgumentHelpers-inl.h +++ b/ReactCommon/cxxreact/JsArgumentHelpers-inl.h @@ -4,6 +4,7 @@ // LICENSE file in the root directory of this source tree. #pragma once +#include namespace facebook { namespace xplat { diff --git a/ReactCommon/cxxreact/NativeToJsBridge.cpp b/ReactCommon/cxxreact/NativeToJsBridge.cpp index 4cb428d9750d53..b5401267d35493 100644 --- a/ReactCommon/cxxreact/NativeToJsBridge.cpp +++ b/ReactCommon/cxxreact/NativeToJsBridge.cpp @@ -103,6 +103,7 @@ void NativeToJsBridge::loadApplication( std::unique_ptr bundleRegistry, std::unique_ptr startupScript, std::string startupScriptSourceURL) { + runOnExecutorQueue( [this, bundleRegistryWrap=folly::makeMoveWrapper(std::move(bundleRegistry)), diff --git a/ReactCommon/jsi/JSCRuntime.cpp b/ReactCommon/jsi/JSCRuntime.cpp index 92b1ac385ff2b4..b1cbc68cd33aef 100644 --- a/ReactCommon/jsi/JSCRuntime.cpp +++ b/ReactCommon/jsi/JSCRuntime.cpp @@ -200,7 +200,11 @@ class JSCRuntime : public jsi::Runtime { #endif }; -#if __has_builtin(__builtin_expect) +#ifndef __has_builtin +#define __has_builtin(x) 0 +#endif + +#if __has_builtin(__builtin_expect) || defined(__GNUC__) #define JSC_LIKELY(EXPR) __builtin_expect((bool)(EXPR), true) #define JSC_UNLIKELY(EXPR) __builtin_expect((bool)(EXPR), false) #else diff --git a/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp b/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp index dbb9560ca94b37..15414107b85635 100644 --- a/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp +++ b/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp @@ -14,6 +14,7 @@ #include #include +#include #include using namespace facebook::jsi; diff --git a/ReactCommon/microprofiler/MicroProfiler.cpp b/ReactCommon/microprofiler/MicroProfiler.cpp index 8bee8cd75eb628..f20b3315c9eed4 100644 --- a/ReactCommon/microprofiler/MicroProfiler.cpp +++ b/ReactCommon/microprofiler/MicroProfiler.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -17,7 +18,7 @@ // we can get rid of this #if defined(__APPLE__) #define MICRO_PROFILER_STUB_IMPLEMENTATION 1 -#else +#elif !defined(MICRO_PROFILER_STUB_IMPLEMENTATION) #define MICRO_PROFILER_STUB_IMPLEMENTATION 0 #endif