From f4a80a41dfe13820e810d539b5c97d0360680f40 Mon Sep 17 00:00:00 2001
From: Michael Lee <mzlee@fb.com>
Date: Mon, 14 Mar 2016 18:54:37 -0700
Subject: [PATCH] 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
---
 folly/test/ApplyTupleTest.cpp    | 1 +
 folly/test/CacheLocalityTest.cpp | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/folly/test/ApplyTupleTest.cpp b/folly/test/ApplyTupleTest.cpp
index 395cdfed..aad25c11 100644
--- a/folly/test/ApplyTupleTest.cpp
+++ b/folly/test/ApplyTupleTest.cpp
@@ -19,6 +19,7 @@
 #include <folly/ApplyTuple.h>
 #include <gtest/gtest.h>
 
+#include <array>
 #include <memory>
 
 // this placates visual studio stupidity - see
diff --git a/folly/test/CacheLocalityTest.cpp b/folly/test/CacheLocalityTest.cpp
index eb600fe6..9c326fde 100644
--- a/folly/test/CacheLocalityTest.cpp
+++ b/folly/test/CacheLocalityTest.cpp
@@ -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
-- 
2.34.1