From Mathias Froehlich, build fix for Solaris
This commit is contained in:
parent
740b29d0f7
commit
f9428e9f45
@ -44,6 +44,20 @@ public:
|
||||
virtual void flush() { _out->flush(); }
|
||||
|
||||
protected:
|
||||
// Return true if the manipulator is std::endl
|
||||
bool isEndl( std::ostream& (*fn)(std::ostream&) )
|
||||
{
|
||||
#ifdef __sun
|
||||
// What a mess, but solaris does not like taking the address below
|
||||
std::stringstream ss;
|
||||
ss << fn;
|
||||
std::string s = ss.str();
|
||||
return !s.empty() && s[0] == '\n';
|
||||
#else
|
||||
return fn==static_cast<std::ostream& (*)(std::ostream&)>(std::endl);
|
||||
#endif
|
||||
}
|
||||
|
||||
std::ostream* _out;
|
||||
};
|
||||
|
||||
|
@ -57,7 +57,7 @@ public:
|
||||
virtual void writeStream( std::ostream& (*fn)(std::ostream&) )
|
||||
{
|
||||
indentIfRequired(); *_out << fn;
|
||||
if ( fn==static_cast<std::ostream& (*)(std::ostream&)>(std::endl) )
|
||||
if ( isEndl( fn ) )
|
||||
{
|
||||
_readyForIndent = true;
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ public:
|
||||
|
||||
virtual void writeStream( std::ostream& (*fn)(std::ostream&) )
|
||||
{
|
||||
if ( fn==static_cast<std::ostream& (*)(std::ostream&)>(std::endl) )
|
||||
if ( isEndl( fn ) )
|
||||
{
|
||||
if ( _readLineType==PROP_LINE || _readLineType==END_BRACKET_LINE )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user