THRIFT-2139: MSVC 2012 Error - Cannot compile due to BoostThreadFactory
Client: cpp
Patch: Alex Loukissas
diff --git a/lib/cpp/libthrift.vcxproj b/lib/cpp/libthrift.vcxproj
index e9990a5..80ad22c 100644
--- a/lib/cpp/libthrift.vcxproj
+++ b/lib/cpp/libthrift.vcxproj
@@ -39,6 +39,7 @@
<ClCompile Include="src\thrift\concurrency\BoostMonitor.cpp" />
<ClCompile Include="src\thrift\concurrency\BoostMutex.cpp" />
<ClCompile Include="src\thrift\concurrency\BoostThreadFactory.cpp" />
+ <ClCompile Include="src\thrift\concurrency\StdThreadFactory.cpp" />
<ClCompile Include="src\thrift\concurrency\ThreadManager.cpp"/>
<ClCompile Include="src\thrift\concurrency\TimerManager.cpp"/>
<ClCompile Include="src\thrift\concurrency\Util.cpp"/>
@@ -87,6 +88,7 @@
<ItemGroup>
<ClInclude Include="src\thrift\async\TAsyncChannel.h" />
<ClInclude Include="src\thrift\concurrency\BoostThreadFactory.h" />
+ <ClInclude Include="src\thrift\concurrency\StdThreadFactory.h" />
<ClInclude Include="src\thrift\concurrency\Exception.h" />
<ClInclude Include="src\thrift\concurrency\PlatformThreadFactory.h" />
<ClInclude Include="src\thrift\processor\PeekProcessor.h" />
diff --git a/lib/cpp/libthrift.vcxproj.filters b/lib/cpp/libthrift.vcxproj.filters
index 3922988..ba21a83 100644
--- a/lib/cpp/libthrift.vcxproj.filters
+++ b/lib/cpp/libthrift.vcxproj.filters
@@ -93,6 +93,9 @@
<ClCompile Include="src\thrift\concurrency\BoostThreadFactory.cpp">
<Filter>concurrency</Filter>
</ClCompile>
+ <ClCompile Include="src\thrift\concurrency\StdThreadFactory.cpp">
+ <Filter>concurrency</Filter>
+ </ClCompile>
<ClCompile Include="src\thrift\windows\WinFcntl.cpp">
<Filter>windows</Filter>
</ClCompile>
@@ -212,6 +215,9 @@
<ClInclude Include="src\thrift\concurrency\BoostThreadFactory.h">
<Filter>concurrency</Filter>
</ClInclude>
+ <ClInclude Include="src\thrift\concurrency\StdThreadFactory.h">
+ <Filter>concurrency</Filter>
+ </ClInclude>
<ClInclude Include="src\thrift\concurrency\PlatformThreadFactory.h">
<Filter>concurrency</Filter>
</ClInclude>
diff --git a/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp b/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp
index decacce..25680a1 100644
--- a/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp
+++ b/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp
@@ -19,6 +19,8 @@
#include <thrift/thrift-config.h>
+#ifdef USE_BOOST_THREAD
+
#include <thrift/concurrency/BoostThreadFactory.h>
#include <thrift/concurrency/Exception.h>
@@ -178,3 +180,5 @@
Thread::id_t BoostThreadFactory::getCurrentThreadId() const { return impl_->getCurrentThreadId(); }
}}} // apache::thrift::concurrency
+
+#endif // USE_BOOST_THREAD
diff --git a/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp b/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp
index 3239bd9..1fdefd5 100644
--- a/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp
+++ b/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp
@@ -19,6 +19,8 @@
#include <thrift/thrift-config.h>
+#ifdef USE_STD_THREAD
+
#include <thrift/concurrency/StdThreadFactory.h>
#include <thrift/concurrency/Exception.h>
@@ -169,3 +171,5 @@
Thread::id_t StdThreadFactory::getCurrentThreadId() const { return impl_->getCurrentThreadId(); }
}}} // apache::thrift::concurrency
+
+#endif // USE_STD_THREAD