From 25eae60c4c8145553a50d536dac922a5b65bcee6 Mon Sep 17 00:00:00 2001
From: Eric Fiselier <eric@efcs.ca>
Date: Tue, 2 Aug 2016 19:33:41 -0600
Subject: [PATCH] Attempt to fix MSVC build failures

---
 include/benchmark/benchmark_api.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/benchmark/benchmark_api.h b/include/benchmark/benchmark_api.h
index 5961c9bb..cced8cf0 100644
--- a/include/benchmark/benchmark_api.h
+++ b/include/benchmark/benchmark_api.h
@@ -660,8 +660,10 @@ internal::Benchmark* RegisterBenchmark(const char* name, Lambda&& fn) {
     return internal::RegisterBenchmarkInternal(
         ::new BenchType(name, std::forward<Lambda>(fn)));
 }
+#endif
 
-#if !defined(BENCHMARK_GCC_VERSION) || BENCHMARK_GCC_VERSION >= 409
+#if defined(BENCHMARK_HAS_CXX11) && \
+     (!defined(BENCHMARK_GCC_VERSION) || BENCHMARK_GCC_VERSION >= 409)
 template <class Lambda, class ...Args>
 internal::Benchmark* RegisterBenchmark(const char* name, Lambda&& fn,
                                        Args&&... args) {
@@ -671,7 +673,7 @@ internal::Benchmark* RegisterBenchmark(const char* name, Lambda&& fn,
 #else
 #define BENCHMARK_HAS_NO_VARIADIC_REGISTER_BENCHMARK
 #endif
-#endif // BENCHMARK_HAS_CXX11
+
 
 // The base class for all fixture tests.
 class Fixture: public internal::Benchmark {