folly: remove template argument to std::abs to fix build with libc++
authorIgor Sugak <sugak@fb.com>
Tue, 2 Aug 2016 01:06:41 +0000 (18:06 -0700)
committerFacebook Github Bot 3 <facebook-github-bot-3-bot@fb.com>
Tue, 2 Aug 2016 01:08:30 +0000 (18:08 -0700)
Summary:
libc++ doesn't implement `std::abs` as template.

```lang=bash
./../folly/fibers/Fiber.h:68:34: error: unexpected type name 'intptr_t': expected
      expression
    const size_t size = std::abs<intptr_t>(
                                 ^
```

Reviewed By: markisaa

Differential Revision: D3645584

fbshipit-source-id: a2d672137f110b975412a94ae4c6d00da0bd0d43

folly/fibers/Fiber.h

index 29269b282fc599e6b7c2ebcd5caefd1fc2e59f76..13f435de501c063ca20a73dd007c3cd47d0a1f88 100644 (file)
@@ -64,7 +64,7 @@ class Fiber {
   std::pair<void*, size_t> getStack() const {
     void* const stack =
         std::min<void*>(fcontext_.stackLimit(), fcontext_.stackBase());
   std::pair<void*, size_t> getStack() const {
     void* const stack =
         std::min<void*>(fcontext_.stackLimit(), fcontext_.stackBase());
-    const size_t size = std::abs<intptr_t>(
+    const size_t size = std::abs(
         reinterpret_cast<intptr_t>(fcontext_.stackBase()) -
         reinterpret_cast<intptr_t>(fcontext_.stackLimit()));
     return {stack, size};
         reinterpret_cast<intptr_t>(fcontext_.stackBase()) -
         reinterpret_cast<intptr_t>(fcontext_.stackLimit()));
     return {stack, size};