Permalink
Browse files

Backport fix from https://svn.boost.org/trac/boost/ticket/6940

This allows passenger to build on Fedora 18/19.
  • Loading branch information...
1 parent 22ebf34 commit 27894da4c7a5da30ef7ab4b03f914d1dec8531ac @FooBarWidget FooBarWidget committed Aug 26, 2012
View
2 NEWS
@@ -3,6 +3,8 @@ Release 3.0.16
* Fixed a Ruby 1.9 encoding-related bug in the memory measurer.
(Phusion Passenger Enterprise)
+ * Fixed OOM adjustment bugs on Linux.
+ * Fixed compilation problems on Fedora 18 and 19.
Release 3.0.15
@@ -102,6 +102,18 @@
# define BOOST_HAS_STATIC_ASSERT
#endif
+//
+// constexpr workarounds
+//
+#if defined(BOOST_NO_CONSTEXPR)
+#define BOOST_CONSTEXPR
+#define BOOST_CONSTEXPR_OR_CONST const
+#else
+#define BOOST_CONSTEXPR constexpr
+#define BOOST_CONSTEXPR_OR_CONST constexpr
+#endif
+#define BOOST_STATIC_CONSTEXPR static BOOST_CONSTEXPR_OR_CONST
+
//
// if there is no __int64 then there is no specialisation
// for numeric_limits<__int64> either:
@@ -365,7 +365,7 @@ namespace boost
cond.timed_wait(lock, xt);
# endif
xtime cur;
- xtime_get(&cur, TIME_UTC);
+ xtime_get(&cur, TIME_UTC_);
if (xtime_cmp(xt, cur) <= 0)
return;
}
@@ -380,7 +380,7 @@ namespace boost
BOOST_VERIFY(!pthread_yield());
# else
xtime xt;
- xtime_get(&xt, TIME_UTC);
+ xtime_get(&xt, TIME_UTC_);
sleep(xt);
# endif
}
@@ -20,8 +20,8 @@ const int NANOSECONDS_PER_MICROSECOND = 1000;
inline void to_time(int milliseconds, boost::xtime& xt)
{
int res = 0;
- res = boost::xtime_get(&xt, boost::TIME_UTC);
- BOOST_ASSERT(res == boost::TIME_UTC);
+ res = boost::xtime_get(&xt, boost::TIME_UTC_);
+ BOOST_ASSERT(res == boost::TIME_UTC_);
xt.sec += (milliseconds / MILLISECONDS_PER_SECOND);
xt.nsec += ((milliseconds % MILLISECONDS_PER_SECOND) *
@@ -57,8 +57,8 @@ inline void to_timespec_duration(const boost::xtime& xt, timespec& ts)
{
boost::xtime cur;
int res = 0;
- res = boost::xtime_get(&cur, boost::TIME_UTC);
- BOOST_ASSERT(res == boost::TIME_UTC);
+ res = boost::xtime_get(&cur, boost::TIME_UTC_);
+ BOOST_ASSERT(res == boost::TIME_UTC_);
if (boost::xtime_cmp(xt, cur) <= 0)
{
@@ -88,8 +88,8 @@ inline void to_duration(boost::xtime xt, int& milliseconds)
{
boost::xtime cur;
int res = 0;
- res = boost::xtime_get(&cur, boost::TIME_UTC);
- BOOST_ASSERT(res == boost::TIME_UTC);
+ res = boost::xtime_get(&cur, boost::TIME_UTC_);
+ BOOST_ASSERT(res == boost::TIME_UTC_);
if (boost::xtime_cmp(xt, cur) <= 0)
milliseconds = 0;
@@ -110,8 +110,8 @@ inline void to_microduration(boost::xtime xt, int& microseconds)
{
boost::xtime cur;
int res = 0;
- res = boost::xtime_get(&cur, boost::TIME_UTC);
- BOOST_ASSERT(res == boost::TIME_UTC);
+ res = boost::xtime_get(&cur, boost::TIME_UTC_);
+ BOOST_ASSERT(res == boost::TIME_UTC_);
if (boost::xtime_cmp(xt, cur) <= 0)
microseconds = 0;
@@ -164,9 +164,9 @@ namespace boost
struct adopt_lock_t
{};
- const defer_lock_t defer_lock={};
- const try_to_lock_t try_to_lock={};
- const adopt_lock_t adopt_lock={};
+ BOOST_CONSTEXPR_OR_CONST defer_lock_t defer_lock={};
+ BOOST_CONSTEXPR_OR_CONST try_to_lock_t try_to_lock={};
+ BOOST_CONSTEXPR_OR_CONST adopt_lock_t adopt_lock={};
template<typename Mutex>
class shared_lock;
@@ -20,7 +20,7 @@ namespace boost {
enum xtime_clock_types
{
- TIME_UTC=1
+ TIME_UTC_=1
// TIME_TAI,
// TIME_MONOTONIC,
// TIME_PROCESS,
@@ -68,7 +68,7 @@ inline xtime get_xtime(boost::system_time const& abs_time)
inline int xtime_get(struct xtime* xtp, int clock_type)
{
- if (clock_type == TIME_UTC)
+ if (clock_type == TIME_UTC_)
{
*xtp=get_xtime(get_system_time());
return clock_type;
@@ -718,7 +718,7 @@ class Pool: public ApplicationPool::Interface {
}
} else {
xtime xt;
- xtime_get(&xt, TIME_UTC);
+ xtime_get(&xt, TIME_UTC_);
xt.sec += maxIdleTime + 1;
if (cleanerThreadSleeper.timed_wait(l, xt)) {
// Condition was woken up.

0 comments on commit 27894da

Please sign in to comment.