]> git.mxchange.org Git - simgear.git/commitdiff
Patch from Erik Hofman:
authordavid <david>
Tue, 31 Dec 2002 14:47:34 +0000 (14:47 +0000)
committerdavid <david>
Tue, 31 Dec 2002 14:47:34 +0000 (14:47 +0000)
This patch adds some more functionality to the header files and removes
*all* dependencies on SG_HAVE_NATIVE_SGI_COMPILERS in the SimGear code!

[dpm: I had to add some additional SG_USING_STD declarations to make
it compile]

31 files changed:
simgear/bucket/newbucket.hxx
simgear/compatibility/Makefile.am
simgear/compatibility/iostream
simgear/compatibility/istream
simgear/compatibility/streambuf
simgear/debug/logstream.hxx
simgear/ephemeris/stardata.cxx
simgear/io/decode_binobj.cxx
simgear/io/lowtest.cxx
simgear/io/sg_binobj.cxx
simgear/io/socktest.cxx
simgear/io/tcp_client.cxx
simgear/io/tcp_server.cxx
simgear/math/point3d.hxx
simgear/math/sg_geodesy.cxx
simgear/metar/MetarReport.cpp
simgear/metar/MetarStation.cpp
simgear/misc/props.hxx
simgear/misc/props_io.cxx
simgear/misc/props_io.hxx
simgear/misc/props_test.cxx
simgear/misc/sgstream.hxx
simgear/misc/zfstream.hxx
simgear/route/routetest.cxx
simgear/route/waytest.cxx
simgear/scene/sky/sphere.cxx
simgear/scene/sky/stars.cxx
simgear/serial/serial.cxx
simgear/serial/testserial.cxx
simgear/xml/easyxml.cxx
simgear/xml/easyxml.hxx

index 0cc07294638cf09a624c4ab757529c744e447d4b..9f4fb77a56c99fd1cb6b154d6190a960a7a7b995 100644 (file)
@@ -54,10 +54,7 @@ SG_USING_STD(fabs);
 #include STL_STRING
 
 SG_USING_STD(string);
-
-#if ! defined( SG_HAVE_NATIVE_SGI_COMPILERS )
 SG_USING_STD(ostream);
-#endif
 
 
 /**
index 8ab827c69ee8088333270b9890ea6c1c0dc57913..5d13d21b2dc943c2a3d2593270a50431cc0ad62c 100644 (file)
@@ -2,6 +2,35 @@ includedir = @includedir@/compatibility
 
 EXTRA_DIST = README
 
+include_HEADERS        = \
+       cfloat \
+       csetjmp \
+       cstdio \
+       cwchar \
+       iostream \
+       strstream \
+       cassert \
+       climits \
+       csignal \
+       cstdlib \
+       cwctype \
+       istream \
+       cctype \
+       clocale \
+       cstdarg \
+       cstring \
+       fstream \
+       iterator \
+       cerrno \
+       cmath \
+       cstddef \
+       ctime \
+       iomanip \
+       streambuf
+includedir = @includedir@/compatibility
+
+EXTRA_DIST = README
+
 include_HEADERS        = \
        cfloat \
        csetjmp \
index b03afdb34799584942eca3d453765bbc92ca001d..36285efbd55db89c53aa9318bd67dbf672027fa6 100644 (file)
@@ -3,6 +3,7 @@
 #define __SG_IOSTREAM 1
 
 # include <iostream.h>
+# include <fstream.h>
 
 #if defined(sgi) && !defined(__GNUC__)
 
     using ::cout;
     using ::cerr;
     using ::clog;
+    using ::endl;
+
     using ::ios_base;
+    using ::istream;
+    using ::ostream;
+
+    using ::ifstream;
+    using ::ofstream;
   };
 
 #endif
index 367c47f21b4273d2e8db2d5211bc18cb117ba8a2..b8b5668c53bd9b7235c0aa3a702f657046ae9788 100644 (file)
@@ -2,10 +2,14 @@
 #ifndef __SG_ISTREAM
 #define __SG_ISTREAM 1
 
+# include <iostream>
+
 #if defined(sgi) && !defined(__GNUC__)
 
 # include <stream.h>
-# include <iostream>
+# include <string>
+
+  using std::getline;
 
 #endif
 
index 49b95c0e5023c1a51cd039f646372078271af691..bee458f5ebc829d1493c3948b6190101fac22331 100644 (file)
@@ -2,27 +2,36 @@
 #ifndef __SG_STREAMBUF
 #define __SG_STREAMBUF 1
 
-#if defined(sgi) && !defined(__GNUC__)
-
-# include <char_traits.h>
 # include <iostream>
+# include <char_traits.h>
 
-# define pubsync sync
+//
+// Until we find a good way to rename the original streambuf class
+// and derive our own streambuf class from that, define this variable
+// for now so the code can inherit our streambuf class instead.
+//
+# define SG_NEED_STREAMBUF_HACK  1
 
-  using std::char_traits;
+class __streambuf : virtual public streambuf {
+public:
 
-  typedef char_traits<char>            traits_type;
-  typedef char_traits<char>::int_type  int_type;
+  typedef std::char_traits<char>            traits_type;
+  typedef std::char_traits<char>::int_type  int_type;
 
   typedef streampos  pos_type;
   typedef streamoff  off_type;
+};
+
+
+#if defined(sgi) && !defined(__GNUC__)
+
+# define pubsync  sync
 
   namespace std {
     using ::streambuf;
     using ::streampos;
     using ::streamoff;
   };
-
 #endif
 
 #endif // !__SG_STREAMBUF
index f28ca6103c2342773b5ddb96d22df10a7e9ffc53..12c2dfeef9fb95e1a13b5f212c830d6aabeef991 100644 (file)
 
 #include <simgear/compiler.h>
 
-// At least Irix needs this
-#ifdef SG_HAVE_NATIVE_SGI_COMPILERS
-#include <char_traits.h>
-#endif
-
 #ifdef SG_HAVE_STD_INCLUDES
 # include <streambuf>
 # include <iostream>
 
 #include <simgear/debug/debug_types.h>
 
-#ifndef SG_HAVE_NATIVE_SGI_COMPILERS
 SG_USING_STD(streambuf);
 SG_USING_STD(ostream);
 SG_USING_STD(cout);
 SG_USING_STD(cerr);
 SG_USING_STD(endl);
-#else
-SG_USING_STD(char_traits);
-#endif
 
 #ifdef __MWERKS__
 SG_USING_STD(iostream);
@@ -70,7 +61,11 @@ SG_USING_STD(iostream);
  * messages at runtime. Only messages with priority >= logbuf::logPriority
  * and debugClass == logbuf::logClass are output.
  */
