From 4c0f52af839e2b831fef3f38e19df9e8824bfd3f Mon Sep 17 00:00:00 2001 From: curt Date: Thu, 23 Dec 1999 17:17:48 +0000 Subject: [PATCH] 21.12.1999 Christian Mayer: Added a fix for compatibility to gcc 2.8 which suggested by Oliver Delise. --- src/WeatherCM/FGTurbulenceItem.h | 10 +++++++++- src/WeatherCM/FGWeatherVectorWrap.h | 10 +++++++++- src/WeatherCM/FGWindItem.h | 10 +++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/WeatherCM/FGTurbulenceItem.h b/src/WeatherCM/FGTurbulenceItem.h index 8818eb94c..ffec95503 100644 --- a/src/WeatherCM/FGTurbulenceItem.h +++ b/src/WeatherCM/FGTurbulenceItem.h @@ -36,6 +36,8 @@ HISTORY suggestion 19.10.1999 Christian Mayer change to use PLIB's sg instead of Point[2/3]D and lots of wee code cleaning +21.12.1999 Christian Mayer Added a fix for compatibility to gcc 2.8 which + suggested by Oliver Delise *****************************************************************************/ /****************************************************************************/ @@ -68,6 +70,12 @@ HISTORY class FGTurbulenceItem; FGTurbulenceItem operator-(const FGTurbulenceItem& arg); +#if ( __GNU_C__ == 2 && __GNU_MAJOR__ < 9 ) +# define const_sgVec3 const sgVec3 +#else +# define const_sgVec3 const sgVec3& +#endif + /****************************************************************************/ /* CLASS DECLARATION */ /****************************************************************************/ @@ -78,7 +86,7 @@ private: protected: public: - FGTurbulenceItem(const sgVec3& v) { sgCopyVec3(value, v);} + FGTurbulenceItem(const_sgVec3 v) { sgCopyVec3(value, v);} FGTurbulenceItem() { sgZeroVec3(value); } void getValue(sgVec3 ret) const { sgCopyVec3(ret, value); }; diff --git a/src/WeatherCM/FGWeatherVectorWrap.h b/src/WeatherCM/FGWeatherVectorWrap.h index 76b3f95fd..68f47fcb6 100644 --- a/src/WeatherCM/FGWeatherVectorWrap.h +++ b/src/WeatherCM/FGWeatherVectorWrap.h @@ -32,6 +32,8 @@ HISTORY 18.10.1999 Christian Mayer Created 19.10.1999 Christian Mayer change to use PLIB's sg instead of Point[2/3]D and lots of wee code cleaning +21.12.1999 Christian Mayer Added a fix for compatibility to gcc 2.8 which + suggested by Oliver Delise *****************************************************************************/ /****************************************************************************/ @@ -48,12 +50,18 @@ HISTORY /****************************************************************************/ /* DEFINES */ /****************************************************************************/ +#if ( __GNU_C__ == 2 && __GNU_MAJOR__ < 9 ) +# define const_sgVec2 const sgVec2 +#else +# define const_sgVec2 const sgVec2& +#endif + struct sgVec2Wrap { sgVec2 p; sgVec2Wrap(); - sgVec2Wrap( const sgVec2& src ) { sgCopyVec2( p, src ); } + sgVec2Wrap( const_sgVec2 src ) { sgCopyVec2( p, src ); } }; #endif /*FGWeatherVectorWrap_H*/ diff --git a/src/WeatherCM/FGWindItem.h b/src/WeatherCM/FGWindItem.h index ceffd6d02..0a745e02c 100644 --- a/src/WeatherCM/FGWindItem.h +++ b/src/WeatherCM/FGWindItem.h @@ -36,6 +36,8 @@ HISTORY suggestion 19.10.1999 Christian Mayer change to use PLIB's sg instead of Point[2/3]D and lots of wee code cleaning +21.12.1999 Christian Mayer Added a fix for compatibility to gcc 2.8 which + suggested by Oliver Delise *****************************************************************************/ /****************************************************************************/ @@ -68,6 +70,12 @@ HISTORY class FGWindItem; FGWindItem operator-(const FGWindItem& arg); +#if ( __GNU_C__ == 2 && __GNU_MAJOR__ < 9 ) +# define const_sgVec3 const sgVec3 +#else +# define const_sgVec3 const sgVec3& +#endif + /****************************************************************************/ /* CLASS DECLARATION */ /****************************************************************************/ @@ -79,7 +87,7 @@ private: protected: public: - FGWindItem(const sgVec3& v) { sgCopyVec3(value, v); } + FGWindItem(const_sgVec3 v) { sgCopyVec3(value, v); } FGWindItem(const WeatherPrecision x, const WeatherPrecision y, const WeatherPrecision z) { sgSetVec3 (value, x, y, z); } FGWindItem() { sgZeroVec3(value); } -- 2.39.5