From 79c69bea02dea65d7093922776e55bb656122000 Mon Sep 17 00:00:00 2001 From: Oleg Bogdanov Date: Tue, 24 Mar 2020 18:49:52 -0700 Subject: [PATCH] hermes | inspector | Don't include posix headers on non-posix systems Summary: Changelog: [Internal] Hermes inspector includes pthreads, arpa and sys headers on all OSes that would break vanilla Windows builds. This diff adds a check for posix-compliance before inclusion (Note: this ignores all push blocking failures!) Reviewed By: dulinriley Differential Revision: D20564449 fbshipit-source-id: 8e264bc3104065dc4315bb291e8560609fe65184 --- .../inspector/chrome/AutoAttachUtils.cpp | 19 +++++++++++++++++++ .../inspector/detail/SerialExecutor.cpp | 2 -- ReactCommon/hermes/inspector/detail/Thread.h | 4 +++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ReactCommon/hermes/inspector/chrome/AutoAttachUtils.cpp b/ReactCommon/hermes/inspector/chrome/AutoAttachUtils.cpp index d1c284a419..70d7e5ebcd 100644 --- a/ReactCommon/hermes/inspector/chrome/AutoAttachUtils.cpp +++ b/ReactCommon/hermes/inspector/chrome/AutoAttachUtils.cpp @@ -7,6 +7,23 @@ #include "AutoAttachUtils.h" +#ifdef _WINDOWS +namespace facebook { +namespace hermes { +namespace inspector { +namespace chrome { +bool isNetworkInspected( + const std::string &, + const std::string &, + const std::string &) { + return false; +} +} // namespace chrome +} // namespace inspector +} // namespace hermes +} // namespace facebook + +#else #include #include #include @@ -130,3 +147,5 @@ bool isNetworkInspected( } // namespace inspector } // namespace hermes } // namespace facebook + +#endif diff --git a/ReactCommon/hermes/inspector/detail/SerialExecutor.cpp b/ReactCommon/hermes/inspector/detail/SerialExecutor.cpp index 85e0789a28..d9c32797dd 100644 --- a/ReactCommon/hermes/inspector/detail/SerialExecutor.cpp +++ b/ReactCommon/hermes/inspector/detail/SerialExecutor.cpp @@ -7,8 +7,6 @@ #include "SerialExecutor.h" -#include - namespace facebook { namespace hermes { namespace inspector { diff --git a/ReactCommon/hermes/inspector/detail/Thread.h b/ReactCommon/hermes/inspector/detail/Thread.h index f9194479e4..c4e832e28e 100644 --- a/ReactCommon/hermes/inspector/detail/Thread.h +++ b/ReactCommon/hermes/inspector/detail/Thread.h @@ -10,7 +10,9 @@ #include #include -#ifndef __ANDROID__ +#ifdef _WINDOWS +#include +#elif !defined(__ANDROID__) #include #include #endif