From: curt Date: Thu, 4 Apr 2002 06:05:51 +0000 (+0000) Subject: Re-arranged include files to reduce external dependencies for a slight X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6a399b24a3f51b983dfb66d0b3e7015322f05e3a;p=flightgear.git Re-arranged include files to reduce external dependencies for a slight improvement in compilation speed. --- diff --git a/src/Airports/runways.cxx b/src/Airports/runways.cxx index b768ea61b..23c7d68dd 100644 --- a/src/Airports/runways.cxx +++ b/src/Airports/runways.cxx @@ -41,12 +41,39 @@ SG_USING_NAMESPACE(std); +#ifndef _MSC_VER +#define NDEBUG // MSVC needs this +#endif // !_MSC_VER + +#include +#include + +#ifndef _MSC_VER +#undef NDEBUG +#endif // !_MSC_VER + +#ifdef SG_HAVE_STD_INCLUDES +# include +#elif defined( SG_HAVE_NATIVE_SGI_COMPILERS ) +# include +#elif defined( __BORLANDC__ ) +# include +#else +# include +#endif -FGRunway::FGRunway() { -} +#if ! defined( SG_HAVE_NATIVE_SGI_COMPILERS ) +SG_USING_STD(istream); +#endif +inline istream& +operator >> ( istream& in, FGRunway& a ) +{ + int tmp; -FGRunway::~FGRunway() { + return in >> a.rwy_no >> a.lat >> a.lon >> a.heading >> a.length >> a.width + >> a.surface_flags >> a.end1_flags >> tmp >> tmp >> a.end2_flags + >> tmp >> tmp; } diff --git a/src/Airports/runways.hxx b/src/Airports/runways.hxx index 041e90476..a0ff3ec26 100644 --- a/src/Airports/runways.hxx +++ b/src/Airports/runways.hxx @@ -36,37 +36,16 @@ #include -#ifdef SG_HAVE_STD_INCLUDES -# include -#elif defined( SG_HAVE_NATIVE_SGI_COMPILERS ) -# include -#elif defined( __BORLANDC__ ) -# include -#else -# include -#endif - #include STL_STRING #include -#ifndef _MSC_VER -#define NDEBUG // she don't work without it. -#endif // !_MSC_VER - -#include -#include - -#ifndef _MSC_VER -#undef NDEBUG -#endif // !_MSC_VER +// Forward declarations. +class c4_Storage; +class c4_View; SG_USING_STD(string); SG_USING_STD(vector); -#if ! defined( SG_HAVE_NATIVE_SGI_COMPILERS ) -SG_USING_STD(istream); -#endif - class FGRunway { @@ -87,22 +66,11 @@ public: public: - FGRunway(); - ~FGRunway(); + FGRunway() {} + ~FGRunway() {} }; -inline istream& -operator >> ( istream& in, FGRunway& a ) -{ - int tmp; - - return in >> a.rwy_no >> a.lat >> a.lon >> a.heading >> a.length >> a.width - >> a.surface_flags >> a.end1_flags >> tmp >> tmp >> a.end2_flags - >> tmp >> tmp; -} - - class FGRunways { private: diff --git a/src/Airports/simple.cxx b/src/Airports/simple.cxx index 583e54e00..395fbcdb1 100644 --- a/src/Airports/simple.cxx +++ b/src/Airports/simple.cxx @@ -23,20 +23,10 @@ // // $Id$ - #ifdef HAVE_CONFIG_H # include #endif -// #include // for gdbm open flags -// #include // for gdbm open flags - -// #ifdef HAVE_GDBM -// # include -// #else -// # include -// #endif - #include #include @@ -50,6 +40,36 @@ SG_USING_NAMESPACE(std); +#ifndef _MSC_VER +# define NDEBUG // she don't work without it. +#endif +#include +#include +#ifndef _MSC_VER +# undef NDEBUG +#endif + +#ifdef SG_HAVE_STD_INCLUDES +# include +#elif defined( SG_HAVE_NATIVE_SGI_COMPILERS ) +# include +#elif defined( __BORLANDC__ ) +# include +#else +# include +#endif +#if ! defined( SG_HAVE_NATIVE_SGI_COMPILERS ) +SG_USING_STD(istream); +#endif + + +inline istream& +operator >> ( istream& in, FGAirport& a ) +{ + return in >> a.id >> a.latitude >> a.longitude >> a.elevation; +} + + FGAirports::FGAirports( const string& file ) { // open the specified database readonly storage = new c4_Storage( file.c_str(), false ); diff --git a/src/Airports/simple.hxx b/src/Airports/simple.hxx index 05d11101f..288586417 100644 --- a/src/Airports/simple.hxx +++ b/src/Airports/simple.hxx @@ -38,36 +38,16 @@ #include -#ifdef SG_HAVE_STD_INCLUDES -# include -#elif defined( SG_HAVE_NATIVE_SGI_COMPILERS ) -# include -#elif defined( __BORLANDC__ ) -# include -#else -# include -#endif - #include STL_STRING #include -#ifndef _MSC_VER -# define NDEBUG // she don't work without it. -#endif -#include -#include -#ifndef _MSC_VER -# undef NDEBUG -#endif +// Forward declarations. +class c4_Storage; +class c4_View; SG_USING_STD(string); SG_USING_STD(set); -#if ! defined( SG_HAVE_NATIVE_SGI_COMPILERS ) -SG_USING_STD(istream); -#endif - - class FGAirport { public: @@ -91,12 +71,6 @@ public: }; -inline istream& -operator >> ( istream& in, FGAirport& a ) -{ - return in >> a.id >> a.latitude >> a.longitude >> a.elevation; -} - class FGAirports {