From cd72eb20c6b31e253e93e55c13ca4966eb1556fc Mon Sep 17 00:00:00 2001 From: ehofman Date: Fri, 25 Jul 2008 10:39:20 +0000 Subject: [PATCH] Attached patches remove BORLANDC, and hence SG_MATH_EXCEPTION_CLASH and SG_INCOM PLETE_FUNCTIONAL from SimGear and FlightGear. As a result, SG_HAVE_STD_INCLUDES is now *always* set, so I will get the boring fixes for that done, but separately. I'm still auditing the other things in comp ilers.h - there's a lot that can die now BORLAND is gone. --- simgear/compiler.h | 105 +--------------------------- simgear/constants.h | 3 - simgear/ephemeris/celestialBody.cxx | 3 - simgear/ephemeris/jupiter.cxx | 4 -- simgear/ephemeris/mars.cxx | 3 - simgear/ephemeris/mercury.cxx | 3 - simgear/ephemeris/moonpos.cxx | 3 - simgear/ephemeris/saturn.cxx | 3 - simgear/ephemeris/star.cxx | 4 -- simgear/ephemeris/uranus.cxx | 3 - simgear/ephemeris/venus.cxx | 3 - simgear/math/point3d.hxx | 4 -- simgear/misc/sgstream.hxx | 6 -- simgear/scene/material/mat.cxx | 4 -- simgear/scene/material/matlib.cxx | 4 -- simgear/scene/material/matmodel.cxx | 4 -- 16 files changed, 3 insertions(+), 156 deletions(-) diff --git a/simgear/compiler.h b/simgear/compiler.h index 733e54cf..5e64764b 100644 --- a/simgear/compiler.h +++ b/simgear/compiler.h @@ -63,8 +63,6 @@ * * (15) Defines SG_HAVE_STREAMBUF if of are present. * - * (16) Define SG_MATH_EXCEPTION_CLASH if math.h defines an exception class - * that clashes with the one defined in . */ #ifndef _SG_COMPILER_H @@ -79,48 +77,7 @@ #define SG_DO_STRINGIZE(X) #X #ifdef __GNUC__ -# if __GNUC__ == 2 -# if __GNUC_MINOR__ < 8 - - // g++-2.7.x -# define STL_ALGORITHM -# define STL_FUNCTIONAL -# define STL_IOMANIP -# define STL_IOSTREAM -# define STL_ITERATOR -# define STL_FSTREAM -# define STL_STDEXCEPT -# define STL_STRING -# define STL_STRSTREAM - -# define SG_NEED_AUTO_PTR -# define SG_NO_DEFAULT_TEMPLATE_ARGS -# define SG_INCOMPLETE_FUNCTIONAL -# define SG_NO_ARROW_OPERATOR - -# elif __GNUC_MINOR__ >= 8 - - // g++-2.8.x and egcs-1.x -# define SG_EXPLICIT_FUNCTION_TMPL_ARGS -# define SG_NEED_AUTO_PTR -# define SG_MEMBER_TEMPLATES -# define SG_NAMESPACES -# define SG_HAVE_STD -# define SG_HAVE_STREAMBUF -# define SG_CLASS_PARTIAL_SPECIALIZATION - -# define STL_ALGORITHM -# define STL_FUNCTIONAL -# define STL_IOMANIP -# define STL_IOSTREAM -# define STL_ITERATOR -# define STL_FSTREAM -# define STL_STDEXCEPT -# define STL_STRING -# define STL_STRSTREAM - -# endif -# elif __GNUC__ >= 3 +# if __GNUC__ >= 3 // g++-3.0.x # define SG_EXPLICIT_FUNCTION_TMPL_ARGS # define SG_NEED_AUTO_PTR @@ -141,7 +98,7 @@ # define STL_STRING # define STL_STRSTREAM # else -# error Time to upgrade. GNU compilers < 2.7 not supported +# error Time to upgrade. GNU compilers < 3.0 not supported # endif # define SG_COMPILER_STR "GNU C++ version " SG_STRINGIZE(__GNUC__) "." SG_STRINGIZE(__GNUC_MINOR__) @@ -210,40 +167,6 @@ #endif // _MSC_VER -#ifdef __BORLANDC__ -# if defined(HAVE_SGI_STL_PORT) - -// Use quotes around long file names to get around Borland's include hackery - -# define STL_ALGORITHM "algorithm" -# define STL_FUNCTIONAL "functional" - -# define SG_MATH_EXCEPTION_CLASH - -# else - -# define STL_ALGORITHM -# define STL_FUNCTIONAL -# define STL_IOMANIP -# define STL_STDEXCEPT -# define STL_STRSTREAM - -# define SG_INCOMPLETE_FUNCTIONAL - -# endif // HAVE_SGI_STL_PORT - -# define STL_IOSTREAM -# define STL_ITERATOR -# define STL_FSTREAM -# define STL_STRING -# define SG_NO_DEFAULT_TEMPLATE_ARGS -# define SG_NAMESPACES -// # define SG_HAVE_STD - -# define SG_COMPILER_STR "Borland C++ version " SG_STRINGIZE(__BORLANDC__) - -#endif // __BORLANDC__ - // // Native SGI compilers // @@ -343,6 +266,7 @@ # define SG_GLEXT_H # define SG_GLUT_H + inline int (isnan)(double r) { return !(r <= 0 || r >= 0); } #else # define SG_GL_H @@ -410,28 +334,5 @@ inline int (isnan)(double r) { return !(r <= 0 || r >= 0); } # define STD # endif -// Additional implementation from SGI STL 3.11 -// Adapter function objects: pointers to member functions -#ifdef SG_INCOMPLETE_FUNCTIONAL - -template -class const_mem_fun_ref_t -#ifndef __BORLANDC__ - : public unary_function<_Tp,_Ret> -#endif // __BORLANDC__ -{ -public: - explicit const_mem_fun_ref_t(_Ret (_Tp::*__pf)() const) : _M_f(__pf) {} - _Ret operator()(const _Tp& __r) const { return (__r.*_M_f)(); } -private: - _Ret (_Tp::*_M_f)() const; -}; - -template -inline const_mem_fun_ref_t<_Ret,_Tp> mem_fun_ref(_Ret (_Tp::*__f)() const) - { return const_mem_fun_ref_t<_Ret,_Tp>(__f); } - -#endif // SG_INCOMPLETE_FUNCTIONAL - #endif // _SG_COMPILER_H diff --git a/simgear/constants.h b/simgear/constants.h index b6fd7a90..77f83011 100644 --- a/simgear/constants.h +++ b/simgear/constants.h @@ -34,9 +34,6 @@ #ifdef SG_HAVE_STD_INCLUDES # include #else -# ifdef SG_MATH_EXCEPTION_CLASH -# define exception C_exception -# endif # include #endif diff --git a/simgear/ephemeris/celestialBody.cxx b/simgear/ephemeris/celestialBody.cxx index 8a1539cc..4e887392 100644 --- a/simgear/ephemeris/celestialBody.cxx +++ b/simgear/ephemeris/celestialBody.cxx @@ -24,9 +24,6 @@ #include -#ifdef SG_MATH_EXCEPTION_CLASH -# define exception c_exception -#endif #include #include "celestialBody.hxx" diff --git a/simgear/ephemeris/jupiter.cxx b/simgear/ephemeris/jupiter.cxx index 1c16e119..1d9ca6bd 100644 --- a/simgear/ephemeris/jupiter.cxx +++ b/simgear/ephemeris/jupiter.cxx @@ -22,10 +22,6 @@ * $Id$ **************************************************************************/ - -#ifdef __BORLANDC__ -# define exception c_exception -#endif #include #include "jupiter.hxx" diff --git a/simgear/ephemeris/mars.cxx b/simgear/ephemeris/mars.cxx index 57b4165d..78c26f35 100644 --- a/simgear/ephemeris/mars.cxx +++ b/simgear/ephemeris/mars.cxx @@ -22,9 +22,6 @@ * $Id$ **************************************************************************/ -#ifdef __BORLANDC__ -# define exception c_exception -#endif #include #include "mars.hxx" diff --git a/simgear/ephemeris/mercury.cxx b/simgear/ephemeris/mercury.cxx index 6651ed67..da450782 100644 --- a/simgear/ephemeris/mercury.cxx +++ b/simgear/ephemeris/mercury.cxx @@ -22,9 +22,6 @@ * $Id$ **************************************************************************/ -#ifdef __BORLANDC__ -# define exception c_exception -#endif #include #include "mercury.hxx" diff --git a/simgear/ephemeris/moonpos.cxx b/simgear/ephemeris/moonpos.cxx index 4f8ca09f..7908fa89 100644 --- a/simgear/ephemeris/moonpos.cxx +++ b/simgear/ephemeris/moonpos.cxx @@ -27,9 +27,6 @@ #include -#ifdef __BORLANDC__ -# define exception c_exception -#endif #include // #include diff --git a/simgear/ephemeris/saturn.cxx b/simgear/ephemeris/saturn.cxx index eed07711..0038a290 100644 --- a/simgear/ephemeris/saturn.cxx +++ b/simgear/ephemeris/saturn.cxx @@ -22,9 +22,6 @@ * $Id$ **************************************************************************/ -#ifdef __BORLANDC__ -# define exception c_exception -#endif #include #include "saturn.hxx" diff --git a/simgear/ephemeris/star.cxx b/simgear/ephemeris/star.cxx index 0bf3451d..dee21439 100644 --- a/simgear/ephemeris/star.cxx +++ b/simgear/ephemeris/star.cxx @@ -22,10 +22,6 @@ * $Id$ **************************************************************************/ - -#ifdef __BORLANDC__ -# define exception c_exception -#endif #include #include diff --git a/simgear/ephemeris/uranus.cxx b/simgear/ephemeris/uranus.cxx index a3e9162c..f3d55601 100644 --- a/simgear/ephemeris/uranus.cxx +++ b/simgear/ephemeris/uranus.cxx @@ -22,9 +22,6 @@ * $Id$ **************************************************************************/ -#ifdef __BORLANDC__ -# define exception c_exception -#endif #include #include "uranus.hxx" diff --git a/simgear/ephemeris/venus.cxx b/simgear/ephemeris/venus.cxx index 0e37bbf2..b889107e 100644 --- a/simgear/ephemeris/venus.cxx +++ b/simgear/ephemeris/venus.cxx @@ -22,9 +22,6 @@ * $Id$ **************************************************************************/ -#ifdef __BORLANDC__ -# define exception c_exception -#endif #include #include "venus.hxx" diff --git a/simgear/math/point3d.hxx b/simgear/math/point3d.hxx index 48f6e9ad..089da93a 100644 --- a/simgear/math/point3d.hxx +++ b/simgear/math/point3d.hxx @@ -37,10 +37,6 @@ #include -#ifdef SG_MATH_EXCEPTION_CLASH -# define exception c_exception -#endif - #include #include #include diff --git a/simgear/misc/sgstream.hxx b/simgear/misc/sgstream.hxx index aa680d01..fc59471f 100644 --- a/simgear/misc/sgstream.hxx +++ b/simgear/misc/sgstream.hxx @@ -33,13 +33,7 @@ #include -#if defined( SG_HAVE_STD_INCLUDES ) # include -#elif defined ( __BORLANDC__ ) -# include -#else -# include -#endif #include STL_STRING diff --git a/simgear/scene/material/mat.cxx b/simgear/scene/material/mat.cxx index 2d488f34..8edb5206 100644 --- a/simgear/scene/material/mat.cxx +++ b/simgear/scene/material/mat.cxx @@ -33,10 +33,6 @@ SG_USING_STD(map); #include -#ifdef SG_MATH_EXCEPTION_CLASH -# include -#endif - #include #include #include diff --git a/simgear/scene/material/matlib.cxx b/simgear/scene/material/matlib.cxx index b02aac76..6ef1be04 100644 --- a/simgear/scene/material/matlib.cxx +++ b/simgear/scene/material/matlib.cxx @@ -25,10 +25,6 @@ # include #endif -#ifdef SG_MATH_EXCEPTION_CLASH -# include -#endif - #ifdef HAVE_WINDOWS_H # include #endif diff --git a/simgear/scene/material/matmodel.cxx b/simgear/scene/material/matmodel.cxx index b2a4152d..1b3204da 100644 --- a/simgear/scene/material/matmodel.cxx +++ b/simgear/scene/material/matmodel.cxx @@ -36,10 +36,6 @@ SG_USING_STD(map); #include #include -#ifdef SG_MATH_EXCEPTION_CLASH -# include -#endif - #include #include #include -- 2.39.5