summaryrefslogtreecommitdiffstats
path: root/Source/cmStandardIncludes.h
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2001-08-07 19:49:57 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2001-08-07 19:49:57 (GMT)
commit61ec323b6a1c4e5a44331014447e3d1d31dc1b6b (patch)
tree654e5967568b6c8367071380e55b6c7a59491110 /Source/cmStandardIncludes.h
parent4b2d48051f610a312497500bf647222dac95ea5e (diff)
downloadCMake-61ec323b6a1c4e5a44331014447e3d1d31dc1b6b.zip
CMake-61ec323b6a1c4e5a44331014447e3d1d31dc1b6b.tar.gz
CMake-61ec323b6a1c4e5a44331014447e3d1d31dc1b6b.tar.bz2
ENH: compile with broken 720 SGI C++ compiler
Diffstat (limited to 'Source/cmStandardIncludes.h')
-rw-r--r--Source/cmStandardIncludes.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h
index 21ca91c..dded33b 100644
--- a/Source/cmStandardIncludes.h
+++ b/Source/cmStandardIncludes.h
@@ -89,4 +89,44 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
+// check for the 720 compiler on the SGI
+// which has some strange properties that I don't think are worth
+// checking for in a general way in configure
+#if defined(__sgi) && !defined(__GNUC__)
+# if (_COMPILER_VERSION >= 730)
+# define CM_SGI_CC_730
+# elif (_COMPILER_VERSION >= 720)
+# define CM_SGI_CC_720
+# endif
+#endif
+
+
+# ifdef CM_SGI_CC_720
+// the 720 sgi compiler has std:: but not for the stream library,
+// so we have to bring it into the std namespace by hand.
+namespace std {
+using ::ostream;
+using ::istream;
+using ::ios;
+using ::cout;
+using ::cerr;
+using ::cin;
+using ::ifstream;
+using ::ofstream;
+using ::strstream;
+using ::endl;
+using ::ends;
+using ::flush;
+}
+// The string class is missing these operators so add them
+inline bool operator!=(std::string const& a, const char* b)
+{ return !(a==std::string(b)); }
+
+inline bool operator==(std::string const& a, const char* b)
+{ return (a==std::string(b)); }
+// for scoping is not ISO, so use the for hack
+#define for if(false) {} else for
+
+# endif
+
#endif