Commit f4a80a41 authored by Michael Lee's avatar Michael Lee Committed by Facebook Github Bot 9

Missing guards for FOLLY_TLS in test

Summary:defined(FOLLY_TLS) is guarded once in the test, so we should
guard for it throughout.  Also a missing header for some platforms.

Reviewed By: yfeldblum

Differential Revision: D3049797

fb-gh-sync-id: 5d66c71dda94c57a2e50aee96d55be1c574bf921
shipit-source-id: 5d66c71dda94c57a2e50aee96d55be1c574bf921
parent b1e0c2c8
......@@ -19,6 +19,7 @@
#include <folly/ApplyTuple.h>
#include <gtest/gtest.h>
#include <array>
#include <memory>
// this placates visual studio stupidity - see
......
......@@ -387,6 +387,7 @@ TEST(ThreadId, SimplePthread) {
EXPECT_EQ(cpu, again);
}
#ifdef FOLLY_TLS
static FOLLY_TLS unsigned testingCpu = 0;
static int testingGetcpu(unsigned* cpu, unsigned* node, void* /* unused */) {
......@@ -398,6 +399,7 @@ static int testingGetcpu(unsigned* cpu, unsigned* node, void* /* unused */) {
}
return 0;
}
#endif
TEST(AccessSpreader, Simple) {
for (size_t s = 1; s < 200; ++s) {
......@@ -405,6 +407,7 @@ TEST(AccessSpreader, Simple) {
}
}
#ifdef FOLLY_TLS
#define DECLARE_SPREADER_TAG(tag, locality, func) \
namespace { \
template <typename dummy> \
......@@ -442,3 +445,4 @@ TEST(AccessSpreader, Wrapping) {
}
}
}
#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