From bc91f0ce1c87d5950ef3d31da19eecb4e4892811 Mon Sep 17 00:00:00 2001 From: curt Date: Sat, 8 May 1999 02:33:13 +0000 Subject: [PATCH] Borland portability fixes contributed by Charlie Hotchkiss. --- Lib/Bucket/newbucket.hxx | 11 ++++------- Simulator/Cockpit/panel.cxx | 4 ++++ Simulator/FDM/JSBsim.cxx | 4 ++++ Simulator/GUI/gui.cxx | 8 ++++++-- Simulator/Main/GLUTmain.cxx | 4 ++++ Simulator/Main/fg_init.cxx | 5 +++++ Simulator/Main/fg_serial.cxx | 2 ++ Simulator/Main/splash.cxx | 4 ++++ Simulator/Objects/obj.cxx | 4 ++++ Simulator/Scenery/tile.cxx | 4 ++++ Simulator/Time/event.cxx | 8 ++++++-- Tools/Construct/Main/master.cxx | 13 ++++++++++--- Tools/Construct/Triangulate/triangle.cxx | 2 +- 13 files changed, 58 insertions(+), 15 deletions(-) diff --git a/Lib/Bucket/newbucket.hxx b/Lib/Bucket/newbucket.hxx index 6871b3ee6..743c81d61 100644 --- a/Lib/Bucket/newbucket.hxx +++ b/Lib/Bucket/newbucket.hxx @@ -28,27 +28,24 @@ #include -#include STL_STRING - #ifdef FG_HAVE_STD_INCLUDES +# include # include // sprintf() # include #else +# include # include // sprintf() # include #endif +#include STL_STRING + FG_USING_STD(string); #if ! defined( FG_HAVE_NATIVE_SGI_COMPILERS ) FG_USING_STD(ostream); #endif -#ifdef __MWERKS__ -#include -#include -#endif - #include diff --git a/Simulator/Cockpit/panel.cxx b/Simulator/Cockpit/panel.cxx index 4680e477b..e8f6fba43 100644 --- a/Simulator/Cockpit/panel.cxx +++ b/Simulator/Cockpit/panel.cxx @@ -25,6 +25,10 @@ # include #endif +#ifdef FG_MATH_EXCEPTION_CLASH +# include +#endif + #ifdef HAVE_WINDOWS_H # include #endif diff --git a/Simulator/FDM/JSBsim.cxx b/Simulator/FDM/JSBsim.cxx index 0f8dc9eef..80cc7f592 100644 --- a/Simulator/FDM/JSBsim.cxx +++ b/Simulator/FDM/JSBsim.cxx @@ -23,6 +23,10 @@ #include +#ifdef FG_MATH_EXCEPTION_CLASH +# include +#endif + #include STL_STRING #include diff --git a/Simulator/GUI/gui.cxx b/Simulator/GUI/gui.cxx index cee0a69f5..c7a88c489 100644 --- a/Simulator/GUI/gui.cxx +++ b/Simulator/GUI/gui.cxx @@ -26,12 +26,16 @@ # include #endif +#include + +#ifdef FG_MATH_EXCEPTION_CLASH +# include +#endif + #ifdef HAVE_WINDOWS_H # include #endif -#include - #include #include diff --git a/Simulator/Main/GLUTmain.cxx b/Simulator/Main/GLUTmain.cxx index 215f81818..7e037d4c0 100644 --- a/Simulator/Main/GLUTmain.cxx +++ b/Simulator/Main/GLUTmain.cxx @@ -26,6 +26,10 @@ # include #endif +#ifdef FG_MATH_EXCEPTION_CLASH +# include +#endif + #ifdef HAVE_WINDOWS_H # include # include diff --git a/Simulator/Main/fg_init.cxx b/Simulator/Main/fg_init.cxx index 3da8f3d8c..fa723fbe5 100644 --- a/Simulator/Main/fg_init.cxx +++ b/Simulator/Main/fg_init.cxx @@ -27,6 +27,11 @@ # include #endif +// For BC 5.01 this must be included before OpenGL includes. +#ifdef FG_MATH_EXCEPTION_CLASH +# include +#endif + #include #include diff --git a/Simulator/Main/fg_serial.cxx b/Simulator/Main/fg_serial.cxx index fef2c32d5..b7018ac08 100644 --- a/Simulator/Main/fg_serial.cxx +++ b/Simulator/Main/fg_serial.cxx @@ -24,8 +24,10 @@ #include #ifdef FG_HAVE_STD_INCLUDES +# include # include // atoi() #else +# include # include // atoi() #endif diff --git a/Simulator/Main/splash.cxx b/Simulator/Main/splash.cxx index ea3db088c..7f07e2918 100644 --- a/Simulator/Main/splash.cxx +++ b/Simulator/Main/splash.cxx @@ -26,6 +26,10 @@ # include #endif +#ifdef FG_MATH_EXCEPTION_CLASH +# include +#endif + #ifdef HAVE_WINDOWS_H # include #endif diff --git a/Simulator/Objects/obj.cxx b/Simulator/Objects/obj.cxx index c670fb366..936d20a87 100644 --- a/Simulator/Objects/obj.cxx +++ b/Simulator/Objects/obj.cxx @@ -25,6 +25,10 @@ # include #endif +#ifdef FG_MATH_EXCEPTION_CLASH +# include +#endif + #ifdef HAVE_WINDOWS_H # include #endif diff --git a/Simulator/Scenery/tile.cxx b/Simulator/Scenery/tile.cxx index ccbb811ca..52a271f03 100644 --- a/Simulator/Scenery/tile.cxx +++ b/Simulator/Scenery/tile.cxx @@ -23,6 +23,10 @@ #include +#ifdef FG_MATH_EXCEPTION_CLASH +# include +#endif + #include STL_FUNCTIONAL #include STL_ALGORITHM diff --git a/Simulator/Time/event.cxx b/Simulator/Time/event.cxx index 680eac6d8..9a31d19b0 100644 --- a/Simulator/Time/event.cxx +++ b/Simulator/Time/event.cxx @@ -25,12 +25,15 @@ # include #endif -#include - #include "Include/compiler.h" +#ifdef FG_MATH_EXCEPTION_CLASH +# include +#endif + #include STL_ALGORITHM #include STL_FUNCTIONAL +#include STL_STRING #ifdef FG_HAVE_STD_INCLUDES # include @@ -56,6 +59,7 @@ FG_USING_STD(for_each); FG_USING_STD(mem_fun); +FG_USING_STD(string); fgEVENT_MGR global_events; diff --git a/Tools/Construct/Main/master.cxx b/Tools/Construct/Main/master.cxx index 04d2f9cae..159f1549e 100644 --- a/Tools/Construct/Main/master.cxx +++ b/Tools/Construct/Main/master.cxx @@ -117,13 +117,20 @@ main(int argc, char **argv) { FGBucket tmp1( 0.0, 0.0 ); double dy = tmp1.get_height(); - - lat = -90.0 + dy * 0.5; + lat = 44.25 + dy * 0.5; + + bool start_lon = true; + lon = -85.75 + (1.0/16.0); + while ( lat <= 90.0 ) { FGBucket tmp2( 0.0, lat ); double dx = tmp2.get_width(); - lon = -180 + dx * 0.5; + if ( ! start_lon ) { + lon = -180 + dx * 0.5; + } else { + start_lon = false; + } while ( lon <= 180.0 ) { FGBucket b( lon, lat ); cout << "Bucket = " << b << endl; diff --git a/Tools/Construct/Triangulate/triangle.cxx b/Tools/Construct/Triangulate/triangle.cxx index 4258f93b7..f3adb95f4 100644 --- a/Tools/Construct/Triangulate/triangle.cxx +++ b/Tools/Construct/Triangulate/triangle.cxx @@ -402,7 +402,7 @@ int FGTriangle::run_triangulate( int pass ) { vorout.normlist = (REAL *) NULL; // Needed only if -v switch used. // TEMPORARY - // write_out_data(&in); + write_out_data(&in); // Triangulate the points. Switches are chosen to read and write // a PSLG (p), preserve the convex hull (c), number everything