Skip to content

Instantly share code, notes, and snippets.

@dmorilha
Last active August 29, 2015 14:13
Show Gist options
  • Save dmorilha/10ab1090d0f374c75902 to your computer and use it in GitHub Desktop.
Save dmorilha/10ab1090d0f374c75902 to your computer and use it in GitHub Desktop.
boost-coroutine-cpp11 patch
diff -ru boost_1_57_0.old/libs/coroutine/src/posix/stack_traits.cpp boost_1_57_0/libs/coroutine/src/posix/stack_traits.cpp
--- boost_1_57_0.old/libs/coroutine/src/posix/stack_traits.cpp 2014-10-24 14:58:50.000000000 +0000
+++ boost_1_57_0/libs/coroutine/src/posix/stack_traits.cpp 2015-01-14 11:25:07.399008597 +0000
@@ -19,7 +19,14 @@
#include <cmath>
#include <boost/assert.hpp>
+
+#if __cplusplus >= 201100L
+#include <mutex>
+#define BOOST_THREAD_NS std
+#else
#include <boost/thread.hpp>
+#define BOOST_THREAD_NS boost
+#endif
#if !defined (SIGSTKSZ)
# define SIGSTKSZ (8 * 1024)
@@ -53,16 +60,16 @@
std::size_t pagesize()
{
static std::size_t size = 0;
- static boost::once_flag flag;
- boost::call_once( flag, pagesize_, & size);
+ static BOOST_THREAD_NS::once_flag flag;
+ BOOST_THREAD_NS::call_once( flag, pagesize_, & size);
return size;
}
rlimit stacksize_limit()
{
static rlimit limit;
- static boost::once_flag flag;
- boost::call_once( flag, stacksize_limit_, & limit);
+ static BOOST_THREAD_NS::once_flag flag;
+ BOOST_THREAD_NS::call_once( flag, stacksize_limit_, & limit);
return limit;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment