From 5d76061f5d257ab2ec8668f4a8ec21e87fa24b09 Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Tue, 13 Mar 2012 17:40:21 +0000 Subject: [PATCH] On linux ostream and endl need prefixing into the std namespace. --- cde/programs/dtsearchpath/libCliSrv/TTFile.C | 17 +++++++++++++++++ cde/programs/dtsearchpath/libCliSrv/TTFile.h | 4 ++++ cde/programs/dtsearchpath/libCliSrv/cstring.h | 4 ++++ 3 files changed, 25 insertions(+) diff --git a/cde/programs/dtsearchpath/libCliSrv/TTFile.C b/cde/programs/dtsearchpath/libCliSrv/TTFile.C index 8eb84a2a..2a0ec64e 100644 --- a/cde/programs/dtsearchpath/libCliSrv/TTFile.C +++ b/cde/programs/dtsearchpath/libCliSrv/TTFile.C @@ -95,15 +95,32 @@ TTFile & TTFile::operator= return *this; } +#if defined(linux) +std::ostream & operator<< + ( + std::ostream & os, + TTFile & file + ) +#else ostream & operator<< ( ostream & os, TTFile & file ) +#endif { if (file.ttFileOpFailed()) +#if defined(linux) + return os << "Error in filename mapping; status = " + << file.getStatus() << std::endl; +#else return os << "Error in filename mapping; status = " << file.getStatus() << endl; +#endif else +#if defined(linux) + return os << file.data() << std::endl; +#else return os << file.data() << endl; +#endif } diff --git a/cde/programs/dtsearchpath/libCliSrv/TTFile.h b/cde/programs/dtsearchpath/libCliSrv/TTFile.h index 14202ec2..b5f0e8af 100644 --- a/cde/programs/dtsearchpath/libCliSrv/TTFile.h +++ b/cde/programs/dtsearchpath/libCliSrv/TTFile.h @@ -65,7 +65,11 @@ class TTFile : public CString { }; #else void TT_Exception (char *); +#if defined(linux) + friend std::ostream & operator<< (std::ostream &, TTFile &); +#else friend ostream & operator<< (ostream &, TTFile &); +#endif #endif int ttFileOpFailed () { return status != TT_OK; } diff --git a/cde/programs/dtsearchpath/libCliSrv/cstring.h b/cde/programs/dtsearchpath/libCliSrv/cstring.h index abe0ee9b..8de0ba85 100644 --- a/cde/programs/dtsearchpath/libCliSrv/cstring.h +++ b/cde/programs/dtsearchpath/libCliSrv/cstring.h @@ -72,7 +72,11 @@ class CString { int isNull() const; void replace (const CString &, const CString &); +#if defined(linux) + friend std::ostream & operator<< (std::ostream &, const CString &); +#else friend ostream & operator<< (ostream &, const CString &); +#endif protected: char * contents; -- 2.25.1