diff options
author | Bernard Normier <bernard@zeroc.com> | 2019-08-02 19:25:38 -0500 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2019-08-02 19:25:38 -0500 |
commit | b68f3b78c73b30e0860781e43cd30cece778360a (patch) | |
tree | 86d07d375e9f55c34bf68079ebfff7a389726603 /cpp | |
parent | Fixes for source build testing on ppc (diff) | |
download | ice-b68f3b78c73b30e0860781e43cd30cece778360a.tar.bz2 ice-b68f3b78c73b30e0860781e43cd30cece778360a.tar.xz ice-b68f3b78c73b30e0860781e43cd30cece778360a.zip |
Better work-around for xlC visibility bug
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/Ice/LoggerI.cpp | 13 | ||||
-rwxr-xr-x | cpp/src/IceSSL/Util.cpp | 11 |
2 files changed, 12 insertions, 12 deletions
diff --git a/cpp/src/Ice/LoggerI.cpp b/cpp/src/Ice/LoggerI.cpp index 9552f9b0041..cf5b74a4358 100644 --- a/cpp/src/Ice/LoggerI.cpp +++ b/cpp/src/Ice/LoggerI.cpp @@ -11,6 +11,12 @@ #include <Ice/LocalException.h> #include <IceUtil/FileUtil.h> +#ifdef __IBMCPP__ +// Work-around for xlC visibility bug +// See "ifstream::tellg visibility error" thread on IBM xlC forum +extern template class std::fpos<char*>; +#endif + using namespace std; using namespace Ice; using namespace IceInternal; @@ -152,14 +158,7 @@ Ice::LoggerI::write(const string& message, bool indent) // If file size + message size exceeds max size we archive the log file, // but we do not archive empty files or truncate messages. // -#ifdef __IBMCPP__ - // xlC bug: without this work-around, we get a link error when compiling with - // optimization and -qvisibility=hidden - assert(_out.good()); - size_t sz = static_cast<size_t>(_out.rdbuf()->pubseekoff(0, _out.cur, _out.out)); -#else size_t sz = static_cast<size_t>(_out.tellp()); -#endif if(sz > 0 && sz + message.size() >= _sizeMax && _nextRetry <= IceUtil::Time::now()) { string basename = _file; diff --git a/cpp/src/IceSSL/Util.cpp b/cpp/src/IceSSL/Util.cpp index b0216df5bc7..940c5e1449c 100755 --- a/cpp/src/IceSSL/Util.cpp +++ b/cpp/src/IceSSL/Util.cpp @@ -20,6 +20,12 @@ #include <fstream> +#ifdef __IBMCPP__ +// Work-around for xlC visibility bug +// See "ifstream::tellg visibility error" thread on IBM xlC forum +extern template class std::fpos<char*>; +#endif + using namespace std; using namespace Ice; using namespace IceInternal; @@ -118,12 +124,7 @@ IceSSL::readFile(const string& file, vector<char>& buffer) } is.seekg(0, is.end); -#ifdef __IBMCPP__ - // xlC bug. See src/Ice/LoggerI.cpp - buffer.resize(static_cast<size_t>(is.rdbuf()->pubseekoff(0, is.cur, is.in))); -#else buffer.resize(static_cast<size_t>(is.tellg())); -#endif is.seekg(0, is.beg); if(!buffer.empty()) |