Shift the implementation of setThreadName out of the header
[folly.git] / folly / test / ThreadNameTest.cpp
index 1b3b043df35d0f4954170cc5a70a0aecd3ff7e23..57eae214578a7ecf960a770269b9ade4a2221114 100644 (file)
 using namespace std;
 using namespace folly;
 
-static constexpr bool expectedSetOtherThreadNameResult =
-#ifdef FOLLY_HAS_PTHREAD_SETNAME_NP_THREAD_NAME
-    true
-#else
-    false // This system has no known way to set the name of another thread
-#endif
-    ;
-
-static constexpr bool expectedSetSelfThreadNameResult =
-#if defined(FOLLY_HAS_PTHREAD_SETNAME_NP_THREAD_NAME) || \
-    defined(FOLLY_HAS_PTHREAD_SETNAME_NP_NAME)
-    true
-#else
-    false // This system has no known way to set its own thread name
-#endif
-    ;
+static bool expectedSetOtherThreadNameResult = folly::canSetOtherThreadName();
+static bool expectedSetSelfThreadNameResult = folly::canSetCurrentThreadName();
 
 TEST(ThreadName, setThreadName_self) {
   thread th([] {