Commit 4ad9455e authored by James Donald's avatar James Donald Committed by Facebook Github Bot

Make defined(__linux__) checks consistent for -Wundef

Reviewed By: yfeldblum

Differential Revision: D19235483

fbshipit-source-id: 5caea4efb3e811f78f1be3f05adc315bccb0fc0d
parent 7e693d01
......@@ -20,7 +20,7 @@
#include <folly/Subprocess.h>
#if __linux__
#if defined(__linux__)
#include <sys/prctl.h>
#endif
#include <fcntl.h>
......@@ -546,7 +546,7 @@ int Subprocess::prepareChild(
}
}
#if __linux__
#if defined(__linux__)
// Opt to receive signal on parent death, if requested
if (options.parentDeathSignal_ != 0) {
const auto parentDeathSignal =
......
......@@ -383,7 +383,7 @@ class Subprocess {
return *this;
}
#if __linux__
#if defined(__linux__)
/**
* Child will receive a signal when the parent *thread* exits.
*
......@@ -463,7 +463,7 @@ class Subprocess {
return *this;
}
#if __linux__
#if defined(__linux__)
/**
* This is an experimental feature, it is best you don't use it at this
* point of time.
......@@ -494,12 +494,12 @@ class Subprocess {
bool processGroupLeader_{false};
bool detach_{false};
std::string childDir_; // "" keeps the parent's working directory
#if __linux__
#if defined(__linux__)
int parentDeathSignal_{0};
#endif
DangerousPostForkPreExecCallback* dangerousPostForkPreExecCallback_{
nullptr};
#if __linux__
#if defined(__linux__)
// none means `vfork()` instead of a custom `clone()`
// Optional<> is used because value of '0' means do clone without any flags.
Optional<clone_flags_t> cloneFlags_;
......
......@@ -16,7 +16,7 @@
#pragma once
#if __linux__ && !__ANDROID__
#if defined(__linux__) && !defined(__ANDROID__)
#define FOLLY_HAVE_TIMERFD
#endif
......
......@@ -277,7 +277,7 @@ void AsyncServerSocket::useExistingSockets(
SocketAddress address;
address.setFromLocalAddress(fd);
#if __linux__
#if defined(__linux__)
if (noTransparentTls_) {
// Ignore return value, errors are ok
netops::setsockopt(fd, SOL_SOCKET, SO_NO_TRANSPARENT_TLS, nullptr, 0);
......@@ -315,7 +315,7 @@ void AsyncServerSocket::bindSocket(
}
}
#if __linux__
#if defined(__linux__)
if (noTransparentTls_) {
// Ignore return value, errors are ok
netops::setsockopt(fd, SOL_SOCKET, SO_NO_TRANSPARENT_TLS, nullptr, 0);
......@@ -451,7 +451,7 @@ void AsyncServerSocket::bind(uint16_t port) {
SocketAddress::getFamilyNameFrom(res->ai_addr, "<unknown>"));
}
#if __linux__
#if defined(__linux__)
if (noTransparentTls_) {
// Ignore return value, errors are ok
netops::setsockopt(s, SOL_SOCKET, SO_NO_TRANSPARENT_TLS, nullptr, 0);
......
......@@ -36,7 +36,7 @@
#include <sstream>
#include <thread>
#if __linux__
#if defined(__linux__)
#include <linux/sockios.h>
#include <sys/ioctl.h>
#endif
......@@ -268,7 +268,7 @@ void disableTransparentFunctions(
(void)fd;
(void)noTransparentTls;
(void)noTSocks;
#if __linux__
#if defined(__linux__)
if (noTransparentTls) {
// Ignore return value, errors are ok
VLOG(5) << "Disabling TTLS for fd " << fd;
......@@ -1731,7 +1731,7 @@ int AsyncSocket::setRecvBufSize(size_t bufsize) {
return 0;
}
#if __linux__
#if defined(__linux__)
size_t AsyncSocket::getSendBufInUse() const {
if (fd_ == NetworkSocket()) {
std::stringstream issueString;
......
......@@ -727,7 +727,7 @@ class AsyncSocket : virtual public AsyncTransportWrapper {
*/
int setRecvBufSize(size_t bufsize);
#if __linux__
#if defined(__linux__)
/**
* @brief This method is used to get the number of bytes that are currently
* stored in the TCP send/tx buffer
......
......@@ -40,7 +40,7 @@
#include <glog/logging.h>
#if __linux__ && !__ANDROID__
#if defined(__linux__) && !defined(__ANDROID__)
#define FOLLY_HAVE_EVENTFD
#include <folly/io/async/EventFDWrapper.h>
#endif
......
......@@ -3751,7 +3751,7 @@ TEST(AsyncSocketTest, V4TosReflectTest) {
}
#endif
#if __linux__
#if defined(__linux__)
TEST(AsyncSocketTest, getBufInUse) {
EventBase eventBase;
std::shared_ptr<AsyncServerSocket> server(
......
......@@ -25,7 +25,7 @@
// Android only, prctl is only used when pthread_setname_np
// and pthread_getname_np are not avilable.
#if __linux__
#if defined(__linux__)
#define FOLLY_DETAIL_HAS_PRCTL_PR_SET_NAME 1
#else
#define FOLLY_DETAIL_HAS_PRCTL_PR_SET_NAME 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment