From ad394fb090b56fa4dc7e8b9973375bff71490888 Mon Sep 17 00:00:00 2001 From: ehofman Date: Thu, 11 Dec 2003 13:17:45 +0000 Subject: [PATCH] fgrun fixes --- simgear/compatibility/fstream | 22 +++++++++++++++++++++- simgear/compiler.h | 4 ++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/simgear/compatibility/fstream b/simgear/compatibility/fstream index bcc00e2a..5757a28f 100644 --- a/simgear/compatibility/fstream +++ b/simgear/compatibility/fstream @@ -8,8 +8,28 @@ namespace std { using ::fstream; - using ::ifstream; using ::ofstream; + +# ifdef SG_HAVE_NATIVE_SGI_COMPILERS + using ::ifstream; +# else + class ifstream : public ::ifstream { + private: + ::ifstream *ifs; + public: + ifstream() { ifs = new ::ifstream(); } + ifstream(int fd) { ifs = new ::ifstream(fd); } + ifstream(int fd, char* p, int l) { ifs = new ::ifstream(fd, p, l); } + ifstream(const char* name, int mode=ios::in, int prot=filebuf::openprot) + { ifs = new ::ifstream(name, mode, prot); }; + ~ifstream() { delete ifs; } + + filebuf* rdbuf() { return ifs->rdbuf(); } + void open(const char* name, int mode=ios::in, int prot=filebuf::openprot) + { ifs->open(name, mode, prot); } + int is_open() { return (!ifs->fail() && !ifs->eof()); } + }; +# endif }; diff --git a/simgear/compiler.h b/simgear/compiler.h index f80697d5..a709b901 100644 --- a/simgear/compiler.h +++ b/simgear/compiler.h @@ -307,7 +307,11 @@ # define STL_ITERATOR # define STL_FSTREAM # define STL_STDEXCEPT +#if (_COMPILER_VERSION < 740) # define STL_STRING +#else +# define STL_STRING +#endif # define STL_STRSTREAM #pragma set woff 1001,1012,1014,1116,1155,1172,1174 -- 2.39.5