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
This commit is contained in:
Oleg Bogdanov 2020-03-24 18:49:52 -07:00 коммит произвёл Facebook GitHub Bot
Родитель 05e2ec601b
Коммит 79c69bea02
3 изменённых файлов: 22 добавлений и 3 удалений

Просмотреть файл

@ -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 <arpa/inet.h>
#include <sys/socket.h>
#include <unistd.h>
@ -130,3 +147,5 @@ bool isNetworkInspected(
} // namespace inspector
} // namespace hermes
} // namespace facebook
#endif

Просмотреть файл

@ -7,8 +7,6 @@
#include "SerialExecutor.h"
#include <pthread.h>
namespace facebook {
namespace hermes {
namespace inspector {

Просмотреть файл

@ -10,7 +10,9 @@
#include <functional>
#include <memory>
#ifndef __ANDROID__
#ifdef _WINDOWS
#include <thread>
#elif !defined(__ANDROID__)
#include <pthread.h>
#include <thread>
#endif