From 8b269dc00083bf6e5eb543955233b910f10ee42d Mon Sep 17 00:00:00 2001 From: curt Date: Tue, 7 Jan 2003 22:46:51 +0000 Subject: [PATCH] Erik Hofman: A big honkin' set of minor tweaks to bring TerraGear into Irix compliance. --- autogen.sh | 26 +---------- configure.ac | 55 +++++++++++++++++++----- src/Airports/GenAirports/build.cxx | 3 +- src/Airports/GenAirports/lights.cxx | 2 +- src/Airports/GenAirports/rwy_nonprec.cxx | 2 +- src/Airports/GenAirports/rwy_prec.cxx | 2 +- src/Airports/GenAirports/rwy_visual.cxx | 2 +- src/BuildTiles/Clipper/clipper.cxx | 2 - src/BuildTiles/GenOutput/genobj.cxx | 2 - src/BuildTiles/Main/main.cxx | 2 - src/BuildTiles/Match/match.cxx | 2 - src/BuildTiles/Parallel/client.cxx | 2 +- src/BuildTiles/Parallel/server.cxx | 5 ++- src/BuildTiles/Triangulate/triangle.cxx | 2 - src/Lib/Array/array.cxx | 2 - src/Lib/DEM/dem.cxx | 2 - src/Lib/Geometry/trisegs.cxx | 2 - src/Lib/Optimize/genfans.cxx | 2 - src/Lib/Output/output.cxx | 2 - src/Lib/Polygon/polygon.cxx | 2 - src/Lib/Polygon/polygon.hxx | 2 - src/Lib/e00/e00.cxx | 24 +++++------ src/Lib/e00/e00.hxx | 2 - src/Lib/landcover/landcover.cxx | 2 - src/Lib/landcover/landcover.hxx | 2 - src/Lib/landcover/test-landcover.cxx | 2 - src/Lib/vpf/coverage.cxx | 12 +++++- src/Lib/vpf/feature.cxx | 12 +++--- src/Lib/vpf/property.cxx | 2 +- src/Lib/vpf/table.cxx | 10 ++++- src/Prep/DemChop/demchop.cxx | 2 - src/Prep/DemInfo/deminfo.cxx | 2 - src/Prep/E00Lines/Makefile.am | 1 + src/Prep/E00Lines/main.cxx | 2 - src/Prep/GSHHS/gshhs_split.cxx | 2 - src/Prep/GSHHS/main.cxx | 2 - src/Prep/ShapeFile/noaa-decode.cxx | 2 - src/Prep/ShapeFile/shape-decode.cxx | 4 +- src/Prep/TGVPF/Makefile.am | 1 + src/Prep/TGVPF/tgvpf.cxx | 4 +- src/Prep/UserDef/Makefile.am | 1 + src/Prep/UserDef/tguserdef.cxx | 2 +- 42 files changed, 100 insertions(+), 116 deletions(-) diff --git a/autogen.sh b/autogen.sh index e09c31b9..5f504000 100644 --- a/autogen.sh +++ b/autogen.sh @@ -17,12 +17,6 @@ echo -n " automake: `automake --version | head -1 | awk '{print $4}'`" echo " ($AUTO_MAKE_VERSION)" echo "" -ACLOCAL_OPTS="" -if [ $AUTO_MAKE_VERSION -ge 14 ]; then - if [ $OSTYPE = "IRIX" -o $OSTYPE = "IRIX64" ]; then echo " -I ." - ACLOCAL_OPTS="-I ." - fi -fi echo "Running aclocal $ACLOCAL_OPTS" aclocal $ACLOCAL_OPTS @@ -33,14 +27,8 @@ if [ ! -e src/Include/config.h.in ]; then exit 1 fi -echo -n "Running automake" -if [ $OSTYPE = "IRIX" -o $OSTYPE = "IRIX64" ]; then - echo " --add-missing --include-deps" - automake --add-missing --include-deps -else - echo " --add-missing" - automake --add-missing -fi +echo "Running automake --add-missing" +automake --add-missing echo "Running autoconf" autoconf @@ -50,16 +38,6 @@ if [ ! -e configure ]; then exit 1 fi -# fixup Makefiles for Irix -if test "$OSTYPE" = "IRIX" -o "$OSTYPE" = "IRIX64"; then - echo "Fixing Makefiles for Irix" - for n in `find . -name Makefile.in`; do \ - mv -f $n $n.ar-new; \ - sed 's/$(AR) cru/$(AR) -o/g' $n.ar-new > $n; \ - rm -f $n.ar-new; \ - done; -fi - echo "" echo "======================================" diff --git a/configure.ac b/configure.ac index 4b71bd5c..0b969106 100644 --- a/configure.ac +++ b/configure.ac @@ -20,14 +20,35 @@ AC_PROG_RANLIB AC_PROG_INSTALL AC_PROG_LN_S -AR="ar" -OS=`uname -s` -if test "$OS" = "IRIX" -o "$OS" = "IRIX64"; then +# specify the simgear location +AC_ARG_WITH(simgear, [ --with-simgear=PREFIX Specify the prefix path to simgear]) + +if test "x$with_simgear" != "x" ; then + echo "SimGear prefix path is $with_simgear" + EXTRA_DIRS="${EXTRA_DIRS} $with_simgear" +fi + +dnl set the $host variable based on local machine/os +AC_CANONICAL_HOST + +case "${host}" in +*-*-irix*) if test "$CXX" = "CC"; then AR="CC -ar" - AC_SUBST(AR) + ARFLAGS="-o" + CXXFLAGS="$CXXFLAGS -I$with_simgear/include/simgear/compatibility" + else + AR="ar" + ARFLAGS="cru" fi -fi + ;; +*) + AR="ar" + ARFLAGS="cru" + ;; +esac +AC_SUBST(AR) +AC_SUBST(ARFLAGS) dnl Specify if we want logging (testing build) or not (release build) # set logging default value @@ -285,6 +306,24 @@ AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM +dnl check for socklen_t (in Unix98) +AC_MSG_CHECKING(for socklen_t) +AC_TRY_COMPILE([ +#include +#include +int accept (int, struct sockaddr *, socklen_t *); +],[],[ +AC_MSG_RESULT(yes)],[ +AC_TRY_COMPILE([ +#include +#include +int accept (int, struct sockaddr *, size_t *); +],[],[ +AC_MSG_RESULT(size_t) +AC_DEFINE([socklen_t], size_t, [Define for socklen_t])], [ +AC_MSG_RESULT(int) +AC_DEFINE([socklen_t], int, [Define for socklen_t])])]) + dnl Checks for library functions. AC_TYPE_SIGNAL AC_FUNC_VPRINTF @@ -350,9 +389,3 @@ else echo "Debug messages: yes" fi -if test "$OS" = "IRIX" -o "$OS" = "IRIX64"; then - if test "$CXX" = "CC"; then - echo "\nRemember to run: sh ../FlightGear-0.x.x/irix-hack.sh!\07\n" - fi -fi - diff --git a/src/Airports/GenAirports/build.cxx b/src/Airports/GenAirports/build.cxx index fdcb6c3f..7228fe8f 100644 --- a/src/Airports/GenAirports/build.cxx +++ b/src/Airports/GenAirports/build.cxx @@ -559,7 +559,8 @@ void build_airport( string airport_raw, float alt_m, // 3rd pass: generate all remaining runways not covered in the first pass for ( i = 0; i < (int)runways.size(); ++i ) { string type_flag = runways[i].surface_flags.substr(2, 1); - if ( type_flag != "P" && type_flag != "R" && type_flag != "V" ) { + if ( type_flag != string("P") && type_flag != string("R") + && type_flag != string("V") ) { build_runway( runways[i], elev * SG_FEET_TO_METER, &rwy_polys, &texparams, &accum, &apt_base, &apt_clearing ); diff --git a/src/Airports/GenAirports/lights.cxx b/src/Airports/GenAirports/lights.cxx index 0da8669a..2531430e 100644 --- a/src/Airports/GenAirports/lights.cxx +++ b/src/Airports/GenAirports/lights.cxx @@ -324,7 +324,7 @@ static superpoly_list gen_runway_threshold_lights( const FGRunway& rwy_info, ref2 = Point3D( lon, lat, 0.0 ); // five lights for each side - for ( int i = 0; i < 5; ++i ) { + for ( i = 0; i < 5; ++i ) { g_lights.push_back( ref1 ); g_normals.push_back( normal1 ); diff --git a/src/Airports/GenAirports/rwy_nonprec.cxx b/src/Airports/GenAirports/rwy_nonprec.cxx index c3ecbbe7..8e5f2bd1 100644 --- a/src/Airports/GenAirports/rwy_nonprec.cxx +++ b/src/Airports/GenAirports/rwy_nonprec.cxx @@ -142,7 +142,7 @@ void gen_non_precision_rwy( const FGRunway& rwy_info, SG_LOG(SG_GENERAL, SG_DEBUG, "Runway designation = " << rwy_info.rwy_no); SG_LOG(SG_GENERAL, SG_DEBUG, "Runway designation letter = " << letter); - if ( letter != "" ) { + if ( !letter.empty() ) { start_pct = end_pct; end_pct = start_pct + ( 90.0 / length ); gen_runway_section( rwy_info, runway_a, diff --git a/src/Airports/GenAirports/rwy_prec.cxx b/src/Airports/GenAirports/rwy_prec.cxx index 3e09d51d..4e8ab761 100644 --- a/src/Airports/GenAirports/rwy_prec.cxx +++ b/src/Airports/GenAirports/rwy_prec.cxx @@ -145,7 +145,7 @@ void gen_precision_rwy( const FGRunway& rwy_info, SG_LOG(SG_GENERAL, SG_DEBUG, "Runway designation = " << rwy_info.rwy_no); SG_LOG(SG_GENERAL, SG_DEBUG, "Runway designation letter = " << letter); - if ( letter != "" ) { + if ( !letter.empty() ) { start_pct = end_pct; end_pct = start_pct + ( 90.0 / length ); gen_runway_section( rwy_info, runway_a, diff --git a/src/Airports/GenAirports/rwy_visual.cxx b/src/Airports/GenAirports/rwy_visual.cxx index 69d64866..3db347d6 100644 --- a/src/Airports/GenAirports/rwy_visual.cxx +++ b/src/Airports/GenAirports/rwy_visual.cxx @@ -131,7 +131,7 @@ void gen_visual_rwy( const FGRunway& rwy_info, SG_LOG(SG_GENERAL, SG_DEBUG, "Runway designation = " << rwy_info.rwy_no); SG_LOG(SG_GENERAL, SG_DEBUG, "Runway designation letter = " << letter); - if ( letter != "" ) { + if ( !letter.empty() ) { start_pct = end_pct; end_pct = start_pct + ( 90.0 / length ); gen_runway_section( rwy_info, runway_a, diff --git a/src/BuildTiles/Clipper/clipper.cxx b/src/BuildTiles/Clipper/clipper.cxx index b25ab671..cfc6ac0f 100644 --- a/src/BuildTiles/Clipper/clipper.cxx +++ b/src/BuildTiles/Clipper/clipper.cxx @@ -37,9 +37,7 @@ #include "clipper.hxx" -#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD(cout); -#endif #define MASK_CLIP 1 diff --git a/src/BuildTiles/GenOutput/genobj.cxx b/src/BuildTiles/GenOutput/genobj.cxx index 54238dc2..0b89f3ef 100644 --- a/src/BuildTiles/GenOutput/genobj.cxx +++ b/src/BuildTiles/GenOutput/genobj.cxx @@ -40,10 +40,8 @@ #include "genobj.hxx" -#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD(cout); SG_USING_STD(endl); -#endif // calculate the global bounding sphere. Center is the center of the diff --git a/src/BuildTiles/Main/main.cxx b/src/BuildTiles/Main/main.cxx index 6cbb470e..f6119b14 100644 --- a/src/BuildTiles/Main/main.cxx +++ b/src/BuildTiles/Main/main.cxx @@ -62,10 +62,8 @@ #include "construct.hxx" -#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD(cout); SG_USING_STD(endl); -#endif SG_USING_STD(string); SG_USING_STD(vector); diff --git a/src/BuildTiles/Match/match.cxx b/src/BuildTiles/Match/match.cxx index 1b645658..53f3a70c 100644 --- a/src/BuildTiles/Match/match.cxx +++ b/src/BuildTiles/Match/match.cxx @@ -36,10 +36,8 @@ #include "match.hxx" -#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD(cout); SG_USING_STD(endl); -#endif FGMatch::FGMatch( void ) { diff --git a/src/BuildTiles/Parallel/client.cxx b/src/BuildTiles/Parallel/client.cxx index ed7cbece..b27df3b9 100644 --- a/src/BuildTiles/Parallel/client.cxx +++ b/src/BuildTiles/Parallel/client.cxx @@ -3,7 +3,7 @@ #ifdef HAVE_CONFIG_H -# include +# include #endif #ifdef HAVE_SYS_PARAM_H diff --git a/src/BuildTiles/Parallel/server.cxx b/src/BuildTiles/Parallel/server.cxx index 4753e044..a558b7e8 100644 --- a/src/BuildTiles/Parallel/server.cxx +++ b/src/BuildTiles/Parallel/server.cxx @@ -1,6 +1,9 @@ // remote_server.c -- Written by Curtis Olson // -- for CSci 5502 +#ifdef HAVE_CONFIG_H +#include +#endif #include #include @@ -26,7 +29,7 @@ SG_USING_STD( cout ); SG_USING_STD( cerr ); SG_USING_STD( endl ); -#if defined (sun) || defined (__CYGWIN__) +#if defined (sun) || defined (__CYGWIN__) || defined(sgi) # define WAIT_ANY (pid_t)-1 #endif diff --git a/src/BuildTiles/Triangulate/triangle.cxx b/src/BuildTiles/Triangulate/triangle.cxx index 86d5428c..8369df74 100644 --- a/src/BuildTiles/Triangulate/triangle.cxx +++ b/src/BuildTiles/Triangulate/triangle.cxx @@ -28,10 +28,8 @@ #include "triangle.hxx" -#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD(cout); SG_USING_STD(endl); -#endif // Constructor diff --git a/src/Lib/Array/array.cxx b/src/Lib/Array/array.cxx index 95ec4b30..f18b0267 100644 --- a/src/Lib/Array/array.cxx +++ b/src/Lib/Array/array.cxx @@ -58,10 +58,8 @@ #include "array.hxx" SG_USING_STD(string); -#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD(cout); SG_USING_STD(endl); -#endif FGArray::FGArray( void ) { diff --git a/src/Lib/DEM/dem.cxx b/src/Lib/DEM/dem.cxx index c30c75dc..67b328b9 100644 --- a/src/Lib/DEM/dem.cxx +++ b/src/Lib/DEM/dem.cxx @@ -57,10 +57,8 @@ #include "dem.hxx" -#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD(cout); SG_USING_STD(endl); -#endif #define MAX_EX_NODES 10000 diff --git a/src/Lib/Geometry/trisegs.cxx b/src/Lib/Geometry/trisegs.cxx index ca5681e9..6c3b67b3 100644 --- a/src/Lib/Geometry/trisegs.cxx +++ b/src/Lib/Geometry/trisegs.cxx @@ -28,10 +28,8 @@ #include "trisegs.hxx" -#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD(cout); SG_USING_STD(endl); -#endif // Constructor diff --git a/src/Lib/Optimize/genfans.cxx b/src/Lib/Optimize/genfans.cxx index 3c7a7650..8fb895dc 100644 --- a/src/Lib/Optimize/genfans.cxx +++ b/src/Lib/Optimize/genfans.cxx @@ -27,10 +27,8 @@ #include "genfans.hxx" -#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD( cout ); SG_USING_STD( endl ); -#endif // make sure the list is expanded at least to hold "n" and then push diff --git a/src/Lib/Output/output.cxx b/src/Lib/Output/output.cxx index 0f4a597d..6fd0e5bd 100644 --- a/src/Lib/Output/output.cxx +++ b/src/Lib/Output/output.cxx @@ -45,10 +45,8 @@ # include #endif -#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD( cout ); SG_USING_STD( endl ); -#endif void write_polygon( const FGPolygon& poly, const string& base ) { diff --git a/src/Lib/Polygon/polygon.cxx b/src/Lib/Polygon/polygon.cxx index 1749fb17..306c1253 100644 --- a/src/Lib/Polygon/polygon.cxx +++ b/src/Lib/Polygon/polygon.cxx @@ -34,9 +34,7 @@ extern "C" { #include #include -#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD(endl); -#endif #include diff --git a/src/Lib/Polygon/polygon.hxx b/src/Lib/Polygon/polygon.hxx index 47bcd83c..b66305dd 100644 --- a/src/Lib/Polygon/polygon.hxx +++ b/src/Lib/Polygon/polygon.hxx @@ -37,9 +37,7 @@ #include STL_STRING #include -#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD(ostream); -#endif SG_USING_STD(string); SG_USING_STD(vector); diff --git a/src/Lib/e00/e00.cxx b/src/Lib/e00/e00.cxx index c54a1880..7f119147 100644 --- a/src/Lib/e00/e00.cxx +++ b/src/Lib/e00/e00.cxx @@ -28,7 +28,7 @@ SG_USING_STD(endl); * Append an integer to a string. */ static void -append (string &s, int i) +strAppend (string &s, int i) { char buf[128]; sprintf(buf, "%d", i); @@ -40,7 +40,7 @@ append (string &s, int i) * Append a double-precision real to a string. */ static void -append (string &s, double f) +strAppend (string &s, double f) { char buf[128]; sprintf(buf, "%f", f); @@ -150,7 +150,7 @@ expect (istream &input, int i) input >> in; if (in != i) { string message = "Expected "; - append(message, i); + strAppend(message, i); throw E00Exception(message.c_str()); } } @@ -166,7 +166,7 @@ expect (istream &input, double f) input >> in; if (in != f) { string message = "Expected "; - append(message, f); + strAppend(message, f); throw E00Exception(message.c_str()); } } @@ -180,7 +180,7 @@ expect (istream &input, const char *s) { string in; input >> in; - if (in != s) { + if (in != string(s)) { string message = "Expected "; message += s; throw E00Exception(message.c_str()); @@ -490,7 +490,7 @@ E00::readTX6 () *_input >> dummy; // FIXME: will fail if "JABBERWOCKY" appears // in the text annotation itself - while (dummy != "JABBERWOCKY") + while (dummy != string("JABBERWOCKY")) *_input >> dummy; } @@ -502,7 +502,7 @@ E00::readTX7 () *_input >> dummy; // FIXME: will fail if "JABBERWOCKY" appears // in the text annotation itself - while (dummy != "JABBERWOCKY") + while (dummy != string("JABBERWOCKY")) *_input >> dummy; } @@ -513,7 +513,7 @@ E00::readRXP () *_input >> dummy; // FIXME: will fail if "JABBERWOCKY" appears // in the text annotation itself - while (dummy != "JABBERWOCKY") + while (dummy != string("JABBERWOCKY")) *_input >> dummy; } @@ -524,7 +524,7 @@ E00::readRPL () *_input >> dummy; // FIXME: will fail if "JABBERWOCKY" appears // in the text annotation itself - while (dummy != "JABBERWOCKY") + while (dummy != string("JABBERWOCKY")) *_input >> dummy; } @@ -548,7 +548,7 @@ E00::readIFO () *_input >> line; while (line != string("EOI")) { - + int i; // Start of a new IFO file. IFO ifo; IFO::Entry entry; @@ -570,7 +570,7 @@ E00::readIFO () // Read the item definitions ifo.defs.resize(0); - for (int i = 0; i < ifo.numItems; i++) { + for (i = 0; i < ifo.numItems; i++) { IFO::ItemDef def; *_input >> def.itemName; @@ -593,7 +593,7 @@ E00::readIFO () // Read the data records ifo.entries.resize(0); - for (int i = 0; i < ifo.numDataRecords; i++) { + for (i = 0; i < ifo.numDataRecords; i++) { // cout << " Reading entry " << i << endl; entry.resize(0); line_pos = 0; diff --git a/src/Lib/e00/e00.hxx b/src/Lib/e00/e00.hxx index 0419601b..f94398fa 100644 --- a/src/Lib/e00/e00.hxx +++ b/src/Lib/e00/e00.hxx @@ -11,9 +11,7 @@ SG_USING_STD(vector); SG_USING_STD(string); -#if ! defined(SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD(istream); -#endif // An exception reading an E00 file. diff --git a/src/Lib/landcover/landcover.cxx b/src/Lib/landcover/landcover.cxx index 7b529d1a..6b2e63b2 100644 --- a/src/Lib/landcover/landcover.cxx +++ b/src/Lib/landcover/landcover.cxx @@ -10,9 +10,7 @@ #include "landcover.hxx" -#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD(ifstream); -#endif SG_USING_STD(string); LandCover::LandCover( const string &filename ) diff --git a/src/Lib/landcover/landcover.hxx b/src/Lib/landcover/landcover.hxx index 9eacc9c9..6602ef80 100644 --- a/src/Lib/landcover/landcover.hxx +++ b/src/Lib/landcover/landcover.hxx @@ -12,9 +12,7 @@ #include STL_STRING #include STL_FSTREAM -#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD(ifstream); -#endif SG_USING_STD(string); diff --git a/src/Lib/landcover/test-landcover.cxx b/src/Lib/landcover/test-landcover.cxx index be4bc61d..17ecf93f 100644 --- a/src/Lib/landcover/test-landcover.cxx +++ b/src/Lib/landcover/test-landcover.cxx @@ -12,11 +12,9 @@ #include "landcover.hxx" -#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD(cerr); SG_USING_STD(cout); SG_USING_STD(endl); -#endif SG_USING_STD(string); int diff --git a/src/Lib/vpf/coverage.cxx b/src/Lib/vpf/coverage.cxx index ff6d7498..e0019d62 100644 --- a/src/Lib/vpf/coverage.cxx +++ b/src/Lib/vpf/coverage.cxx @@ -84,8 +84,16 @@ VpfCoverage::hasFeature (const string &name) const { if (_feature_names == 0) getFeatureNames(); - return (find(_feature_names->begin(), _feature_names->end(), name) - != _feature_names->end()); + + vector::iterator it; + for (it = _feature_names->begin(); it != _feature_names->end(); it++) + if (*it == name) + return(it != _feature_names->end()); + + return false; + + // return (std::find(_feature_names->begin(), _feature_names->end(), name) + // != _feature_names->end()); } const VpfFeature diff --git a/src/Lib/vpf/feature.cxx b/src/Lib/vpf/feature.cxx index 0121f50c..e4e3b14c 100644 --- a/src/Lib/vpf/feature.cxx +++ b/src/Lib/vpf/feature.cxx @@ -247,12 +247,12 @@ VpfFeature::getFCA () const bool VpfFeature::isProperty (const string &name) const { - return (name != "id" && - name != "tile_id" && - name != "end_id" && - name != "edg_id" && - name != "fac_id" && - name != "txt_id"); + return (name != string("id") && + name != string("tile_id") && + name != string("end_id") && + name != string("edg_id") && + name != string("fac_id") && + name != string("txt_id")); } const string diff --git a/src/Lib/vpf/property.cxx b/src/Lib/vpf/property.cxx index edc439fe..49634108 100644 --- a/src/Lib/vpf/property.cxx +++ b/src/Lib/vpf/property.cxx @@ -112,7 +112,7 @@ VpfPropertyDecl::getVDTName () const bool VpfPropertyDecl::hasVDT () const { - return (getVDTName() != "-"); + return (getVDTName() != string("-")); } const VpfTable & diff --git a/src/Lib/vpf/table.cxx b/src/Lib/vpf/table.cxx index 46575cac..c70a78d2 100644 --- a/src/Lib/vpf/table.cxx +++ b/src/Lib/vpf/table.cxx @@ -4,6 +4,8 @@ #include #include +#include // ios_binary + using std::string; using std::ifstream; using std::istream; @@ -290,11 +292,11 @@ VpfTable::read (const string &fileName) _path = fileName; ifstream input; - input.open(fileName.c_str(), std::ios::binary); + input.open(fileName.c_str(), ios_binary); if (!input) { input.clear(); string fileName2 = fileName + '.'; - input.open(fileName2.c_str(), std::ios::binary); + input.open(fileName2.c_str(), ios_binary); } if (!input) throw VpfException(string("Failed to open VPF table file ") + fileName); @@ -363,7 +365,11 @@ VpfTable::read_row (istream &input, VpfValue * row) if (!input.get(c)) return false; else +#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS) input.unget(); +#else + input.putback(c); +#endif // OK, continue int nCols = _columns.size(); for (int i = 0; i < nCols; i++) { diff --git a/src/Prep/DemChop/demchop.cxx b/src/Prep/DemChop/demchop.cxx index 663c5417..3935ee20 100644 --- a/src/Prep/DemChop/demchop.cxx +++ b/src/Prep/DemChop/demchop.cxx @@ -37,9 +37,7 @@ #include "point2d.hxx" -#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD(cout); -#endif SG_USING_STD(string); diff --git a/src/Prep/DemInfo/deminfo.cxx b/src/Prep/DemInfo/deminfo.cxx index 21fd7fb9..4ba503be 100644 --- a/src/Prep/DemInfo/deminfo.cxx +++ b/src/Prep/DemInfo/deminfo.cxx @@ -29,9 +29,7 @@ #include -#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD(cout); -#endif // static float dem_data[DEM_SIZE_1][DEM_SIZE_1]; diff --git a/src/Prep/E00Lines/Makefile.am b/src/Prep/E00Lines/Makefile.am index 00d5e78a..7421a2f5 100644 --- a/src/Prep/E00Lines/Makefile.am +++ b/src/Prep/E00Lines/Makefile.am @@ -6,6 +6,7 @@ e00lines_LDADD = \ $(top_builddir)/src/Lib/Geometry/libGeometry.a \ $(top_builddir)/src/Lib/Polygon/libPolygon.a \ $(top_builddir)/src/Lib/poly2tri/libpoly2tri.a \ + $(top_builddir)/src/Lib/TriangleJRS/libTriangleJRS.a \ $(top_builddir)/src/Lib/e00/libe00.a \ -lsgdebug -lsgbucket -lsgmisc -lsgmath -lsgio -lsgxml -lgenpolyclip -lz diff --git a/src/Prep/E00Lines/main.cxx b/src/Prep/E00Lines/main.cxx index d84be878..deaf81ab 100644 --- a/src/Prep/E00Lines/main.cxx +++ b/src/Prep/E00Lines/main.cxx @@ -37,10 +37,8 @@ #include STL_STRING #include -#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD(cerr); SG_USING_STD(cout); -#endif SG_USING_STD(string); SG_USING_STD(vector); diff --git a/src/Prep/GSHHS/gshhs_split.cxx b/src/Prep/GSHHS/gshhs_split.cxx index cbe45337..b683efde 100644 --- a/src/Prep/GSHHS/gshhs_split.cxx +++ b/src/Prep/GSHHS/gshhs_split.cxx @@ -36,9 +36,7 @@ #include "gshhs_split.hxx" -#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD(cout); -#endif SG_USING_STD(string); diff --git a/src/Prep/GSHHS/main.cxx b/src/Prep/GSHHS/main.cxx index 7641c80d..66935b06 100644 --- a/src/Prep/GSHHS/main.cxx +++ b/src/Prep/GSHHS/main.cxx @@ -48,9 +48,7 @@ #include "gshhs_split.hxx" SG_USING_STD( string ); -#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD( cout ); -#endif // hackity, hackity, hack ... cough cough #ifdef i386 diff --git a/src/Prep/ShapeFile/noaa-decode.cxx b/src/Prep/ShapeFile/noaa-decode.cxx index b615a6bc..88f834a2 100644 --- a/src/Prep/ShapeFile/noaa-decode.cxx +++ b/src/Prep/ShapeFile/noaa-decode.cxx @@ -39,9 +39,7 @@ # include #endif -#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD( cout ); -#endif SG_USING_STD( string ); // return the type of the shapefile record diff --git a/src/Prep/ShapeFile/shape-decode.cxx b/src/Prep/ShapeFile/shape-decode.cxx index 0e2de217..f3844752 100644 --- a/src/Prep/ShapeFile/shape-decode.cxx +++ b/src/Prep/ShapeFile/shape-decode.cxx @@ -39,9 +39,7 @@ # include #endif -#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD( cout ); -#endif SG_USING_STD( string ); // return the type of the shapefile record @@ -214,7 +212,7 @@ int main( int argc, char **argv ) { string shapetype = SHPTypeName( nShapeType ); - if ( shapetype != "Polygon" ) { + if ( shapetype != string("Polygon") ) { SG_LOG( SG_GENERAL, SG_ALERT, "Can't handle non-polygon shape files" ); exit(-1); } diff --git a/src/Prep/TGVPF/Makefile.am b/src/Prep/TGVPF/Makefile.am index 53542407..de3e8fa6 100644 --- a/src/Prep/TGVPF/Makefile.am +++ b/src/Prep/TGVPF/Makefile.am @@ -6,6 +6,7 @@ tgvpf_LDADD = \ $(top_builddir)/src/Lib/Geometry/libGeometry.a \ $(top_builddir)/src/Lib/Polygon/libPolygon.a \ $(top_builddir)/src/Lib/poly2tri/libpoly2tri.a \ + $(top_builddir)/src/Lib/TriangleJRS/libTriangleJRS.a \ $(top_builddir)/src/Lib/vpf/libvpf.a \ -lsgdebug -lsgbucket -lsgmisc -lsgmath -lsgio -lsgxml -lgenpolyclip -lz diff --git a/src/Prep/TGVPF/tgvpf.cxx b/src/Prep/TGVPF/tgvpf.cxx index 505b71c9..93ef208c 100644 --- a/src/Prep/TGVPF/tgvpf.cxx +++ b/src/Prep/TGVPF/tgvpf.cxx @@ -37,10 +37,8 @@ #include STL_STRING #include -#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS) SG_USING_STD(cerr); SG_USING_STD(cout); -#endif SG_USING_STD(string); SG_USING_STD(vector); @@ -485,7 +483,7 @@ main (int argc, const char **argv) const tg::Line line = vpf2tg(feature.getLine(i)); if (!bounds.isOverlapping(line.getBounds())) continue; - makePolygon(line, (width == -1 ? 50 : width), shape); + tg::makePolygon(line, (width == -1 ? 50 : width), shape); break; } case VpfFeature::POLYGON: { diff --git a/src/Prep/UserDef/Makefile.am b/src/Prep/UserDef/Makefile.am index 7c3eb15b..c302b8d3 100644 --- a/src/Prep/UserDef/Makefile.am +++ b/src/Prep/UserDef/Makefile.am @@ -6,6 +6,7 @@ tguserdef_LDADD = \ $(top_builddir)/src/Lib/Geometry/libGeometry.a \ $(top_builddir)/src/Lib/Polygon/libPolygon.a \ $(top_builddir)/src/Lib/poly2tri/libpoly2tri.a \ + $(top_builddir)/src/Lib/TriangleJRS/libTriangleJRS.a \ -lsgbucket -lsgmisc -lsgmath -lsgio -lsgxml -lsgdebug -lgenpolyclip -lz INCLUDES = -I$(top_srcdir)/src/Lib diff --git a/src/Prep/UserDef/tguserdef.cxx b/src/Prep/UserDef/tguserdef.cxx index 6c3dc238..e9b88e2e 100644 --- a/src/Prep/UserDef/tguserdef.cxx +++ b/src/Prep/UserDef/tguserdef.cxx @@ -84,7 +84,7 @@ add_line (SGPropertyNode_ptr node) } FGPolygon poly; - makePolygon(line, node->getIntValue("width", 10), poly); + tg::makePolygon(line, node->getIntValue("width", 10), poly); poly = polygon_int(poly, bounds_poly); split_polygon(".", material, poly); }