From 2a805c98cd8c72a49bcdec2e9c8b7999a22ed475 Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Sat, 27 Jul 2019 11:03:39 -0500 Subject: Visibility fixes for xlC --- cpp/src/Ice/LoggerI.cpp | 7 +++++++ cpp/src/IceSSL/Util.cpp | 5 +++++ 2 files changed, 12 insertions(+) (limited to 'cpp/src') diff --git a/cpp/src/Ice/LoggerI.cpp b/cpp/src/Ice/LoggerI.cpp index 44842207a3d..9552f9b0041 100644 --- a/cpp/src/Ice/LoggerI.cpp +++ b/cpp/src/Ice/LoggerI.cpp @@ -152,7 +152,14 @@ 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(_out.rdbuf()->pubseekoff(0, _out.cur, _out.out)); +#else size_t sz = static_cast(_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 294640565a5..b0216df5bc7 100755 --- a/cpp/src/IceSSL/Util.cpp +++ b/cpp/src/IceSSL/Util.cpp @@ -118,7 +118,12 @@ IceSSL::readFile(const string& file, vector& buffer) } is.seekg(0, is.end); +#ifdef __IBMCPP__ + // xlC bug. See src/Ice/LoggerI.cpp + buffer.resize(static_cast(is.rdbuf()->pubseekoff(0, is.cur, is.in))); +#else buffer.resize(static_cast(is.tellg())); +#endif is.seekg(0, is.beg); if(!buffer.empty()) -- cgit v1.2.3