From: ehofman Date: Fri, 25 Jul 2008 18:35:40 +0000 (+0000) Subject: Reduce compiler.h to almost nothing (but it's worth keeping around I think, for X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=733e6fa14ff507a1022ecab8d55cc9bf587bee40;p=simgear.git Reduce compiler.h to almost nothing (but it's worth keeping around I think, for the MSVC and MipsPro warning stuff). As a result of this patch, simgear/sg_traits.h can be deleted. So can SGCMath.h, but I'll do that separately. There is one more 'mechanical' change to come - getting rid of SG_USING_STD(X), but I want to keep that separate from everything else. (There's another mechnica l change, replacing with and so on *everywhere*, but one step a t a time) --- diff --git a/simgear/Makefile.am b/simgear/Makefile.am index 112fac7a..44e28bb1 100644 --- a/simgear/Makefile.am +++ b/simgear/Makefile.am @@ -10,7 +10,7 @@ METAR_DIRS = environment EXTRA_DIST = simgear_config.h.vc5 simgear_config.h-msvc71 version.h.in include_HEADERS = \ - compiler.h constants.h sg_inlines.h sg_traits.hxx version.h + compiler.h constants.h sg_inlines.h version.h SUBDIRS = \ $(compatibility_DIR) \ diff --git a/simgear/compiler.h b/simgear/compiler.h index 5e64764b..beb409fd 100644 --- a/simgear/compiler.h +++ b/simgear/compiler.h @@ -23,45 +23,8 @@ * A set of defines to encapsulate compiler and platform differences. * Please refer to the source code for full documentation on this file. * - * Here is a summary of what this file does. - * - * (1) Defines macros for some STL includes which may be affected - * by file name length limitations. - * - * (2) Defines macros for some features not supported by all C++ compilers. - * - * (3) Defines 'explicit' as a null macro if the compiler doesn't support - * the explicit keyword. - * - * (4) Defines 'typename' as a null macro if the compiler doesn't support - * the typename keyword. - * - * (5) Defines bool, true and false if the compiler doesn't do so. - * - * (6) Defines SG_EXPLICIT_FUNCTION_TMPL_ARGS if the compiler - * supports calling a function template by providing its template - * arguments explicitly. - * - * (7) Defines SG_NEED_AUTO_PTR if STL doesn't provide auto_ptr<>. - * - * (8) Defines SG_NO_ARROW_OPERATOR if the compiler is unable - * to support operator->() for iterators. - * - * (9) Defines SG_USE_EXCEPTIONS if the compiler supports exceptions. - * Note: no FlightGear code uses exceptions. - * - * (10) Define SG_NAMESPACES if the compiler supports namespaces. - * - * (11) SG_MATH_FN_IN_NAMESPACE_STD -- not used?? - * - * (12) Define SG_HAVE_STD if std namespace is supported. - * - * (13) Defines SG_CLASS_PARTIAL_SPECIALIZATION if the compiler - * supports partial specialization of class templates. - * - * (14) Defines SG_HAVE_STD_INCLUDES to use ISO C++ Standard headers. - * - * (15) Defines SG_HAVE_STREAMBUF if of are present. + * This file is useful to set compiler-specific options in every file - for + * example, disabling warnings. * */ @@ -77,55 +40,18 @@ #define SG_DO_STRINGIZE(X) #X #ifdef __GNUC__ -# if __GNUC__ >= 3 - // g++-3.0.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 SG_HAVE_STD_INCLUDES - -# 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 -# else +# if __GNUC__ < 3 # error Time to upgrade. GNU compilers < 3.0 not supported +# elif (__GNUC__ == 3) && (__GNUC_MINOR__ < 4) +# warning GCC compilers prior to 3.4 are suspect # endif # define SG_COMPILER_STR "GNU C++ version " SG_STRINGIZE(__GNUC__) "." SG_STRINGIZE(__GNUC_MINOR__) - #endif // __GNUC__ /* KAI C++ */ #if defined(__KCC) - -# define SG_NAMESPACES -# define SG_HAVE_STD -# define SG_HAVE_STREAMBUF -# define SG_HAVE_TRAITS -# define SG_HAVE_STD_INCLUDES - -# 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_COMPILER_STR "Kai C++ version " SG_STRINGIZE(__KCC_VERSION) - #endif // __KCC // @@ -133,24 +59,8 @@ // #ifdef _MSC_VER # define bcopy(from, to, n) memcpy(to, from, n) -# define FG_MEM_COPY(to,from,n) memcpy(to, from, n) # if _MSC_VER >= 1200 // msvc++ 6.0 or greater -# define SG_NAMESPACES -# define SG_HAVE_STD -# define SG_HAVE_STD_INCLUDES -# define SG_HAVE_STREAMBUF - -# 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 isnan _isnan # define snprintf _snprintf # define copysign _copysign @@ -172,40 +82,18 @@ // #if defined ( sgi ) && !defined( __GNUC__ ) -# define SG_HAVE_NATIVE_SGI_COMPILERS - -# define SG_EXPLICIT_FUNCTION_TMPL_ARGS -# define SG_CLASS_PARTIAL_SPECIALIZATION -# define SG_NEED_AUTO_PTR -# define SG_MEMBER_TEMPLATES -# define SG_NAMESPACES -# define SG_HAVE_STD -# define SG_HAVE_STREAMBUF -# define SG_HAVE_TRAITS -# define SG_HAVE_STD_INCLUDES - -# define STL_ALGORITHM -# define STL_FUNCTIONAL -# define STL_IOMANIP -# define STL_IOSTREAM -# define STL_ITERATOR -# define STL_FSTREAM -# define STL_STDEXCEPT -#if (_COMPILER_VERSION < 740) -# define STL_STRING -#else -# define STL_STRING -#endif -# define STL_STRSTREAM +# if (_COMPILER_VERSION < 740) +# error Need MipsPro 7.4.0 or higher now +# endif + +#define SG_HAVE_NATIVE_SGI_COMPILERS #pragma set woff 1001,1012,1014,1116,1155,1172,1174 #pragma set woff 1401,1460,1551,1552,1681 #ifdef __cplusplus -#pragma set woff 1682,3303 -#if (_COMPILER_VERSION >= 740) -# pragma set woff 3624 -#endif +# pragma set woff 1682,3303 +# pragma set woff 3624 #endif # define SG_COMPILER_STR "SGI MipsPro compiler version " SG_STRINGIZE(_COMPILER_VERSION) @@ -235,24 +123,7 @@ // Intel C++ Compiler // #if defined(__ICC) || defined (__ECC) -# define SG_NAMESPACES -# define SG_HAVE_STD -# define SG_HAVE_STREAMBUF -# define SG_HAVE_TRAITS -# define SG_HAVE_STD_INCLUDES - -# 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_COMPILER_STR "Intel C++ version " SG_STRINGIZE(__ICC) - #endif // __ICC // @@ -281,58 +152,10 @@ inline int (isnan)(double r) { return !(r <= 0 || r >= 0); } // No user modifiable definitions beyond here. // -#ifdef SG_NEED_EXPLICIT -# define explicit -#endif - -#ifdef SG_NEED_TYPENAME -# define typename -#endif - -#ifdef SG_NEED_MUTABLE -# define mutable -#endif - -#ifdef SG_NEED_BOOL - typedef int bool; -# define true 1 -# define false 0 -#endif - -#ifdef SG_EXPLICIT_FUNCTION_TMPL_ARGS -# define SG_NULL_TMPL_ARGS <> -#else -# define SG_NULL_TMPL_ARGS -#endif - -#ifdef SG_CLASS_PARTIAL_SPECIALIZATION -# define SG_TEMPLATE_NULL template<> -#else -# define SG_TEMPLATE_NULL -#endif - -// SG_NO_NAMESPACES is a hook so that users can disable namespaces -// without having to edit library headers. -#if defined(SG_NAMESPACES) && !defined(SG_NO_NAMESPACES) -# define SG_NAMESPACE(X) namespace X { -# define SG_NAMESPACE_END } -# define SG_USING_NAMESPACE(X) using namespace X -# else -# define SG_NAMESPACE(X) -# define SG_NAMESPACE_END -# define SG_USING_NAMESPACE(X) -#endif - /** \def SG_USING_STD(x) - * Expands to using std::x if SG_HAVE_STD is defined + * Expands to using std::X */ -# ifdef SG_HAVE_STD # define SG_USING_STD(X) using std::X -# define STD std -# else -# define SG_USING_STD(X) -# define STD -# endif #endif // _SG_COMPILER_H diff --git a/simgear/constants.h b/simgear/constants.h index 77f83011..df0fc8ba 100644 --- a/simgear/constants.h +++ b/simgear/constants.h @@ -31,11 +31,8 @@ #include -#ifdef SG_HAVE_STD_INCLUDES -# include -#else -# include -#endif +#include + #include diff --git a/simgear/debug/logstream.hxx b/simgear/debug/logstream.hxx index 1b97803e..80f1892c 100644 --- a/simgear/debug/logstream.hxx +++ b/simgear/debug/logstream.hxx @@ -31,13 +31,8 @@ # include #endif -#ifdef SG_HAVE_STD_INCLUDES -# include -# include -#else -# include -# include -#endif +#include +#include #include @@ -64,13 +59,6 @@ class logbuf : public std::streambuf #endif { public: - -#ifndef SG_HAVE_STD_INCLUDES - typedef char_traits traits_type; - typedef char_traits::int_type int_type; - // typedef char_traits::pos_type pos_type; - // typedef char_traits::off_type off_type; -#endif // logbuf( streambuf* sb ) : sbuf(sb) {} /** Constructor */ logbuf(); @@ -167,11 +155,7 @@ private: inline int logbuf::sync() { -#ifdef SG_HAVE_STD_INCLUDES return sbuf->pubsync(); -#else - return sbuf->sync(); -#endif } inline void diff --git a/simgear/environment/visual_enviro.hxx b/simgear/environment/visual_enviro.hxx index 4ee2d7f3..b5bec163 100644 --- a/simgear/environment/visual_enviro.hxx +++ b/simgear/environment/visual_enviro.hxx @@ -25,7 +25,7 @@ #include #include -#include STL_STRING +#include #include SG_USING_STD(vector); diff --git a/simgear/io/decode_binobj.cxx b/simgear/io/decode_binobj.cxx index 2865db57..f2af87d8 100644 --- a/simgear/io/decode_binobj.cxx +++ b/simgear/io/decode_binobj.cxx @@ -5,7 +5,7 @@ #include #include -#include STL_IOSTREAM +#include #include "sg_binobj.hxx" diff --git a/simgear/io/iochannel.hxx b/simgear/io/iochannel.hxx index a0392a34..a81ca467 100644 --- a/simgear/io/iochannel.hxx +++ b/simgear/io/iochannel.hxx @@ -32,7 +32,7 @@ // #include "protocol.hxx" -#include STL_STRING +#include #include SG_USING_STD(vector); diff --git a/simgear/io/lowtest.cxx b/simgear/io/lowtest.cxx index b4bc0e04..91113cb1 100644 --- a/simgear/io/lowtest.cxx +++ b/simgear/io/lowtest.cxx @@ -1,6 +1,6 @@ #include -#include STL_IOSTREAM +#include #include "lowlevel.hxx" diff --git a/simgear/io/sg_binobj.cxx b/simgear/io/sg_binobj.cxx index 62e3fbe1..692ee56a 100644 --- a/simgear/io/sg_binobj.cxx +++ b/simgear/io/sg_binobj.cxx @@ -33,7 +33,7 @@ #include #include -#include STL_STRING +#include #include #include diff --git a/simgear/io/sg_binobj.hxx b/simgear/io/sg_binobj.hxx index d5c108fc..7fd5eb47 100644 --- a/simgear/io/sg_binobj.hxx +++ b/simgear/io/sg_binobj.hxx @@ -39,7 +39,7 @@ #include #include -#include STL_STRING +#include diff --git a/simgear/io/sg_file.cxx b/simgear/io/sg_file.cxx index 60d553cd..df96aa8e 100644 --- a/simgear/io/sg_file.cxx +++ b/simgear/io/sg_file.cxx @@ -23,7 +23,7 @@ #include -#include STL_STRING +#include #if defined(_MSC_VER) || defined(__MINGW32__) # include diff --git a/simgear/io/sg_serial.cxx b/simgear/io/sg_serial.cxx index 8f06b82c..e2e068f8 100644 --- a/simgear/io/sg_serial.cxx +++ b/simgear/io/sg_serial.cxx @@ -25,7 +25,7 @@ #include -#include STL_STRING +#include #include #include diff --git a/simgear/io/sg_serial.hxx b/simgear/io/sg_serial.hxx index b7c8553d..d1c22ab9 100644 --- a/simgear/io/sg_serial.hxx +++ b/simgear/io/sg_serial.hxx @@ -36,12 +36,6 @@ #include -// #ifdef SG_HAVE_STD_INCLUDES -// # include -// #else -// # include -// #endif - #include #include "iochannel.hxx" diff --git a/simgear/io/sg_socket.cxx b/simgear/io/sg_socket.cxx index 433415dc..8dcbd6be 100644 --- a/simgear/io/sg_socket.cxx +++ b/simgear/io/sg_socket.cxx @@ -31,7 +31,7 @@ #include #endif -#include STL_IOSTREAM +#include #include diff --git a/simgear/io/sg_socket.hxx b/simgear/io/sg_socket.hxx index f54e090d..40ffde38 100644 --- a/simgear/io/sg_socket.hxx +++ b/simgear/io/sg_socket.hxx @@ -34,7 +34,7 @@ #include -#include STL_STRING +#include #include #include diff --git a/simgear/io/sg_socket_udp.hxx b/simgear/io/sg_socket_udp.hxx index 731909af..d9006fe6 100644 --- a/simgear/io/sg_socket_udp.hxx +++ b/simgear/io/sg_socket_udp.hxx @@ -36,7 +36,7 @@ #include -#include STL_STRING +#include #include #include diff --git a/simgear/io/socktest.cxx b/simgear/io/socktest.cxx index 1cd8f79f..ed654981 100644 --- a/simgear/io/socktest.cxx +++ b/simgear/io/socktest.cxx @@ -5,7 +5,7 @@ #include #include -#include STL_IOSTREAM +#include #include "sg_socket.hxx" #include "lowlevel.hxx" diff --git a/simgear/io/tcp_client.cxx b/simgear/io/tcp_client.cxx index dc9b171e..4bd9b945 100644 --- a/simgear/io/tcp_client.cxx +++ b/simgear/io/tcp_client.cxx @@ -1,5 +1,5 @@ #include -#include STL_IOSTREAM +#include #ifdef _WIN32 #include diff --git a/simgear/io/tcp_server.cxx b/simgear/io/tcp_server.cxx index b0534937..89161f53 100644 --- a/simgear/io/tcp_server.cxx +++ b/simgear/io/tcp_server.cxx @@ -1,7 +1,7 @@ #include #include -#include STL_STRING -#include STL_IOSTREAM +#include +#include #include "sg_socket.hxx" diff --git a/simgear/magvar/coremag.cxx b/simgear/magvar/coremag.cxx index e7b868d3..e6d42c1d 100644 --- a/simgear/magvar/coremag.cxx +++ b/simgear/magvar/coremag.cxx @@ -86,8 +86,6 @@ #include "coremag.hxx" - -static const double pi = 3.14159265358979; static const double a = 6378.137; /* semi-major axis (equatorial radius) of WGS84 ellipsoid */ static const double b = 6356.7523142; /* semi-minor axis referenced to the WGS84 ellipsoid */ static const double r_0 = 6371.2; /* standard Earth magnetic reference radius */ @@ -325,7 +323,7 @@ double calc_magvar( double lat, double lon, double h, long dat, double* field ) } /* Find geodetic field components: */ - psi = theta - ((pi / 2.0) - lat); + psi = theta - ((M_PI / 2.0) - lat); sinpsi = sin(psi); cospsi = cos(psi); X = -B_theta * cospsi - B_r * sinpsi; diff --git a/simgear/math/SGCMath.hxx b/simgear/math/SGCMath.hxx index d6e22133..c5b4a379 100644 --- a/simgear/math/SGCMath.hxx +++ b/simgear/math/SGCMath.hxx @@ -20,12 +20,6 @@ #include -#ifdef SG_HAVE_STD_INCLUDES -// We have cmath from the standard c++ lib available #include -#else -// We only have math.h with the c89 double functions. -#include -#endif #endif diff --git a/simgear/math/SGMath.hxx b/simgear/math/SGMath.hxx index 3770408c..d5fe3994 100644 --- a/simgear/math/SGMath.hxx +++ b/simgear/math/SGMath.hxx @@ -22,8 +22,9 @@ #include // FIXME, make it compile on IRIX -#include -#undef GLUT_APIENTRY_DEFINED // GL/glut.h undef APIENTRY when this symbol is defined. osg/GL defines it (?). + +//#include +//#undef GLUT_APIENTRY_DEFINED // GL/glut.h undef APIENTRY when this symbol is defined. osg/GL defines it (?). // This probably would work if we didn't use plib/pu.h that include GL/glut.h // on its side. diff --git a/simgear/math/interpolater.cxx b/simgear/math/interpolater.cxx index 59caa2fc..6502ba5a 100644 --- a/simgear/math/interpolater.cxx +++ b/simgear/math/interpolater.cxx @@ -25,7 +25,7 @@ #include -#include STL_STRING +#include #include #include diff --git a/simgear/math/interpolater.hxx b/simgear/math/interpolater.hxx index 797ddf4f..06ed3832 100644 --- a/simgear/math/interpolater.hxx +++ b/simgear/math/interpolater.hxx @@ -39,7 +39,7 @@ #include -#include STL_STRING +#include SG_USING_STD(string); class SGPropertyNode; diff --git a/simgear/math/sg_types.hxx b/simgear/math/sg_types.hxx index a1107f11..e629a55a 100644 --- a/simgear/math/sg_types.hxx +++ b/simgear/math/sg_types.hxx @@ -35,7 +35,7 @@ #include -#include STL_STRING +#include #include #include diff --git a/simgear/misc/sg_path.hxx b/simgear/misc/sg_path.hxx index a0636085..db3b300d 100644 --- a/simgear/misc/sg_path.hxx +++ b/simgear/misc/sg_path.hxx @@ -31,7 +31,7 @@ #include #include -#include STL_STRING +#include #include diff --git a/simgear/misc/sgstream.cxx b/simgear/misc/sgstream.cxx index ec758afb..6d5352c8 100644 --- a/simgear/misc/sgstream.cxx +++ b/simgear/misc/sgstream.cxx @@ -21,15 +21,9 @@ // $Id$ #include -#include STL_STRING - +#include #include // isspace() - -#ifdef SG_HAVE_STD_INCLUDES -# include -#else -# include -#endif +#include #include "sgstream.hxx" diff --git a/simgear/misc/sgstream.hxx b/simgear/misc/sgstream.hxx index fc59471f..a0414b18 100644 --- a/simgear/misc/sgstream.hxx +++ b/simgear/misc/sgstream.hxx @@ -35,7 +35,7 @@ # include -#include STL_STRING +#include #include diff --git a/simgear/misc/strutils.hxx b/simgear/misc/strutils.hxx index 05c55998..59051df4 100644 --- a/simgear/misc/strutils.hxx +++ b/simgear/misc/strutils.hxx @@ -29,16 +29,12 @@ #include -#include STL_STRING +#include #include SG_USING_STD(vector); -#ifdef SG_HAVE_STD_INCLUDES -# include -#else -# include -#endif +#include SG_USING_STD(string); diff --git a/simgear/misc/tabbed_values.hxx b/simgear/misc/tabbed_values.hxx index a6dfdeda..cc7335f7 100644 --- a/simgear/misc/tabbed_values.hxx +++ b/simgear/misc/tabbed_values.hxx @@ -26,7 +26,7 @@ #include #include -#include STL_STRING +#include SG_USING_STD(vector); SG_USING_STD(string); diff --git a/simgear/misc/tabbed_values_test.cxx b/simgear/misc/tabbed_values_test.cxx index 0a5dfee0..53bba88d 100644 --- a/simgear/misc/tabbed_values_test.cxx +++ b/simgear/misc/tabbed_values_test.cxx @@ -4,7 +4,7 @@ #include -#include STL_IOSTREAM +#include #include "tabbed_values.hxx" SG_USING_STD(cout); diff --git a/simgear/misc/texcoord.cxx b/simgear/misc/texcoord.cxx index ea56ea93..afd0ceac 100644 --- a/simgear/misc/texcoord.cxx +++ b/simgear/misc/texcoord.cxx @@ -145,7 +145,7 @@ enter this in the official comments in case I forget again. :-) #include -// #include STL_IOSTREAM +// #include #include "texcoord.hxx" diff --git a/simgear/misc/zfstream.cxx b/simgear/misc/zfstream.cxx index 0df3c810..9ad2dd77 100644 --- a/simgear/misc/zfstream.cxx +++ b/simgear/misc/zfstream.cxx @@ -23,11 +23,7 @@ #include -#ifdef SG_HAVE_STD_INCLUDES -# include -#else -# include -#endif +#include #include #include diff --git a/simgear/misc/zfstream.hxx b/simgear/misc/zfstream.hxx index e4c1ff1f..b6c0715b 100644 --- a/simgear/misc/zfstream.hxx +++ b/simgear/misc/zfstream.hxx @@ -31,51 +31,20 @@ #include -#ifdef SG_HAVE_STD_INCLUDES -# include -# include +#include +#include -# define ios_openmode std::ios_base::openmode -# define ios_in std::ios_base::in -# define ios_out std::ios_base::out -# define ios_app std::ios_base::app -# define ios_binary std::ios_base::binary +#define ios_openmode std::ios_base::openmode +#define ios_in std::ios_base::in +#define ios_out std::ios_base::out +#define ios_app std::ios_base::app +#define ios_binary std::ios_base::binary -# define ios_seekdir std::ios_base::seekdir +#define ios_seekdir std::ios_base::seekdir -# define ios_badbit std::ios_base::badbit -# define ios_failbit std::ios_base::failbit - -#else - -# ifdef SG_HAVE_STREAMBUF -# include -# include -# else -# include -# endif - -//# define ios_openmode ios::open_mode -# define ios_openmode int -# define ios_in ios::in -# define ios_out ios::out -# define ios_app ios::app - -#if defined(__GNUC__) && __GNUC_MINOR__ < 8 -# define ios_binary ios::bin -#else -# define ios_binary ios::binary -#endif - -# define ios_seekdir ios::seek_dir - -# define ios_badbit ios::badbit -# define ios_failbit ios::failbit - -# include - -#endif // SG_HAVE_STD_INCLUDES +#define ios_badbit std::ios_base::badbit +#define ios_failbit std::ios_base::failbit /** * A C++ I/O streams interface to the zlib gz* functions. @@ -87,14 +56,6 @@ class gzfilebuf : public std::streambuf #endif { public: - -#ifndef SG_HAVE_STD_INCLUDES - typedef char_traits traits_type; - typedef char_traits::int_type int_type; - // typedef char_traits::pos_type pos_type; - // typedef char_traits::off_type off_type; -#endif - /** Constructor */ gzfilebuf(); @@ -135,12 +96,8 @@ public: protected: virtual int_type underflow(); -#ifndef SG_HAVE_STD_INCLUDES - virtual int_type overflow( int_type c = traits_type::eof() ); -#else - virtual int_type overflow( int_type c = std::streambuf::traits_type::eof() ); -#endif + virtual int_type overflow( int_type c = traits_type::eof() ); private: int_type flushbuf(); diff --git a/simgear/props/condition.cxx b/simgear/props/condition.cxx index 54f5324f..482197ce 100644 --- a/simgear/props/condition.cxx +++ b/simgear/props/condition.cxx @@ -11,7 +11,7 @@ # include #endif -// #include STL_IOSTREAM +// #include #include diff --git a/simgear/props/props_io.cxx b/simgear/props/props_io.cxx index e080db56..b706c678 100644 --- a/simgear/props/props_io.cxx +++ b/simgear/props/props_io.cxx @@ -24,9 +24,9 @@ #include "props.hxx" #include "props_io.hxx" -#include STL_IOSTREAM -#include STL_FSTREAM -#include STL_STRING +#include +#include +#include #include #include diff --git a/simgear/props/props_io.hxx b/simgear/props/props_io.hxx index d13f4d1f..c8f46997 100644 --- a/simgear/props/props_io.hxx +++ b/simgear/props/props_io.hxx @@ -17,7 +17,7 @@ #include -#include STL_STRING +#include #include #include #include diff --git a/simgear/props/props_test.cxx b/simgear/props/props_test.cxx index c525e0b8..ccbf1afe 100644 --- a/simgear/props/props_test.cxx +++ b/simgear/props/props_test.cxx @@ -5,7 +5,7 @@ #include -#include STL_IOSTREAM +#include #include "props.hxx" #include "props_io.hxx" diff --git a/simgear/route/routetest.cxx b/simgear/route/routetest.cxx index dc586c0a..3a0b5853 100644 --- a/simgear/route/routetest.cxx +++ b/simgear/route/routetest.cxx @@ -1,7 +1,7 @@ #include #include -#include STL_IOSTREAM +#include #include "route.hxx" #include "waypoint.hxx" diff --git a/simgear/route/waypoint.hxx b/simgear/route/waypoint.hxx index 9c93314f..6f37fa56 100644 --- a/simgear/route/waypoint.hxx +++ b/simgear/route/waypoint.hxx @@ -35,7 +35,7 @@ #include -#include STL_STRING +#include SG_USING_STD(string); diff --git a/simgear/route/waytest.cxx b/simgear/route/waytest.cxx index 0d57bff8..f3c428c9 100644 --- a/simgear/route/waytest.cxx +++ b/simgear/route/waytest.cxx @@ -1,7 +1,7 @@ #include #include -#include STL_IOSTREAM +#include #include "waypoint.hxx" diff --git a/simgear/scene/material/mat.hxx b/simgear/scene/material/mat.hxx index 6d0c89af..621f7940 100644 --- a/simgear/scene/material/mat.hxx +++ b/simgear/scene/material/mat.hxx @@ -32,7 +32,7 @@ #include -#include STL_STRING // Standard C++ string library +#include // Standard C++ string library #include #include diff --git a/simgear/scene/material/matlib.cxx b/simgear/scene/material/matlib.cxx index 6ef1be04..2d6fddb8 100644 --- a/simgear/scene/material/matlib.cxx +++ b/simgear/scene/material/matlib.cxx @@ -40,7 +40,7 @@ #include SG_GL_H #include -#include STL_STRING +#include #include #include @@ -66,7 +66,6 @@ #include "matlib.hxx" -SG_USING_NAMESPACE(std); SG_USING_STD(string); // Constructor diff --git a/simgear/scene/material/matlib.hxx b/simgear/scene/material/matlib.hxx index 3b1fb318..9c96523b 100644 --- a/simgear/scene/material/matlib.hxx +++ b/simgear/scene/material/matlib.hxx @@ -33,7 +33,7 @@ #include -#include STL_STRING // Standard C++ string library +#include // Standard C++ string library #include // STL associative "array" #include // STL "array" diff --git a/simgear/scene/material/matmodel.hxx b/simgear/scene/material/matmodel.hxx index 363efec2..ac685697 100644 --- a/simgear/scene/material/matmodel.hxx +++ b/simgear/scene/material/matmodel.hxx @@ -30,7 +30,7 @@ #include -#include STL_STRING // Standard C++ string library +#include // Standard C++ string library #include #include diff --git a/simgear/scene/model/ModelRegistry.hxx b/simgear/scene/model/ModelRegistry.hxx index 14231763..229f7557 100644 --- a/simgear/scene/model/ModelRegistry.hxx +++ b/simgear/scene/model/ModelRegistry.hxx @@ -30,7 +30,7 @@ #include -#include STL_STRING +#include #include // Class to register per file extension read callbacks with the OSG diff --git a/simgear/scene/model/modellib.hxx b/simgear/scene/model/modellib.hxx index b2d038eb..806b7f23 100644 --- a/simgear/scene/model/modellib.hxx +++ b/simgear/scene/model/modellib.hxx @@ -24,7 +24,7 @@ #include // for SG_USING_STD -#include STL_STRING +#include #include diff --git a/simgear/scene/sky/cloud.hxx b/simgear/scene/sky/cloud.hxx index 81c9e038..663ade3b 100644 --- a/simgear/scene/sky/cloud.hxx +++ b/simgear/scene/sky/cloud.hxx @@ -32,7 +32,7 @@ #include #include -#include STL_STRING +#include SG_USING_STD(string); #include diff --git a/simgear/scene/sky/cloudfield.cxx b/simgear/scene/sky/cloudfield.cxx index 8d83037d..2c048a97 100644 --- a/simgear/scene/sky/cloudfield.cxx +++ b/simgear/scene/sky/cloudfield.cxx @@ -31,7 +31,7 @@ #include #include -#include STL_ALGORITHM +#include #include SG_USING_STD(vector); diff --git a/simgear/scene/sky/moon.cxx b/simgear/scene/sky/moon.cxx index 211d96ca..ca472096 100644 --- a/simgear/scene/sky/moon.cxx +++ b/simgear/scene/sky/moon.cxx @@ -30,7 +30,7 @@ #include #include -#include STL_IOSTREAM +#include #include #include diff --git a/simgear/scene/sky/newcloud.cxx b/simgear/scene/sky/newcloud.cxx index 901d0f78..d15b4561 100644 --- a/simgear/scene/sky/newcloud.cxx +++ b/simgear/scene/sky/newcloud.cxx @@ -33,7 +33,7 @@ #include #include -#include STL_ALGORITHM +#include #include SG_GLU_H #include "cloudfield.hxx" diff --git a/simgear/scene/sky/newcloud.hxx b/simgear/scene/sky/newcloud.hxx index 5ceb85ce..adda37ee 100644 --- a/simgear/scene/sky/newcloud.hxx +++ b/simgear/scene/sky/newcloud.hxx @@ -25,7 +25,7 @@ #include #include -#include STL_STRING +#include #include #include "bbcache.hxx" diff --git a/simgear/scene/sky/sphere.cxx b/simgear/scene/sky/sphere.cxx index 43d20e1c..cee7ef41 100644 --- a/simgear/scene/sky/sphere.cxx +++ b/simgear/scene/sky/sphere.cxx @@ -29,7 +29,7 @@ #include #include -#include STL_IOSTREAM +#include #include #include diff --git a/simgear/scene/sky/stars.cxx b/simgear/scene/sky/stars.cxx index 55616f68..bc9cf07e 100644 --- a/simgear/scene/sky/stars.cxx +++ b/simgear/scene/sky/stars.cxx @@ -36,7 +36,7 @@ #include #include -#include STL_IOSTREAM +#include #include #include diff --git a/simgear/scene/tgdb/TileCache.cxx b/simgear/scene/tgdb/TileCache.cxx index f37533d2..4f0b8e3b 100644 --- a/simgear/scene/tgdb/TileCache.cxx +++ b/simgear/scene/tgdb/TileCache.cxx @@ -31,8 +31,6 @@ #include "TileEntry.hxx" #include "TileCache.hxx" -SG_USING_NAMESPACE(std); - using simgear::TileEntry; using simgear::TileCache; diff --git a/simgear/scene/tgdb/TileEntry.cxx b/simgear/scene/tgdb/TileEntry.cxx index 2eb63a11..79a1bf41 100644 --- a/simgear/scene/tgdb/TileEntry.cxx +++ b/simgear/scene/tgdb/TileEntry.cxx @@ -25,7 +25,7 @@ #include #include -#include STL_STRING +#include #include #include diff --git a/simgear/scene/tgdb/TileEntry.hxx b/simgear/scene/tgdb/TileEntry.hxx index f47b8955..cf0ffccc 100644 --- a/simgear/scene/tgdb/TileEntry.hxx +++ b/simgear/scene/tgdb/TileEntry.hxx @@ -32,7 +32,7 @@ #include #include -#include STL_STRING +#include #include #include diff --git a/simgear/scene/tgdb/apt_signs.hxx b/simgear/scene/tgdb/apt_signs.hxx index dceccef7..62282b41 100644 --- a/simgear/scene/tgdb/apt_signs.hxx +++ b/simgear/scene/tgdb/apt_signs.hxx @@ -32,7 +32,7 @@ #include -#include STL_STRING +#include #include diff --git a/simgear/scene/tgdb/obj.hxx b/simgear/scene/tgdb/obj.hxx index f35e2b36..d9b2075d 100644 --- a/simgear/scene/tgdb/obj.hxx +++ b/simgear/scene/tgdb/obj.hxx @@ -31,7 +31,7 @@ #include -#include STL_STRING +#include #include #include diff --git a/simgear/scene/tgdb/pt_lights.hxx b/simgear/scene/tgdb/pt_lights.hxx index aeaa49b8..9e95674e 100644 --- a/simgear/scene/tgdb/pt_lights.hxx +++ b/simgear/scene/tgdb/pt_lights.hxx @@ -31,7 +31,7 @@ #include -#include STL_STRING +#include #include // STL #include diff --git a/simgear/scene/tgdb/userdata.hxx b/simgear/scene/tgdb/userdata.hxx index b487ddad..5acf06a3 100644 --- a/simgear/scene/tgdb/userdata.hxx +++ b/simgear/scene/tgdb/userdata.hxx @@ -27,7 +27,7 @@ #include -#include STL_STRING +#include #include diff --git a/simgear/screen/shader.h b/simgear/screen/shader.h index 8a63643e..df767901 100644 --- a/simgear/screen/shader.h +++ b/simgear/screen/shader.h @@ -27,7 +27,7 @@ #include #include -#include STL_STRING +#include SG_USING_STD(map); SG_USING_STD(vector); diff --git a/simgear/serial/serial.cxx b/simgear/serial/serial.cxx index 9e6c6163..2d273090 100644 --- a/simgear/serial/serial.cxx +++ b/simgear/serial/serial.cxx @@ -23,13 +23,8 @@ #include -#include STL_IOSTREAM - -#ifdef SG_HAVE_STD_INCLUDE -# include -#else -# include -#endif +#include +#include #if !defined( WIN32 ) || defined( __CYGWIN__) || defined( __CYGWIN32__ ) # include diff --git a/simgear/serial/serial.hxx b/simgear/serial/serial.hxx index 6441964c..d2c1f838 100644 --- a/simgear/serial/serial.hxx +++ b/simgear/serial/serial.hxx @@ -37,7 +37,7 @@ #endif #include -#include STL_STRING +#include SG_USING_STD(string); // if someone know how to do this all with C++ streams let me know diff --git a/simgear/serial/testserial.cxx b/simgear/serial/testserial.cxx index bc6b9c6a..d82d993c 100644 --- a/simgear/serial/testserial.cxx +++ b/simgear/serial/testserial.cxx @@ -1,7 +1,7 @@ #include -#include STL_STRING -#include STL_IOSTREAM +#include +#include #include diff --git a/simgear/sg_traits.hxx b/simgear/sg_traits.hxx deleted file mode 100644 index 500f739a..00000000 --- a/simgear/sg_traits.hxx +++ /dev/null @@ -1,28 +0,0 @@ -/** \file sg_traits.hxx - * Provides a char_traits declaration for systems without it. - * \internal - */ - -#ifndef _SG_TRAITS_HXX -#define _SG_TRAITS_HXX - -#include - -#ifndef SG_HAVE_TRAITS - -// Dummy up some char traits for now. -template struct char_traits{}; - -SG_TEMPLATE_NULL -struct char_traits -{ - typedef char char_type; - typedef int int_type; - typedef streampos pos_type; - typedef streamoff off_type; - - static int_type eof() { return EOF; } -}; -#endif // SG_HAVE_TRAITS - -#endif // _SG_TRAITS_HXX diff --git a/simgear/sound/sample_openal.hxx b/simgear/sound/sample_openal.hxx index 7e8693e3..2653931d 100644 --- a/simgear/sound/sample_openal.hxx +++ b/simgear/sound/sample_openal.hxx @@ -34,7 +34,7 @@ #include -#include STL_STRING +#include #include #include diff --git a/simgear/sound/soundmgr_openal.cxx b/simgear/sound/soundmgr_openal.cxx index 0d59961e..e53eccac 100644 --- a/simgear/sound/soundmgr_openal.cxx +++ b/simgear/sound/soundmgr_openal.cxx @@ -68,7 +68,7 @@ extern "C" int isinf (double); #endif -#include STL_IOSTREAM +#include #include #include diff --git a/simgear/sound/soundmgr_openal.hxx b/simgear/sound/soundmgr_openal.hxx index 567dadf9..d306f82e 100644 --- a/simgear/sound/soundmgr_openal.hxx +++ b/simgear/sound/soundmgr_openal.hxx @@ -39,7 +39,7 @@ #include -#include STL_STRING +#include #include #if defined( __APPLE__ ) diff --git a/simgear/structure/commands.hxx b/simgear/structure/commands.hxx index fa27ac7e..147c4f3d 100644 --- a/simgear/structure/commands.hxx +++ b/simgear/structure/commands.hxx @@ -13,7 +13,7 @@ #include -#include STL_STRING +#include #include #include diff --git a/simgear/structure/exception.hxx b/simgear/structure/exception.hxx index 9de8ea8c..e482be31 100644 --- a/simgear/structure/exception.hxx +++ b/simgear/structure/exception.hxx @@ -11,7 +11,7 @@ #define __SIMGEAR_MISC_EXCEPTION_HXX 1 #include -#include STL_STRING +#include SG_USING_STD(string); diff --git a/simgear/structure/subsystem_mgr.hxx b/simgear/structure/subsystem_mgr.hxx index 996846f9..171e4665 100644 --- a/simgear/structure/subsystem_mgr.hxx +++ b/simgear/structure/subsystem_mgr.hxx @@ -31,7 +31,7 @@ # include #endif -#include STL_STRING +#include SG_USING_STD(string); #include diff --git a/simgear/threads/SGQueue.hxx b/simgear/threads/SGQueue.hxx index 9f534ec9..41bd3272 100644 --- a/simgear/threads/SGQueue.hxx +++ b/simgear/threads/SGQueue.hxx @@ -3,12 +3,7 @@ #include -#if defined ( SG_HAVE_STD_INCLUDES ) -# include -#else -# include -#endif - +#include #include #include "SGThread.hxx" #include "SGGuard.hxx" diff --git a/simgear/threads/SGThread.hxx b/simgear/threads/SGThread.hxx index 5179ab80..477ca458 100644 --- a/simgear/threads/SGThread.hxx +++ b/simgear/threads/SGThread.hxx @@ -26,13 +26,8 @@ #include #include -#if defined ( SG_HAVE_STD_INCLUDES ) -# include -# include -#else -# include -# include -#endif +#include +#include class SGThread; diff --git a/simgear/timing/geocoord.h b/simgear/timing/geocoord.h index 956e1189..536cf0f9 100644 --- a/simgear/timing/geocoord.h +++ b/simgear/timing/geocoord.h @@ -38,8 +38,6 @@ #include #include -SG_USING_NAMESPACE(std); - #include class SGGeoCoord @@ -65,9 +63,9 @@ public: virtual const char * getDescription() {return 0;}; }; -typedef vector SGGeoCoordVector; -typedef vector::iterator SGGeoCoordVectorIterator; -typedef vector::const_iterator SGGeoCoordVectorConstIterator; +typedef std::vector SGGeoCoordVector; +typedef std::vector::iterator SGGeoCoordVectorIterator; +typedef std::vector::const_iterator SGGeoCoordVectorConstIterator; /************************************************************************ * SGGeoCoordContainer is a simple container class, that stores objects diff --git a/simgear/timing/sg_time.cxx b/simgear/timing/sg_time.cxx index 33777a57..fb3f30c8 100644 --- a/simgear/timing/sg_time.cxx +++ b/simgear/timing/sg_time.cxx @@ -29,15 +29,9 @@ #include // for errno -#ifdef SG_HAVE_STD_INCLUDES -# include -# include -# include -#else -# include -# include -# include -#endif +#include +#include +#include #include diff --git a/simgear/timing/sg_time.hxx b/simgear/timing/sg_time.hxx index 0ec0138b..680c1611 100644 --- a/simgear/timing/sg_time.hxx +++ b/simgear/timing/sg_time.hxx @@ -35,11 +35,7 @@ #include -#ifdef SG_HAVE_STD_INCLUDES -# include -#else -# include -#endif +#include #include @@ -71,7 +67,7 @@ private: SGTimeZoneContainer* tzContainer; // Points to the current local timezone name; - string zonename; + std::string zonename; // Unix "calendar" time in seconds time_t cur_time; @@ -104,7 +100,7 @@ private: double gst_diff; /** init common constructor code */ - void init( double lon_rad, double lat_rad, const string& root, + void init( double lon_rad, double lat_rad, const std::string& root, time_t init_time ); public: @@ -128,14 +124,14 @@ public: * @param root root path point to data file location (timezone, etc.) * @param init_time provide an initialization time, 0 means use current clock time */ - SGTime( double lon_rad, double lat_rad, const string& root, + SGTime( double lon_rad, double lat_rad, const std::string& root, time_t init_time ); /** * Create an instance given a data file path. * @param root root path point to data file location (timezone, etc.) */ - SGTime( const string& root ); + SGTime( const std::string& root ); /** Destructor */ ~SGTime(); @@ -165,7 +161,7 @@ public: * @param lon_rad current longitude (radians) * @param lat_rad current latitude (radians) * @param root base path containing time zone directory */ - void updateLocal( double lon_rad, double lat_rad, const string& root ); + void updateLocal( double lon_rad, double lat_rad, const std::string& root ); /** @return current system/unix time in seconds */ inline time_t get_cur_time() const { return cur_time; }; diff --git a/simgear/timing/timestamp.cxx b/simgear/timing/timestamp.cxx index dcda28ec..458502ea 100644 --- a/simgear/timing/timestamp.cxx +++ b/simgear/timing/timestamp.cxx @@ -34,11 +34,7 @@ #include -#ifdef SG_HAVE_STD_INCLUDES -# include -#else -# include -#endif +#include #ifdef HAVE_SYS_TIMEB_H # include // for ftime() and struct timeb diff --git a/simgear/timing/timezone.h b/simgear/timing/timezone.h index aa282b54..f5779fd3 100644 --- a/simgear/timing/timezone.h +++ b/simgear/timing/timezone.h @@ -44,8 +44,8 @@ class SGTimeZone : public SGGeoCoord private: - string countryCode; - string descriptor; + std::string countryCode; + std::string descriptor; public: diff --git a/simgear/xml/easyxml.cxx b/simgear/xml/easyxml.cxx index 0aa71b18..0779d872 100644 --- a/simgear/xml/easyxml.cxx +++ b/simgear/xml/easyxml.cxx @@ -11,8 +11,8 @@ #include "easyxml.hxx" #include "xmlparse.h" -#include STL_FSTREAM -#include STL_IOSTREAM +#include +#include SG_USING_STD(ifstream); diff --git a/simgear/xml/easyxml.hxx b/simgear/xml/easyxml.hxx index 6b91a867..d59d371b 100644 --- a/simgear/xml/easyxml.hxx +++ b/simgear/xml/easyxml.hxx @@ -11,8 +11,8 @@ #include #include -#include STL_IOSTREAM -#include STL_STRING +#include +#include #include SG_USING_STD(istream);