+#ifdef SG_NEED_STREAMBUF_HACK
+class logbuf : public __streambuf
+#else
 class logbuf : public streambuf
+#endif
 {
 public:
 
index f3dffb17d5a85998a525a4ec2fd9c267767c4e58..f988d5bc1851a96f06bffacd88c7465d38368edf 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "stardata.hxx"
 
-#if defined (_MSC_VER) || defined (SG_HAVE_NATIVE_SGI_COMPILERS)
+#if defined (_MSC_VER)
   SG_USING_STD(getline);
 #endif
 
index dbb1e1db7af0e3c60a8b4e9f7ec9518614556eca..70a50f5ea2bef5814e151eaaaa6cd54289df02a9 100644 (file)
@@ -3,12 +3,10 @@
 #include <unistd.h>
 #include STL_IOSTREAM
 
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
+#include "sg_binobj.hxx"
+
 SG_USING_STD(cout);
 SG_USING_STD(endl);
-#endif
-
-#include "sg_binobj.hxx"
 
 
 int main( int argc, char **argv ) {
index 8562035734f88ce586d7c23200ad89ef13a49a65..85ecf6b3378a3a8617209f1520d19eca625a5a8c 100644 (file)
@@ -3,16 +3,14 @@
 #include STL_IOSTREAM
 #include "lowlevel.hxx"
 
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
-SG_USING_STD(cout);
-SG_USING_STD(endl);
-#endif
-
 
 static const int sgEndianTest = 1;
 #define sgIsLittleEndian (*((char *) &sgEndianTest ) != 0)
 #define sgIsBigEndian    (*((char *) &sgEndianTest ) == 0)
 
+SG_USING_STD(cout);
+SG_USING_STD(endl);
+
 
 int main() {
     cout << "This machine is ";
index d2da18ef92ae3a250e256d56842a47ee72472f8d..3c1f976f961ceb9e56d95e3208ea0b4caee1c1eb 100644 (file)
 
 SG_USING_STD( string );
 SG_USING_STD( vector );
-
-#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS)
 SG_USING_STD( cout );
 SG_USING_STD( endl );
-#endif
 
 
 enum {
index 358c32e08bde391bdc55392ba61b589747d480eb..2586b42cd51cbfd5f823bf21a40a2fe76d387131 100644 (file)
@@ -6,15 +6,14 @@
 #include "sg_socket.hxx"
 #include "lowlevel.hxx"
 
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
-SG_USING_STD(cout);
-SG_USING_STD(endl);
-#endif
-
 static const int sgEndianTest = 1;
 #define sgIsLittleEndian (*((char *) &sgEndianTest ) != 0)
 #define sgIsBigEndian    (*((char *) &sgEndianTest ) == 0)
 
+SG_USING_STD(cout);
+SG_USING_STD(endl);
+
+
 int main() {
 
     if ( sgIsLittleEndian ) {
index a02e25d3b2bca5636ad73123bb99a6055abd9106..d1d7f8c7f9edc6e878bdf16a270871469bb2c47d 100644 (file)
@@ -11,9 +11,6 @@
 
 #include "sg_socket.hxx"
 
-#ifndef SG_HAVE_NATIVE_SGI_COMPILERS
-using std::cout;
-#endif
 
 class TcpClient
 {
index cd9b8ea77410ac85837f216411c9d5f3dcac52c1..b0534937dab76b191db3540386ee188c71bbd47e 100644 (file)
@@ -5,10 +5,8 @@
 
 #include "sg_socket.hxx"
 
-using std::string;
-#ifndef SG_HAVE_NATIVE_SGI_COMPILERS
-using std::cout;
-#endif
+SG_USING_STD(string);
+SG_USING_STD(cout);
 
 class TcpServer
 {
index 3537d45cbf4f5c5a42d2eced1b706a5e184fad9e..11445ea0240209b961f9322a5696b0ff7469e984 100644 (file)
 SG_USING_NAMESPACE(std);
 #endif
 
-#ifndef SG_HAVE_NATIVE_SGI_COMPILERS
 SG_USING_STD(ostream);
 SG_USING_STD(istream);
-#endif
 
 
 const double fgPoint3_Epsilon = 0.0000001;
index 4393778d52fccbd5b8967609f9b4c861c4024bd0..cc5ac15ce6374c4ba81d83e1554a8bd6257a9c36 100644 (file)
@@ -27,9 +27,7 @@
 #include "localconsts.hxx"
 
 
-#ifndef SG_HAVE_NATIVE_SGI_COMPILERS
 SG_USING_STD(cout);
-#endif
 
 
 #define DOMAIN_ERR_DEBUG 1
index 2987feea098acd176f00501515e17cef6e73c3d7..57107b5e70aa5459a7047da6ec10ff808d0ec905 100644 (file)
@@ -7,10 +7,8 @@
 #include "MetarReport.h"
 #include "Metar.h"
 
-#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS)
 SG_USING_STD(endl);
 SG_USING_STD(ostream);
-#endif
 
 CMetarReport::CMetarReport(
    char *s ) :
index 9000ae5ce9e347cece8cff1624a65e017c93c3ba..d0ee73868da4ae623d2f81a12636ebfefb01885b 100644 (file)
@@ -8,11 +8,9 @@
 #include "MetarStation.h"
 #include <algorithm>
 
-#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS)
 SG_USING_STD(ostream);
 SG_USING_STD(cout);
 SG_USING_STD(endl);
-#endif
 
 
 double CMetarStation::decodeDMS( char *b )
index c22d30367d73e52c52de85836f5e220c5f671fc9..a042c61d4b66249acbbf9b0adf7ffe1284e2fdb2 100644 (file)
@@ -36,10 +36,8 @@ using std::ostream;
 #include STL_IOSTREAM
 SG_USING_STD(string);
 SG_USING_STD(vector);
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
 SG_USING_STD(istream);
 SG_USING_STD(ostream);
-#endif
 
 #endif
 
index 15c522be3a6019b57443177dc540e4cd9d247109..36ea2b7e19e036dd3bc9452f3aa2404650bb7a00 100644 (file)
 #include "props_io.hxx"
 
 #include STL_IOSTREAM
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
-#  include <fstream>
-#else
-#  include <fstream.h>
-#endif
+#include STL_FSTREAM
 #include STL_STRING
 #include <vector>
 #include <map>
 
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
 SG_USING_STD(istream);
 SG_USING_STD(ifstream);
 SG_USING_STD(ostream);
 SG_USING_STD(ofstream);
-#endif
 SG_USING_STD(string);
 SG_USING_STD(vector);
 SG_USING_STD(map);
index f5ed425f3ac7a232088b3097ce8c4f41725b99e5..83e84c5a024a851547ead434d80fda0727a7cfde 100644 (file)
 SG_USING_STD(string);
 SG_USING_STD(vector);
 SG_USING_STD(map);
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
 SG_USING_STD(istream);
 SG_USING_STD(ostream);
-#endif
 
 /**
  * Read properties from an XML input stream.
index b98e6e6b6f2284ba7a5e0d46cce88a2a6c9f4dd4..ab29deee8eda4f6e691dfd231b7c04b8e55d8eab 100644 (file)
@@ -9,11 +9,9 @@
 #include "props.hxx"
 #include "props_io.hxx"
 
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
 SG_USING_STD(cout);
 SG_USING_STD(cerr);
 SG_USING_STD(endl);
-#endif
 
 
 \f
index 373ebc7914f9eb23a667c90fc0a5319db72910f5..1131171be6b587f63db9fc0ef8ccf3cd12226cf8 100644 (file)
@@ -36,8 +36,6 @@
 
 #if defined( SG_HAVE_STD_INCLUDES )
 #  include <istream>
-#elif defined ( SG_HAVE_NATIVE_SGI_COMPILERS )
-#  include <CC/stream.h>
 #elif defined ( __BORLANDC__ )
 #  include <iostream>
 #else
 #include <simgear/misc/zfstream.hxx>
 
 SG_USING_STD(string);
-
-#ifndef SG_HAVE_NATIVE_SGI_COMPILERS
 SG_USING_STD(istream);
-#endif
 
 
 /**
index bf9f1733c830c22d1bf623e89401a4975e99a146..153c357ee573a15d60f6629868d200636b450bc0 100644 (file)
 
 #include <zlib.h>
 
-// At least Irix needs this
-#ifdef SG_HAVE_NATIVE_SGI_COMPILERS
-#include <char_traits.h>
-SG_USING_STD(char_traits);
-#endif
-
 #ifdef SG_HAVE_STD_INCLUDES
 
 #  include <streambuf>
@@ -76,8 +70,6 @@ SG_USING_STD(streamoff);
 
 #if defined(__GNUC__) && __GNUC_MINOR__ < 8
 #  define ios_binary   ios::bin
-#elif defined( SG_HAVE_NATIVE_SGI_COMPILERS )
-#  define ios_binary   0
 #else
 #  define ios_binary   ios::binary
 #endif
@@ -94,7 +86,11 @@ SG_USING_STD(streamoff);
 /**
  * A C++ I/O streams interface to the zlib gz* functions.
  */
+#ifdef SG_NEED_STREAMBUF_HACK
+class gzfilebuf : public __streambuf
+#else
 class gzfilebuf : public streambuf
+#endif
 {
 public:
 
index 313ed528b764615e3de6831e68608b27b9b36f30..1d8be5af682e3ddedc5e3b2e52a1a4862cd3829b 100644 (file)
@@ -6,10 +6,8 @@
 #include "route.hxx"
 #include "waypoint.hxx"
 
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
 SG_USING_STD(cout);
 SG_USING_STD(endl);
-#endif
  
 int main() {
     SGRoute route;
index bc31b9c59157a04d0c887f676424341e4ce2889a..0d57bff89fcef2ed47827b20b52206e20fa953b6 100644 (file)
@@ -5,11 +5,8 @@
 
 #include "waypoint.hxx"
 
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
 SG_USING_STD(cout);
 SG_USING_STD(endl);
-#endif
-
 
 int main() {
     SGWayPoint a1(-93.216923, 44.880547, 0.0, SGWayPoint::WGS84, "KMSP");
index 428d966b3ba05652ac3904e1d429df174ca13b2e..9ca292188ed9b81bfaabcf0de97985a7e68ce505 100644 (file)
 #include <plib/sg.h>
 #include <plib/ssg.h>
 
-#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS)
 SG_USING_STD(cout);
 SG_USING_STD(endl);
-#endif
 
 
 // return a sphere object as an ssgBranch
index 0ca2efb4409bbbd9418180ee6629b583d0c525a2..55602b2fb258cb2bce263c507d192a2b63018f6b 100644 (file)
 
 #include "stars.hxx"
 
-#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS)
 SG_USING_STD(cout);
 SG_USING_STD(endl);
-#endif
 
 
 // Set up star rendering call backs
index 0859122d291a35087967b3d356ba5ef89b92e46a..1035f8dd2ac5e9cdcb44d48ec30ef22a6db1a430 100644 (file)
 
 #include "serial.hxx"
 
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
 SG_USING_STD(cout);
 SG_USING_STD(endl);
-#endif
-
 
 FGSerialPort::FGSerialPort()
     : dev_open(false)
index d005f32fee3cc7c2df37a340d4fcd734c2ac7965..1a6bab6d4b365ac0ac7ee6e3b393ef61c1839e42 100644 (file)
@@ -7,11 +7,8 @@
 
 #include "serial.hxx"
 
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
 SG_USING_STD(cout);
 SG_USING_STD(endl);
-#endif
-
 
 int main () {
     FGSerialPort port;
index c1aed18528c2635465e676fbccd8371d3fa0ef6c..181e646ba3d7a9d45d07ee7a1ea7409aa9cd2717 100644 (file)
@@ -9,9 +9,7 @@
 
 #include STL_FSTREAM
 
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
 SG_USING_STD(ifstream);
-#endif
 
 
 \f
index 1e5404d6d69743355dad6063aab80ae75ce0f4ac..348151efaa5e091d790dfa47b4d389eefa161c6e 100644 (file)
@@ -16,9 +16,7 @@
 #include STL_STRING
 #include <vector>
 
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
 SG_USING_STD(istream);
-#endif
 SG_USING_STD(string);
 SG_USING_STD(vector);