Fix fibers build on older boost
authorYedidya Feldblum <yfeldblum@fb.com>
Thu, 19 Oct 2017 18:37:54 +0000 (11:37 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 19 Oct 2017 18:54:21 +0000 (11:54 -0700)
Summary:
[Folly] Fix `folly/fibers/` build on older boost.

Where `jump_fcontext` takes `intptr_t` rather than an actual pointer, and we warn about implicit conversions from pointers to integral types.

Reviewed By: Orvid

Differential Revision: D6098230

fbshipit-source-id: 61bd7bdff5de728d3febe8b35c97d024ab6f236a

folly/fibers/BoostContextCompatibility.h

index 2f6cc127e32c29708051fe32cd91827708ab9df9..5531684adaed2864ad71c16c61ff2003954674cc 100644 (file)
@@ -106,9 +106,9 @@ class FiberImpl {
         boost::context::jump_fcontext(&fiberContext_, mainContext_, 0);
 #elif BOOST_VERSION >= 105200
     auto context =
         boost::context::jump_fcontext(&fiberContext_, mainContext_, 0);
 #elif BOOST_VERSION >= 105200
     auto context =
-        boost::context::jump_fcontext(fiberContext_, &mainContext_, nullptr);
+        boost::context::jump_fcontext(fiberContext_, &mainContext_, 0);
 #else
 #else
-    auto context = jump_fcontext(&fiberContext_, &mainContext_, nullptr);
+    auto context = jump_fcontext(&fiberContext_, &mainContext_, 0);
 #endif
     DCHECK_EQ(this, reinterpret_cast<FiberImpl*>(context));
   }
 #endif
     DCHECK_EQ(this, reinterpret_cast<FiberImpl*>(context));
   }