On linux ostream and endl need prefixing into the std namespace.
authorPeter Howkins <flibble@users.sourceforge.net>
Tue, 13 Mar 2012 17:40:21 +0000 (17:40 +0000)
committerPeter Howkins <flibble@users.sourceforge.net>
Tue, 13 Mar 2012 17:40:21 +0000 (17:40 +0000)
cde/programs/dtsearchpath/libCliSrv/TTFile.C
cde/programs/dtsearchpath/libCliSrv/TTFile.h
cde/programs/dtsearchpath/libCliSrv/cstring.h

index 8eb84a2afb6809c8dc495d2105d4b54dd5bef9df..2a0ec64ef1ba3eb5d939b4c04fe366347ce7647d 100644 (file)
@@ -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
 }
index 14202ec2015923bea790d43fea7aa395f9f5a965..b5f0e8afccfe744e636cbd1b7912352fdbfbf4b8 100644 (file)
@@ -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; }
index abe0ee9bdbe7d564320f150ac52d739a42d91927..8de0ba85296168da75f5ba7a3450d1e08fa643f9 100644 (file)
@@ -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;