Commit 5a40209a authored by Yangqing Jia's avatar Yangqing Jia Committed by Facebook Github Bot

folly: changes to make nvcc happy

Summary:
(1) small_vector.h line 1099: wrap the default return in an else statement to
avoid compiler warning of "unreachable statement".
(2) Constexpr.h: need to treat cudacc similarly to msvc.

(Note: this ignores all push blocking failures!)

Reviewed By: dzhulgakov

Differential Revision: D5387061

fbshipit-source-id: f002ab5ec00d4dcd85d86386f87a0327023afa1b
parent f634a701
...@@ -101,7 +101,7 @@ template <> ...@@ -101,7 +101,7 @@ template <>
constexpr size_t constexpr_strlen(const char* s) { constexpr size_t constexpr_strlen(const char* s) {
#if defined(__clang__) #if defined(__clang__)
return __builtin_strlen(s); return __builtin_strlen(s);
#elif defined(_MSC_VER) #elif defined(_MSC_VER) || defined(__CUDACC__)
return detail::constexpr_strlen_internal(s, 0); return detail::constexpr_strlen_internal(s, 0);
#else #else
return std::strlen(s); return std::strlen(s);
......
...@@ -1095,10 +1095,10 @@ private: ...@@ -1095,10 +1095,10 @@ private:
value_type* heap() noexcept { value_type* heap() noexcept {
if (kHasInlineCapacity || !detail::pointerFlagGet(pdata_.heap_)) { if (kHasInlineCapacity || !detail::pointerFlagGet(pdata_.heap_)) {
return static_cast<value_type*>(pdata_.heap_); return static_cast<value_type*>(pdata_.heap_);
} else {
return static_cast<value_type*>(detail::shiftPointer(
detail::pointerFlagClear(pdata_.heap_), kHeapifyCapacitySize));
} }
return static_cast<value_type*>(
detail::shiftPointer(
detail::pointerFlagClear(pdata_.heap_), kHeapifyCapacitySize));
} }
value_type const* heap() const noexcept { value_type const* heap() const noexcept {
return const_cast<Data*>(this)->heap(); return const_cast<Data*>(this)->heap();
......
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