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(); }
|
virtual void flush() { _out->flush(); }
|
||||||
|
|
||||||
protected:
|
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;
|
std::ostream* _out;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ public:
|
|||||||
virtual void writeStream( std::ostream& (*fn)(std::ostream&) )
|
virtual void writeStream( std::ostream& (*fn)(std::ostream&) )
|
||||||
{
|
{
|
||||||
indentIfRequired(); *_out << fn;
|
indentIfRequired(); *_out << fn;
|
||||||
if ( fn==static_cast<std::ostream& (*)(std::ostream&)>(std::endl) )
|
if ( isEndl( fn ) )
|
||||||
{
|
{
|
||||||
_readyForIndent = true;
|
_readyForIndent = true;
|
||||||
}
|
}
|
||||||
|
@ -66,10 +66,10 @@ public:
|
|||||||
|
|
||||||
virtual void writeString( const std::string& s )
|
virtual void writeString( const std::string& s )
|
||||||
{ addToCurrentNode( s, true ); }
|
{ addToCurrentNode( s, true ); }
|
||||||
|
|
||||||
virtual void writeStream( std::ostream& (*fn)(std::ostream&) )
|
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 )
|
if ( _readLineType==PROP_LINE || _readLineType==END_BRACKET_LINE )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user