Commit 58132d07 authored by Sean Cannella's avatar Sean Cannella Committed by Andrii Grynenko

Port compilation fixes (1/3)

Test Plan: existing tests

Reviewed By: meyering@fb.com

Subscribers: trunkagent, bmatheny, ranjeeth, njormrod, subodh

FB internal diff: D1605942

Tasks: 5183325
parent 8cfe199f
......@@ -274,7 +274,7 @@ class RWSpinLock : boost::noncopyable {
lock_->lock_shared();
}
ReadHolder(ReadHolder&& other) : lock_(other.lock_) {
ReadHolder(ReadHolder&& other) noexcept : lock_(other.lock_) {
other.lock_ = nullptr;
}
......@@ -333,7 +333,7 @@ class RWSpinLock : boost::noncopyable {
if (lock_) lock_->unlock_and_lock_upgrade();
}
UpgradedHolder(UpgradedHolder&& other) : lock_(other.lock_) {
UpgradedHolder(UpgradedHolder&& other) noexcept : lock_(other.lock_) {
other.lock_ = nullptr;
}
......@@ -383,7 +383,7 @@ class RWSpinLock : boost::noncopyable {
if (lock_) lock_->unlock_upgrade_and_lock();
}
WriteHolder(WriteHolder&& other) : lock_(other.lock_) {
WriteHolder(WriteHolder&& other) noexcept : lock_(other.lock_) {
other.lock_ = nullptr;
}
......
......@@ -20,13 +20,13 @@
#include <sys/socket.h>
#include <sys/un.h>
#include <netinet/in.h>
#include <features.h>
#include <netdb.h>
#include <cstddef>
#include <iostream>
#include <string>
#include <folly/IPAddress.h>
#include <folly/Portability.h>
namespace folly {
......
......@@ -93,7 +93,7 @@ std::string stringVPrintf(const char* format, va_list ap) {
// the format string size, or 32 bytes, whichever is larger. This
// is a hueristic that doesn't affect correctness but attempts to be
// reasonably fast for the most common cases.
std::string ret(std::max(32UL, strlen(format) * 2), '\0');
std::string ret(std::max(size_t(32), strlen(format) * 2), '\0');
ret.resize(0);
stringPrintfImpl(ret, format, ap);
......@@ -330,7 +330,8 @@ fbstring errnoStr(int err) {
// https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/strerror_r.3.html
// http://www.kernel.org/doc/man-pages/online/pages/man3/strerror.3.html
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__CYGWIN__) ||\
#if defined(__APPLE__) || defined(__FreeBSD__) ||\
defined(__CYGWIN__) || defined(__ANDROID__) ||\
((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE)
// Using XSI-compatible strerror_r
int r = strerror_r(err, buf, sizeof(buf));
......
......@@ -23,7 +23,7 @@ namespace folly {
// This looks a bit weird, but it's necessary to avoid
// having an undefined compiler function called.
#if defined(__GLIBC__) && !defined(__APPLE__)
#if defined(__GLIBC__) && !defined(__APPLE__) && !defined(__ANDROID__)
#if __GLIBC_PREREQ(2, 12)
# define FOLLY_GLIBC_2_12
#endif
......
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