From 4e671a1c217478bd3d1f0ab78c0b9b8cf255620c Mon Sep 17 00:00:00 2001 From: Matej Sekoranja Date: Thu, 6 Nov 2014 22:18:58 +0100 Subject: [PATCH] win32 indent problem: local static DLL saga --- src/factory/PVStructureArray.cpp | 2 +- src/factory/PVUnionArray.cpp | 2 +- src/factory/printer.cpp | 9 ++++++++- src/pv/pvIntrospect.h | 6 +----- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/factory/PVStructureArray.cpp b/src/factory/PVStructureArray.cpp index b54ff85..1536ad5 100644 --- a/src/factory/PVStructureArray.cpp +++ b/src/factory/PVStructureArray.cpp @@ -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; } diff --git a/src/factory/PVUnionArray.cpp b/src/factory/PVUnionArray.cpp index ccce916..0239ec1 100644 --- a/src/factory/PVUnionArray.cpp +++ b/src/factory/PVUnionArray.cpp @@ -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; } diff --git a/src/factory/printer.cpp b/src/factory/printer.cpp index 85c9cdc..b225d80 100644 --- a/src/factory/printer.cpp +++ b/src/factory/printer.cpp @@ -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; diff --git a/src/pv/pvIntrospect.h b/src/pv/pvIntrospect.h index 540d88f..4a966ad 100644 --- a/src/pv/pvIntrospect.h +++ b/src/pv/pvIntrospect.h @@ -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);