Skip to content

Commit

Permalink
Merge branch 'master' into experimental
Browse files Browse the repository at this point in the history
Conflicts:
	ext/boost/src/pthread/timeconv.inl
	ext/boost/thread/locks.hpp
	ext/common/ApplicationPool/Pool.h
	ext/common/MessageChannel.h
  • Loading branch information
FooBarWidget committed Aug 26, 2012
2 parents d3d8766 + f111a54 commit e5b0f53
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 31 deletions.
5 changes: 5 additions & 0 deletions NEWS
Expand Up @@ -19,6 +19,11 @@ 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.
* Fixed compilation problems on SunOS.
* Fixed compilation problems on AIX. Contribution by Perry Smith.
* Fixed various compilation warnings.


Release 3.0.15
Expand Down
10 changes: 5 additions & 5 deletions ext/apache2/Hooks.cpp
Expand Up @@ -409,14 +409,14 @@ class Hooks {
len = strlen(filename);
if (len > 0 && filename[len - 1] == '/') {
pageCacheFile = apr_pstrcat(r->pool, filename,
"index.html", NULL);
"index.html", (char *) NULL);
} else {
pageCacheFile = apr_pstrcat(r->pool, filename,
".html", NULL);
".html", (char *) NULL);
}
} else {
pageCacheFile = apr_pstrcat(r->pool, filename,
".html", NULL);
".html", (char *) NULL);
}
if (!fileExists(pageCacheFile)) {
pageCacheFile = NULL;
Expand Down Expand Up @@ -803,7 +803,7 @@ class Hooks {
* Convert an HTTP header name to a CGI environment name.
*/
char *httpToEnv(apr_pool_t *p, const char *headerName) {
char *result = apr_pstrcat(p, "HTTP_", headerName, NULL);
char *result = apr_pstrcat(p, "HTTP_", headerName, (char *) NULL);
char *current = result + sizeof("HTTP_") - 1;

while (*current != '\0') {
Expand Down Expand Up @@ -913,7 +913,7 @@ class Hooks {
} else {
const char *request_uri;
if (r->args != NULL) {
request_uri = apr_pstrcat(r->pool, escapedUri, "?", r->args, NULL);
request_uri = apr_pstrcat(r->pool, escapedUri, "?", r->args, (char *) NULL);
} else {
request_uri = escapedUri;
}
Expand Down
12 changes: 12 additions & 0 deletions ext/boost/config/suffix.hpp
Expand Up @@ -110,6 +110,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:
Expand Down
4 changes: 2 additions & 2 deletions ext/boost/src/pthread/thread.cpp
Expand Up @@ -368,7 +368,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;
}
Expand All @@ -383,7 +383,7 @@ namespace boost
BOOST_VERIFY(!pthread_yield());
# else
xtime xt;
xtime_get(&xt, TIME_UTC);
xtime_get(&xt, TIME_UTC_);
sleep(xt);
# endif
}
Expand Down
16 changes: 8 additions & 8 deletions ext/boost/src/pthread/timeconv.inl
Expand Up @@ -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); (void)res;
res = boost::xtime_get(&xt, boost::TIME_UTC_);
BOOST_ASSERT(res == boost::TIME_UTC_); (void)res;

xt.sec += (milliseconds / MILLISECONDS_PER_SECOND);
xt.nsec += ((milliseconds % MILLISECONDS_PER_SECOND) *
Expand Down Expand Up @@ -56,8 +56,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); (void)res;
res = boost::xtime_get(&cur, boost::TIME_UTC_);
BOOST_ASSERT(res == boost::TIME_UTC_); (void)res;

if (boost::xtime_cmp(xt, cur) <= 0)
{
Expand Down Expand Up @@ -87,8 +87,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); (void)res;
res = boost::xtime_get(&cur, boost::TIME_UTC_);
BOOST_ASSERT(res == boost::TIME_UTC_); (void)res;

if (boost::xtime_cmp(xt, cur) <= 0)
milliseconds = 0;
Expand All @@ -109,8 +109,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); (void)res;
res = boost::xtime_get(&cur, boost::TIME_UTC_);
BOOST_ASSERT(res == boost::TIME_UTC_); (void)res;

if (boost::xtime_cmp(xt, cur) <= 0)
microseconds = 0;
Expand Down
6 changes: 3 additions & 3 deletions ext/boost/thread/locks.hpp
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions ext/boost/thread/xtime.hpp
Expand Up @@ -20,7 +20,7 @@ namespace boost {

enum xtime_clock_types
{
TIME_UTC=1
TIME_UTC_=1
// TIME_TAI,
// TIME_MONOTONIC,
// TIME_PROCESS,
Expand Down Expand Up @@ -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;
Expand Down
18 changes: 9 additions & 9 deletions ext/common/IniFile.h
Expand Up @@ -173,7 +173,7 @@ class IniFileLexer {
ifstream iniFileStream;

char lastAcceptedChar;
char upcomingChar;
int upcomingChar;
bool upcomingTokenPtrIsStale;

int currentLine;
Expand All @@ -182,7 +182,7 @@ class IniFileLexer {
TokenPtr upcomingTokenPtr;

void expect(char ch) {
char upcomingChar = (char)iniFileStream.peek();
int upcomingChar = iniFileStream.peek();

if (ch != upcomingChar) {
switch(upcomingChar) {
Expand All @@ -200,10 +200,10 @@ class IniFileLexer {
}

void accept() {
if ((int) upcomingChar == EOF) return;
if (upcomingChar == EOF) return;

lastAcceptedChar = (char)iniFileStream.get();
upcomingChar = (char)iniFileStream.peek();
upcomingChar = iniFileStream.peek();
currentColumn++;

if (lastAcceptedChar == '\n') {
Expand All @@ -213,9 +213,9 @@ class IniFileLexer {
}

void ignore() {
if ((int) upcomingChar == EOF) return;
if (upcomingChar == EOF) return;

upcomingChar = (char)iniFileStream.peek();
upcomingChar = iniFileStream.peek();
currentColumn++;

if ((char)iniFileStream.get() == '\n') {
Expand Down Expand Up @@ -285,7 +285,7 @@ class IniFileLexer {
int column = currentColumn;
string result;

while (upcomingChar != '\n' && (int) upcomingChar != EOF) {
while (upcomingChar != '\n' && upcomingChar != EOF) {
result.append(1, upcomingChar);
accept();
}
Expand All @@ -306,7 +306,7 @@ class IniFileLexer {
int column = currentColumn;
string result;

while ((int) upcomingChar != EOF) {
while (upcomingChar != EOF) {
result.append(1, upcomingChar);
accept();
}
Expand Down Expand Up @@ -356,7 +356,7 @@ class IniFileLexer {
}

while (iniFileStream.good()) {
upcomingChar = (char)iniFileStream.peek();
upcomingChar = iniFileStream.peek();
switch(upcomingChar) {
case '[':
return tokenizeSection();
Expand Down
2 changes: 1 addition & 1 deletion ext/common/agents/LoggingAgent/LoggingServer.h
Expand Up @@ -782,7 +782,7 @@ class LoggingServer: public EventedMessageServer {
}

bool isDirectory(const string &dir, struct dirent *entry) const {
#ifdef __sun__
#if defined(__sun__) || defined(_AIX)
string path = dir;
path.append("/");
path.append(entry->d_name);
Expand Down
3 changes: 2 additions & 1 deletion lib/phusion_passenger/platform_info/compiler.rb
Expand Up @@ -62,6 +62,7 @@ def self.compiler_supports_architecture?(arch)
end

def self.compiler_supports_visibility_flag?
return false if RUBY_PLATFORM =~ /aix/
return try_compile(:c, '', '-fvisibility=hidden')
end
memoize :compiler_supports_visibility_flag?, true
Expand Down Expand Up @@ -174,12 +175,12 @@ def self.portability_cflags
flags << '-D_XOPEN_SOURCE=500 -D_XPG4_2 -D__EXTENSIONS__ -D__SOLARIS__ -D_FILE_OFFSET_BITS=64'
flags << '-D__SOLARIS9__ -DBOOST__STDC_CONSTANT_MACROS_DEFINED' if RUBY_PLATFORM =~ /solaris2.9/
end
flags << '-D_XOPEN_SOURCE=500 -D_XPG4_2 -D__EXTENSIONS__ -D__SOLARIS__ -D_FILE_OFFSET_BITS=64'
flags << '-DBOOST_HAS_STDINT_H' unless RUBY_PLATFORM =~ /solaris2.9/
flags << '-mcpu=ultrasparc' if RUBY_PLATFORM =~ /sparc/
elsif RUBY_PLATFORM =~ /openbsd/
flags << '-DBOOST_HAS_STDINT_H -D_GLIBCPP__PTHREADS'
elsif RUBY_PLATFORM =~ /aix/
flags << '-pthread'
flags << '-DOXT_DISABLE_BACKTRACES'
elsif RUBY_PLATFORM =~ /(sparc-linux|arm-linux|^arm.*-linux|sh4-linux)/
# http://code.google.com/p/phusion-passenger/issues/detail?id=200
Expand Down

0 comments on commit e5b0f53

Please sign in to comment.