Commit 4b8e47d6 authored by Philip Pronin's avatar Philip Pronin Committed by Sara Golemon

fix build (gtest 1.6 -> 1.7)

Summary:
D1494614 migrated us to gtest 1.7 which broke multiple builds (with
"error: 'tuple' is already declared in this scope" coming from
https://code.google.com/p/googletest/source/detail?spec=svn621&r=621).
This diff makes folly compatible with both versions of gtest, and the rest
of fbcode is now compatible with gtest 1.7.

Test Plan: fbconfig -r folly unicorn/diskindex4 && fbmake opt -j32

Reviewed By: jiayan@fb.com

Subscribers: fbcode-common-diffs@, chaoyc, search-fbcode-diffs@, sdoroshenko, cold-storage-diffs@, unicorn-diffs@

FB internal diff: D1497389

Tasks: 4909974, 4910547, 4910567, 4909983
parent 3ff4b4f4
......@@ -16,10 +16,8 @@
#include <folly/io/Compression.h>
// Yes, tr1, as that's what gtest requires
#include <random>
#include <thread>
#include <tr1/tuple>
#include <unordered_map>
#include <boost/noncopyable.hpp>
......
......@@ -17,9 +17,6 @@
#include <folly/io/IOBuf.h>
#include <folly/io/TypedIOBuf.h>
// googletest requires std::tr1::tuple, not std::tuple
#include <tr1/tuple>
#include <gflags/gflags.h>
#include <boost/random.hpp>
#include <gtest/gtest.h>
......@@ -836,7 +833,11 @@ class MoveToFbStringTest
: public ::testing::TestWithParam<std::tr1::tuple<int, int, bool, BufType>> {
protected:
void SetUp() {
std::tr1::tie(elementSize_, elementCount_, shared_, type_) = GetParam();
elementSize_ = std::tr1::get<0>(GetParam());
elementCount_ = std::tr1::get<1>(GetParam());
shared_ = std::tr1::get<2>(GetParam());
type_ = std::tr1::get<3>(GetParam());
buf_ = makeBuf();
for (int i = 0; i < elementCount_ - 1; ++i) {
buf_->prependChain(makeBuf());
......
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