From e54cfc002b39a55a0f3359bdffcfb01ef8065816 Mon Sep 17 00:00:00 2001 From: ehofman Date: Fri, 26 Dec 2003 13:55:09 +0000 Subject: [PATCH] Updates to support sgi's MIPSpro compiler version 7.4 and newer. This also fixes a number of C++ issues where FlightGear didn't follow the standard. --- configure.ac | 21 +++++++++++- simgear/compatibility/MIPSpro721/.cvsignore | 2 ++ simgear/compatibility/MIPSpro721/Makefile.am | 14 ++++++++ .../compatibility/{ => MIPSpro721}/fstream | 0 .../compatibility/{ => MIPSpro721}/iomanip | 0 .../compatibility/{ => MIPSpro721}/iostream | 0 .../{ => MIPSpro721}/irix_string | 0 .../compatibility/{ => MIPSpro721}/istream | 0 .../compatibility/{ => MIPSpro721}/iterator | 0 simgear/compatibility/{ => MIPSpro721}/new | 0 .../compatibility/{ => MIPSpro721}/sstream | 0 .../compatibility/{ => MIPSpro721}/streambuf | 0 .../compatibility/{ => MIPSpro721}/strstream | 0 simgear/compatibility/MIPSpro740/.cvsignore | 2 ++ simgear/compatibility/MIPSpro740/Makefile.am | 22 ++++++++++++ simgear/compatibility/{ => MIPSpro740}/README | 0 .../compatibility/{ => MIPSpro740}/cassert | 0 simgear/compatibility/{ => MIPSpro740}/cctype | 0 simgear/compatibility/{ => MIPSpro740}/cerrno | 0 simgear/compatibility/{ => MIPSpro740}/cfloat | 0 .../compatibility/{ => MIPSpro740}/climits | 0 .../compatibility/{ => MIPSpro740}/clocale | 0 simgear/compatibility/{ => MIPSpro740}/cmath | 0 .../compatibility/{ => MIPSpro740}/csetjmp | 0 .../compatibility/{ => MIPSpro740}/csignal | 0 .../compatibility/{ => MIPSpro740}/cstdarg | 0 .../compatibility/{ => MIPSpro740}/cstddef | 0 simgear/compatibility/{ => MIPSpro740}/cstdio | 0 .../compatibility/{ => MIPSpro740}/cstdlib | 0 .../compatibility/{ => MIPSpro740}/cstring | 0 simgear/compatibility/{ => MIPSpro740}/ctime | 0 simgear/compatibility/{ => MIPSpro740}/cwchar | 0 .../compatibility/{ => MIPSpro740}/cwctype | 0 simgear/compatibility/Makefile.am | 34 +------------------ simgear/props/props.cxx | 12 +++---- simgear/scene/sky/clouds3d/SkyBVTree.hpp | 6 ++-- .../scene/sky/clouds3d/SkyBVTreeSplitter.hpp | 4 +-- 37 files changed, 72 insertions(+), 45 deletions(-) create mode 100644 simgear/compatibility/MIPSpro721/.cvsignore create mode 100644 simgear/compatibility/MIPSpro721/Makefile.am rename simgear/compatibility/{ => MIPSpro721}/fstream (100%) rename simgear/compatibility/{ => MIPSpro721}/iomanip (100%) rename simgear/compatibility/{ => MIPSpro721}/iostream (100%) rename simgear/compatibility/{ => MIPSpro721}/irix_string (100%) rename simgear/compatibility/{ => MIPSpro721}/istream (100%) rename simgear/compatibility/{ => MIPSpro721}/iterator (100%) rename simgear/compatibility/{ => MIPSpro721}/new (100%) rename simgear/compatibility/{ => MIPSpro721}/sstream (100%) rename simgear/compatibility/{ => MIPSpro721}/streambuf (100%) rename simgear/compatibility/{ => MIPSpro721}/strstream (100%) create mode 100644 simgear/compatibility/MIPSpro740/.cvsignore create mode 100644 simgear/compatibility/MIPSpro740/Makefile.am rename simgear/compatibility/{ => MIPSpro740}/README (100%) rename simgear/compatibility/{ => MIPSpro740}/cassert (100%) rename simgear/compatibility/{ => MIPSpro740}/cctype (100%) rename simgear/compatibility/{ => MIPSpro740}/cerrno (100%) rename simgear/compatibility/{ => MIPSpro740}/cfloat (100%) rename simgear/compatibility/{ => MIPSpro740}/climits (100%) rename simgear/compatibility/{ => MIPSpro740}/clocale (100%) rename simgear/compatibility/{ => MIPSpro740}/cmath (100%) rename simgear/compatibility/{ => MIPSpro740}/csetjmp (100%) rename simgear/compatibility/{ => MIPSpro740}/csignal (100%) rename simgear/compatibility/{ => MIPSpro740}/cstdarg (100%) rename simgear/compatibility/{ => MIPSpro740}/cstddef (100%) rename simgear/compatibility/{ => MIPSpro740}/cstdio (100%) rename simgear/compatibility/{ => MIPSpro740}/cstdlib (100%) rename simgear/compatibility/{ => MIPSpro740}/cstring (100%) rename simgear/compatibility/{ => MIPSpro740}/ctime (100%) rename simgear/compatibility/{ => MIPSpro740}/cwchar (100%) rename simgear/compatibility/{ => MIPSpro740}/cwctype (100%) diff --git a/configure.ac b/configure.ac index dd44d868..5446e906 100644 --- a/configure.ac +++ b/configure.ac @@ -47,8 +47,25 @@ case "${host}" in if test "x$CXX" = "xCC" -o "x$CXX" = "xccache CC"; then AR="$CXX -ar" ARFLAGS="-o" - CXXFLAGS="$CXXFLAGS -I$(top_srcdir)/simgear/compatibility" + CXXFLAGS="$CXXFLAGS -I$(top_srcdir)/simgear/compatibility/MIPSpro740" compatibility_DIR="compatibility" + MIPSpro_DIRS="MIPSpro740" + AC_MSG_CHECKING([for MIPSpro compiler version 7.4 or newer]) + AC_TRY_RUN([ + int main() { + if ( _COMPILER_VERSION < 740 ) { + return -1; + } + return 0; + } + + ], AC_MSG_RESULT(yes), + [ AC_MSG_RESULT(no) + CXXFLAGS="$CXXFLAGS -I$(top_srcdir)/simgear/compatibility/MIPSpro721" + MIPSpro_DIRS="$(MIPSpro_DIRS) MIPSpro721" + AC_MSG_WARN([Using our own subset of the STL headers]) + ], AC_MSG_RESULT(yes)) + AC_SUBST(MIPSpro_DIRS) fi ;; *) @@ -348,6 +365,8 @@ AC_CONFIG_FILES([ \ simgear/Makefile \ simgear/version.h \ simgear/compatibility/Makefile \ + simgear/compatibility/MIPSpro721/Makefile \ + simgear/compatibility/MIPSpro740/Makefile \ simgear/bucket/Makefile \ simgear/debug/Makefile \ simgear/ephemeris/Makefile \ diff --git a/simgear/compatibility/MIPSpro721/.cvsignore b/simgear/compatibility/MIPSpro721/.cvsignore new file mode 100644 index 00000000..282522db --- /dev/null +++ b/simgear/compatibility/MIPSpro721/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/simgear/compatibility/MIPSpro721/Makefile.am b/simgear/compatibility/MIPSpro721/Makefile.am new file mode 100644 index 00000000..f70a1920 --- /dev/null +++ b/simgear/compatibility/MIPSpro721/Makefile.am @@ -0,0 +1,14 @@ +includedir = @includedir@/compatibility/ + +include_HEADERS = \ + iostream \ + strstream \ + sstream \ + istream \ + fstream \ + iterator \ + iomanip \ + new \ + streambuf \ + \ + irix_string diff --git a/simgear/compatibility/fstream b/simgear/compatibility/MIPSpro721/fstream similarity index 100% rename from simgear/compatibility/fstream rename to simgear/compatibility/MIPSpro721/fstream diff --git a/simgear/compatibility/iomanip b/simgear/compatibility/MIPSpro721/iomanip similarity index 100% rename from simgear/compatibility/iomanip rename to simgear/compatibility/MIPSpro721/iomanip diff --git a/simgear/compatibility/iostream b/simgear/compatibility/MIPSpro721/iostream similarity index 100% rename from simgear/compatibility/iostream rename to simgear/compatibility/MIPSpro721/iostream diff --git a/simgear/compatibility/irix_string b/simgear/compatibility/MIPSpro721/irix_string similarity index 100% rename from simgear/compatibility/irix_string rename to simgear/compatibility/MIPSpro721/irix_string diff --git a/simgear/compatibility/istream b/simgear/compatibility/MIPSpro721/istream similarity index 100% rename from simgear/compatibility/istream rename to simgear/compatibility/MIPSpro721/istream diff --git a/simgear/compatibility/iterator b/simgear/compatibility/MIPSpro721/iterator similarity index 100% rename from simgear/compatibility/iterator rename to simgear/compatibility/MIPSpro721/iterator diff --git a/simgear/compatibility/new b/simgear/compatibility/MIPSpro721/new similarity index 100% rename from simgear/compatibility/new rename to simgear/compatibility/MIPSpro721/new diff --git a/simgear/compatibility/sstream b/simgear/compatibility/MIPSpro721/sstream similarity index 100% rename from simgear/compatibility/sstream rename to simgear/compatibility/MIPSpro721/sstream diff --git a/simgear/compatibility/streambuf b/simgear/compatibility/MIPSpro721/streambuf similarity index 100% rename from simgear/compatibility/streambuf rename to simgear/compatibility/MIPSpro721/streambuf diff --git a/simgear/compatibility/strstream b/simgear/compatibility/MIPSpro721/strstream similarity index 100% rename from simgear/compatibility/strstream rename to simgear/compatibility/MIPSpro721/strstream diff --git a/simgear/compatibility/MIPSpro740/.cvsignore b/simgear/compatibility/MIPSpro740/.cvsignore new file mode 100644 index 00000000..282522db --- /dev/null +++ b/simgear/compatibility/MIPSpro740/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/simgear/compatibility/MIPSpro740/Makefile.am b/simgear/compatibility/MIPSpro740/Makefile.am new file mode 100644 index 00000000..cb138d62 --- /dev/null +++ b/simgear/compatibility/MIPSpro740/Makefile.am @@ -0,0 +1,22 @@ +includedir = @includedir@/compatibility + +EXTRA_DIST = README + +include_HEADERS = \ + cfloat \ + csetjmp \ + cstdio \ + cwchar \ + cassert \ + climits \ + csignal \ + cstdlib \ + cwctype \ + cctype \ + clocale \ + cstdarg \ + cstring \ + cerrno \ + cmath \ + cstddef \ + ctime diff --git a/simgear/compatibility/README b/simgear/compatibility/MIPSpro740/README similarity index 100% rename from simgear/compatibility/README rename to simgear/compatibility/MIPSpro740/README diff --git a/simgear/compatibility/cassert b/simgear/compatibility/MIPSpro740/cassert similarity index 100% rename from simgear/compatibility/cassert rename to simgear/compatibility/MIPSpro740/cassert diff --git a/simgear/compatibility/cctype b/simgear/compatibility/MIPSpro740/cctype similarity index 100% rename from simgear/compatibility/cctype rename to simgear/compatibility/MIPSpro740/cctype diff --git a/simgear/compatibility/cerrno b/simgear/compatibility/MIPSpro740/cerrno similarity index 100% rename from simgear/compatibility/cerrno rename to simgear/compatibility/MIPSpro740/cerrno diff --git a/simgear/compatibility/cfloat b/simgear/compatibility/MIPSpro740/cfloat similarity index 100% rename from simgear/compatibility/cfloat rename to simgear/compatibility/MIPSpro740/cfloat diff --git a/simgear/compatibility/climits b/simgear/compatibility/MIPSpro740/climits similarity index 100% rename from simgear/compatibility/climits rename to simgear/compatibility/MIPSpro740/climits diff --git a/simgear/compatibility/clocale b/simgear/compatibility/MIPSpro740/clocale similarity index 100% rename from simgear/compatibility/clocale rename to simgear/compatibility/MIPSpro740/clocale diff --git a/simgear/compatibility/cmath b/simgear/compatibility/MIPSpro740/cmath similarity index 100% rename from simgear/compatibility/cmath rename to simgear/compatibility/MIPSpro740/cmath diff --git a/simgear/compatibility/csetjmp b/simgear/compatibility/MIPSpro740/csetjmp similarity index 100% rename from simgear/compatibility/csetjmp rename to simgear/compatibility/MIPSpro740/csetjmp diff --git a/simgear/compatibility/csignal b/simgear/compatibility/MIPSpro740/csignal similarity index 100% rename from simgear/compatibility/csignal rename to simgear/compatibility/MIPSpro740/csignal diff --git a/simgear/compatibility/cstdarg b/simgear/compatibility/MIPSpro740/cstdarg similarity index 100% rename from simgear/compatibility/cstdarg rename to simgear/compatibility/MIPSpro740/cstdarg diff --git a/simgear/compatibility/cstddef b/simgear/compatibility/MIPSpro740/cstddef similarity index 100% rename from simgear/compatibility/cstddef rename to simgear/compatibility/MIPSpro740/cstddef diff --git a/simgear/compatibility/cstdio b/simgear/compatibility/MIPSpro740/cstdio similarity index 100% rename from simgear/compatibility/cstdio rename to simgear/compatibility/MIPSpro740/cstdio diff --git a/simgear/compatibility/cstdlib b/simgear/compatibility/MIPSpro740/cstdlib similarity index 100% rename from simgear/compatibility/cstdlib rename to simgear/compatibility/MIPSpro740/cstdlib diff --git a/simgear/compatibility/cstring b/simgear/compatibility/MIPSpro740/cstring similarity index 100% rename from simgear/compatibility/cstring rename to simgear/compatibility/MIPSpro740/cstring diff --git a/simgear/compatibility/ctime b/simgear/compatibility/MIPSpro740/ctime similarity index 100% rename from simgear/compatibility/ctime rename to simgear/compatibility/MIPSpro740/ctime diff --git a/simgear/compatibility/cwchar b/simgear/compatibility/MIPSpro740/cwchar similarity index 100% rename from simgear/compatibility/cwchar rename to simgear/compatibility/MIPSpro740/cwchar diff --git a/simgear/compatibility/cwctype b/simgear/compatibility/MIPSpro740/cwctype similarity index 100% rename from simgear/compatibility/cwctype rename to simgear/compatibility/MIPSpro740/cwctype diff --git a/simgear/compatibility/Makefile.am b/simgear/compatibility/Makefile.am index 404ebfc7..ad644560 100644 --- a/simgear/compatibility/Makefile.am +++ b/simgear/compatibility/Makefile.am @@ -1,33 +1 @@ -includedir = @includedir@/compatibility - -EXTRA_DIST = README - -include_HEADERS = \ - cfloat \ - csetjmp \ - cstdio \ - cwchar \ - iostream \ - strstream \ - sstream \ - cassert \ - climits \ - csignal \ - cstdlib \ - cwctype \ - istream \ - cctype \ - clocale \ - cstdarg \ - cstring \ - fstream \ - iterator \ - cerrno \ - cmath \ - cstddef \ - ctime \ - iomanip \ - new \ - streambuf \ - \ - irix_string +SUBDIRS = $(MIPSpro_DIRS) diff --git a/simgear/props/props.cxx b/simgear/props/props.cxx index c6f5145b..44047422 100644 --- a/simgear/props/props.cxx +++ b/simgear/props/props.cxx @@ -71,12 +71,12 @@ public: // Default values for every type. //////////////////////////////////////////////////////////////////////// -const bool SGRawValue::DefaultValue = false; -const int SGRawValue::DefaultValue = 0; -const long SGRawValue::DefaultValue = 0L; -const float SGRawValue::DefaultValue = 0.0; -const double SGRawValue::DefaultValue = 0.0L; -const char * const SGRawValue::DefaultValue = ""; +template<> const bool SGRawValue::DefaultValue = false; +template<> const int SGRawValue::DefaultValue = 0; +template<> const long SGRawValue::DefaultValue = 0L; +template<> const float SGRawValue::DefaultValue = 0.0; +template<> const double SGRawValue::DefaultValue = 0.0L; +template<> const char * const SGRawValue::DefaultValue = ""; diff --git a/simgear/scene/sky/clouds3d/SkyBVTree.hpp b/simgear/scene/sky/clouds3d/SkyBVTree.hpp index aa03dcac..8f646ff1 100644 --- a/simgear/scene/sky/clouds3d/SkyBVTree.hpp +++ b/simgear/scene/sky/clouds3d/SkyBVTree.hpp @@ -214,9 +214,9 @@ class SkyBVTree : public SkyBaseBVTree { public: typedef SkyBaseBVTree BaseTree; - typedef BaseTree::BV BV; - typedef BaseTree::NodeObject NodeObject; - typedef BaseTree::Node Node; + typedef typename SkyBaseBVTree::BV BV; + typedef typename BaseTree::NodeObject NodeObject; + typedef typename BaseTree::Node Node; void Clear() { diff --git a/simgear/scene/sky/clouds3d/SkyBVTreeSplitter.hpp b/simgear/scene/sky/clouds3d/SkyBVTreeSplitter.hpp index 2bf1f543..35457d55 100644 --- a/simgear/scene/sky/clouds3d/SkyBVTreeSplitter.hpp +++ b/simgear/scene/sky/clouds3d/SkyBVTreeSplitter.hpp @@ -52,7 +52,7 @@ template class SkyBoundingBoxSplitter { public: - typedef SkyBaseBVTree::NodeObject NodeObjectBox; + typedef typename SkyBaseBVTree::NodeObject NodeObjectBox; //typedef SkyBaseBVTree::NodeObject NodeObjectSphere; #if _MSC_VER == 1200 @@ -183,7 +183,7 @@ class SkyAABBTreeSplitter { public: typedef SkyMinMaxBox BV; - typedef SkyBaseBVTree::NodeObject NodeObject; + typedef typename SkyBaseBVTree::NodeObject NodeObject; SkyAABBTreeSplitter(const NodeObject* pObjs, unsigned int iNumObjs) : _splitter(pObjs, iNumObjs) {} -- 2.39.5