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:
#include STL_STRING
SG_USING_STD(string);
#include STL_STRING
SG_USING_STD(string);
-
-#if ! defined( SG_HAVE_NATIVE_SGI_COMPILERS )
+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 \
include_HEADERS = \
cfloat \
csetjmp \
#define __SG_IOSTREAM 1
# include <iostream.h>
#define __SG_IOSTREAM 1
# include <iostream.h>
#if defined(sgi) && !defined(__GNUC__)
#if defined(sgi) && !defined(__GNUC__)
using ::cout;
using ::cerr;
using ::clog;
using ::cout;
using ::cerr;
using ::clog;
+ using ::istream;
+ using ::ostream;
+
+ using ::ifstream;
+ using ::ofstream;
#ifndef __SG_ISTREAM
#define __SG_ISTREAM 1
#ifndef __SG_ISTREAM
#define __SG_ISTREAM 1
#if defined(sgi) && !defined(__GNUC__)
# include <stream.h>
#if defined(sgi) && !defined(__GNUC__)
# include <stream.h>
+# include <string>
+
+ using std::getline;
#ifndef __SG_STREAMBUF
#define __SG_STREAMBUF 1
#ifndef __SG_STREAMBUF
#define __SG_STREAMBUF 1
-#if defined(sgi) && !defined(__GNUC__)
-
-# include <char_traits.h>
+# include <char_traits.h>
+//
+// 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;
typedef streampos pos_type;
typedef streamoff off_type;
+};
+
+
+#if defined(sgi) && !defined(__GNUC__)
+
+# define pubsync sync
namespace std {
using ::streambuf;
using ::streampos;
using ::streamoff;
};
namespace std {
using ::streambuf;
using ::streampos;
using ::streamoff;
};
#endif
#endif // !__SG_STREAMBUF
#endif
#endif // !__SG_STREAMBUF
#include <simgear/compiler.h>
#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>
#ifdef SG_HAVE_STD_INCLUDES
# include <streambuf>
# include <iostream>
#include <simgear/debug/debug_types.h>
#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);
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);
#ifdef __MWERKS__
SG_USING_STD(iostream);
* messages at runtime. Only messages with priority >= logbuf::logPriority
* and debugClass == logbuf::logClass are output.
*/
* 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
class logbuf : public streambuf
-#if defined (_MSC_VER) || defined (SG_HAVE_NATIVE_SGI_COMPILERS)
SG_USING_STD(getline);
#endif
SG_USING_STD(getline);
#endif
#include <unistd.h>
#include STL_IOSTREAM
#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);
SG_USING_STD(cout);
SG_USING_STD(endl);
-#endif
-
-#include "sg_binobj.hxx"
int main( int argc, char **argv ) {
int main( int argc, char **argv ) {
#include STL_IOSTREAM
#include "lowlevel.hxx"
#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)
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 ";
int main() {
cout << "This machine is ";
SG_USING_STD( string );
SG_USING_STD( vector );
SG_USING_STD( string );
SG_USING_STD( vector );
-
-#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS)
SG_USING_STD( cout );
SG_USING_STD( endl );
SG_USING_STD( cout );
SG_USING_STD( endl );
#include "sg_socket.hxx"
#include "lowlevel.hxx"
#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)
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 ) {
int main() {
if ( sgIsLittleEndian ) {
-#ifndef SG_HAVE_NATIVE_SGI_COMPILERS
-using std::cout;
-#endif
-using std::string;
-#ifndef SG_HAVE_NATIVE_SGI_COMPILERS
-using std::cout;
-#endif
+SG_USING_STD(string);
+SG_USING_STD(cout);
SG_USING_NAMESPACE(std);
#endif
SG_USING_NAMESPACE(std);
#endif
-#ifndef SG_HAVE_NATIVE_SGI_COMPILERS
SG_USING_STD(ostream);
SG_USING_STD(istream);
SG_USING_STD(ostream);
SG_USING_STD(istream);
const double fgPoint3_Epsilon = 0.0000001;
const double fgPoint3_Epsilon = 0.0000001;
#include "localconsts.hxx"
#include "localconsts.hxx"
-#ifndef SG_HAVE_NATIVE_SGI_COMPILERS
#define DOMAIN_ERR_DEBUG 1
#define DOMAIN_ERR_DEBUG 1
#include "MetarReport.h"
#include "Metar.h"
#include "MetarReport.h"
#include "Metar.h"
-#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS)
SG_USING_STD(endl);
SG_USING_STD(ostream);
SG_USING_STD(endl);
SG_USING_STD(ostream);
CMetarReport::CMetarReport(
char *s ) :
CMetarReport::CMetarReport(
char *s ) :
#include "MetarStation.h"
#include <algorithm>
#include "MetarStation.h"
#include <algorithm>
-#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS)
SG_USING_STD(ostream);
SG_USING_STD(cout);
SG_USING_STD(endl);
SG_USING_STD(ostream);
SG_USING_STD(cout);
SG_USING_STD(endl);
double CMetarStation::decodeDMS( char *b )
double CMetarStation::decodeDMS( char *b )
#include STL_IOSTREAM
SG_USING_STD(string);
SG_USING_STD(vector);
#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);
SG_USING_STD(istream);
SG_USING_STD(ostream);
#include "props_io.hxx"
#include STL_IOSTREAM
#include "props_io.hxx"
#include STL_IOSTREAM
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
-# include <fstream>
-#else
-# include <fstream.h>
-#endif
#include STL_STRING
#include <vector>
#include <map>
#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);
SG_USING_STD(istream);
SG_USING_STD(ifstream);
SG_USING_STD(ostream);
SG_USING_STD(ofstream);
SG_USING_STD(string);
SG_USING_STD(vector);
SG_USING_STD(map);
SG_USING_STD(string);
SG_USING_STD(vector);
SG_USING_STD(map);
SG_USING_STD(string);
SG_USING_STD(vector);
SG_USING_STD(map);
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);
SG_USING_STD(istream);
SG_USING_STD(ostream);
/**
* Read properties from an XML input stream.
/**
* Read properties from an XML input stream.
#include "props.hxx"
#include "props_io.hxx"
#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);
SG_USING_STD(cout);
SG_USING_STD(cerr);
SG_USING_STD(endl);
#if defined( SG_HAVE_STD_INCLUDES )
# include <istream>
#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
#elif defined ( __BORLANDC__ )
# include <iostream>
#else
#include <simgear/misc/zfstream.hxx>
SG_USING_STD(string);
#include <simgear/misc/zfstream.hxx>
SG_USING_STD(string);
-
-#ifndef SG_HAVE_NATIVE_SGI_COMPILERS
-// 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>
#ifdef SG_HAVE_STD_INCLUDES
# include <streambuf>
#if defined(__GNUC__) && __GNUC_MINOR__ < 8
# define ios_binary ios::bin
#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
#else
# define ios_binary ios::binary
#endif
/**
* A C++ I/O streams interface to the zlib gz* functions.
*/
/**
* 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
class gzfilebuf : public streambuf
#include "route.hxx"
#include "waypoint.hxx"
#include "route.hxx"
#include "waypoint.hxx"
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
SG_USING_STD(cout);
SG_USING_STD(endl);
SG_USING_STD(cout);
SG_USING_STD(endl);
int main() {
SGRoute route;
int main() {
SGRoute route;
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
SG_USING_STD(cout);
SG_USING_STD(endl);
SG_USING_STD(cout);
SG_USING_STD(endl);
int main() {
SGWayPoint a1(-93.216923, 44.880547, 0.0, SGWayPoint::WGS84, "KMSP");
int main() {
SGWayPoint a1(-93.216923, 44.880547, 0.0, SGWayPoint::WGS84, "KMSP");
#include <plib/sg.h>
#include <plib/ssg.h>
#include <plib/sg.h>
#include <plib/ssg.h>
-#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS)
SG_USING_STD(cout);
SG_USING_STD(endl);
SG_USING_STD(cout);
SG_USING_STD(endl);
// return a sphere object as an ssgBranch
// return a sphere object as an ssgBranch
-#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS)
SG_USING_STD(cout);
SG_USING_STD(endl);
SG_USING_STD(cout);
SG_USING_STD(endl);
// Set up star rendering call backs
// Set up star rendering call backs
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
SG_USING_STD(cout);
SG_USING_STD(endl);
SG_USING_STD(cout);
SG_USING_STD(endl);
FGSerialPort::FGSerialPort()
: dev_open(false)
FGSerialPort::FGSerialPort()
: dev_open(false)
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
SG_USING_STD(cout);
SG_USING_STD(endl);
SG_USING_STD(cout);
SG_USING_STD(endl);
int main () {
FGSerialPort port;
int main () {
FGSerialPort port;
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
#include STL_STRING
#include <vector>
#include STL_STRING
#include <vector>
-#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
SG_USING_STD(string);
SG_USING_STD(vector);
SG_USING_STD(string);
SG_USING_STD(vector);