win32 indent problem: local static DLL saga

This commit is contained in:
Matej Sekoranja
2014-11-06 22:18:58 +01:00
parent f36c8ce280
commit 4e671a1c21
4 changed files with 11 additions and 8 deletions

View File

@@ -237,7 +237,7 @@ std::ostream& PVStructureArray::dumpValue(std::ostream& o, std::size_t index) co
if (temp[index])
o << *temp[index];
else
o << "(none)" << std::endl;
o << format::indent() << "(none)" << std::endl;
}
return o;
}

View File

@@ -236,7 +236,7 @@ std::ostream& PVUnionArray::dumpValue(std::ostream& o, std::size_t index) const
if (temp[index])
o << *temp[index];
else
o << "(none)" << std::endl;
o << format::indent() << "(none)" << std::endl;
}
return o;
}

View File

@@ -26,7 +26,14 @@ namespace epics { namespace pvData {
namespace format
{
std::ostream& operator<<(std::ostream& os, indent_level const& indent)
static int indent_index = std::ios_base::xalloc();
long& indent_value(std::ios_base& ios)
{
return ios.iword(indent_index);
}
std::ostream& operator<<(std::ostream& os, indent_level const& indent)
{
indent_value(os) = indent.level;
return os;

View File

@@ -32,11 +32,7 @@ struct indent_level
indent_level(long l) : level(l) {}
};
inline long& indent_value(std::ios_base& ios)
{
static int indent_index = std::ios_base::xalloc();
return ios.iword(indent_index);
}
epicsShareExtern long& indent_value(std::ios_base& ios);
epicsShareExtern std::ostream& operator<<(std::ostream& os, indent_level const& indent);