Index: gcc/ginclude/stddef.h =================================================================== --- gcc/ginclude/stddef.h (révision 119404) +++ gcc/ginclude/stddef.h (copie de travail) @@ -149,7 +149,14 @@ #ifndef __PTRDIFF_TYPE__ #define __PTRDIFF_TYPE__ long int #endif +#if __cplusplus >= 199711L +namespace std { +#endif typedef __PTRDIFF_TYPE__ ptrdiff_t; +#if __cplusplus >= 199711L +} +using std::ptrdiff_t; +#endif #endif /* _GCC_PTRDIFF_T */ #endif /* ___int_ptrdiff_t_h */ #endif /* _BSD_PTRDIFF_T_ */ @@ -211,7 +218,14 @@ #define __SIZE_TYPE__ long unsigned int #endif #if !(defined (__GNUG__) && defined (size_t)) +#if __cplusplus >= 199711L +namespace std { +#endif typedef __SIZE_TYPE__ size_t; +#if __cplusplus >= 199711L +} +using std::size_t; +#endif #ifdef __BEOS__ typedef long ssize_t; #endif /* __BEOS__ */ @@ -352,8 +366,15 @@ #ifndef __WINT_TYPE__ #define __WINT_TYPE__ unsigned int #endif +#if __cplusplus >= 199711L +namespace std { +#endif typedef __WINT_TYPE__ wint_t; +#if __cplusplus >= 199711L +} +using std::wint_t; #endif +#endif #undef __need_wint_t #endif Index: libstdc++-v3/include/bits/valarray_after.h =================================================================== --- libstdc++-v3/include/bits/valarray_after.h (révision 119404) +++ libstdc++-v3/include/bits/valarray_after.h (copie de travail) @@ -426,20 +426,20 @@ #define _DEFINE_EXPR_UNARY_FUNCTION(_Name) \ template \ - inline _Expr<_UnClos<__##_Name, _Expr, _Dom>, \ + inline _Expr<_UnClos<___##_Name, _Expr, _Dom>, \ typename _Dom::value_type> \ _Name(const _Expr<_Dom, typename _Dom::value_type>& __e) \ { \ typedef typename _Dom::value_type _Tp; \ - typedef _UnClos<__##_Name, _Expr, _Dom> _Closure; \ + typedef _UnClos<___##_Name, _Expr, _Dom> _Closure; \ return _Expr<_Closure, _Tp>(_Closure(__e())); \ } \ \ template \ - inline _Expr<_UnClos<__##_Name, _ValArray, _Tp>, _Tp> \ + inline _Expr<_UnClos<___##_Name, _ValArray, _Tp>, _Tp> \ _Name(const valarray<_Tp>& __v) \ { \ - typedef _UnClos<__##_Name, _ValArray, _Tp> _Closure; \ + typedef _UnClos<___##_Name, _ValArray, _Tp> _Closure; \ return _Expr<_Closure, _Tp>(_Closure(__v)); \ } @@ -462,85 +462,85 @@ #define _DEFINE_EXPR_BINARY_FUNCTION(_Fun) \ template \ - inline _Expr<_BinClos<__##_Fun, _Expr, _Expr, _Dom1, _Dom2>, \ + inline _Expr<_BinClos<___##_Fun, _Expr, _Expr, _Dom1, _Dom2>, \ typename _Dom1::value_type> \ _Fun(const _Expr<_Dom1, typename _Dom1::value_type>& __e1, \ const _Expr<_Dom2, typename _Dom2::value_type>& __e2) \ { \ typedef typename _Dom1::value_type _Tp; \ - typedef _BinClos<__##_Fun, _Expr, _Expr, _Dom1, _Dom2> _Closure; \ + typedef _BinClos<___##_Fun, _Expr, _Expr, _Dom1, _Dom2> _Closure; \ return _Expr<_Closure, _Tp>(_Closure(__e1(), __e2())); \ } \ \ template \ - inline _Expr<_BinClos<__##_Fun, _Expr, _ValArray, _Dom, \ + inline _Expr<_BinClos<___##_Fun, _Expr, _ValArray, _Dom, \ typename _Dom::value_type>, \ typename _Dom::value_type> \ _Fun(const _Expr<_Dom, typename _Dom::value_type>& __e, \ const valarray& __v) \ { \ typedef typename _Dom::value_type _Tp; \ - typedef _BinClos<__##_Fun, _Expr, _ValArray, _Dom, _Tp> _Closure; \ + typedef _BinClos<___##_Fun, _Expr, _ValArray, _Dom, _Tp> _Closure; \ return _Expr<_Closure, _Tp>(_Closure(__e(), __v)); \ } \ \ template \ - inline _Expr<_BinClos<__##_Fun, _ValArray, _Expr, \ + inline _Expr<_BinClos<___##_Fun, _ValArray, _Expr, \ typename _Dom::value_type, _Dom>, \ typename _Dom::value_type> \ _Fun(const valarray& __v, \ const _Expr<_Dom, typename _Dom::value_type>& __e) \ { \ typedef typename _Dom::value_type _Tp; \ - typedef _BinClos<__##_Fun, _ValArray, _Expr, _Tp, _Dom> _Closure; \ + typedef _BinClos<___##_Fun, _ValArray, _Expr, _Tp, _Dom> _Closure; \ return _Expr<_Closure, _Tp>(_Closure(__v, __e())); \ } \ \ template \ - inline _Expr<_BinClos<__##_Fun, _Expr, _Constant, _Dom, \ + inline _Expr<_BinClos<___##_Fun, _Expr, _Constant, _Dom, \ typename _Dom::value_type>, \ typename _Dom::value_type> \ _Fun(const _Expr<_Dom, typename _Dom::value_type>& __e, \ const typename _Dom::value_type& __t) \ { \ typedef typename _Dom::value_type _Tp; \ - typedef _BinClos<__##_Fun, _Expr, _Constant, _Dom, _Tp> _Closure;\ + typedef _BinClos<___##_Fun, _Expr, _Constant, _Dom, _Tp> _Closure;\ return _Expr<_Closure, _Tp>(_Closure(__e(), __t)); \ } \ \ template \ - inline _Expr<_BinClos<__##_Fun, _Constant, _Expr, \ + inline _Expr<_BinClos<___##_Fun, _Constant, _Expr, \ typename _Dom::value_type, _Dom>, \ typename _Dom::value_type> \ _Fun(const typename _Dom::value_type& __t, \ const _Expr<_Dom, typename _Dom::value_type>& __e) \ { \ typedef typename _Dom::value_type _Tp; \ - typedef _BinClos<__##_Fun, _Constant, _Expr, _Tp, _Dom> _Closure; \ + typedef _BinClos<___##_Fun, _Constant, _Expr, _Tp, _Dom> _Closure; \ return _Expr<_Closure, _Tp>(_Closure(__t, __e())); \ } \ \ template \ - inline _Expr<_BinClos<__##_Fun, _ValArray, _ValArray, _Tp, _Tp>, _Tp> \ + inline _Expr<_BinClos<___##_Fun, _ValArray, _ValArray, _Tp, _Tp>, _Tp> \ _Fun(const valarray<_Tp>& __v, const valarray<_Tp>& __w) \ { \ - typedef _BinClos<__##_Fun, _ValArray, _ValArray, _Tp, _Tp> _Closure; \ + typedef _BinClos<___##_Fun, _ValArray, _ValArray, _Tp, _Tp> _Closure; \ return _Expr<_Closure, _Tp>(_Closure(__v, __w)); \ } \ \ template \ - inline _Expr<_BinClos<__##_Fun, _ValArray, _Constant, _Tp, _Tp>, _Tp> \ + inline _Expr<_BinClos<___##_Fun, _ValArray, _Constant, _Tp, _Tp>, _Tp> \ _Fun(const valarray<_Tp>& __v, const _Tp& __t) \ { \ - typedef _BinClos<__##_Fun, _ValArray, _Constant, _Tp, _Tp> _Closure; \ + typedef _BinClos<___##_Fun, _ValArray, _Constant, _Tp, _Tp> _Closure; \ return _Expr<_Closure, _Tp>(_Closure(__v, __t)); \ } \ \ template \ - inline _Expr<_BinClos<__##_Fun, _Constant, _ValArray, _Tp, _Tp>, _Tp> \ + inline _Expr<_BinClos<___##_Fun, _Constant, _ValArray, _Tp, _Tp>, _Tp> \ _Fun(const _Tp& __t, const valarray<_Tp>& __v) \ { \ - typedef _BinClos<__##_Fun, _Constant, _ValArray, _Tp, _Tp> _Closure; \ + typedef _BinClos<___##_Fun, _Constant, _ValArray, _Tp, _Tp> _Closure; \ return _Expr<_Closure, _Tp>(_Closure(__t, __v)); \ } Index: libstdc++-v3/include/bits/valarray_before.h =================================================================== --- libstdc++-v3/include/bits/valarray_before.h (révision 119404) +++ libstdc++-v3/include/bits/valarray_before.h (copie de travail) @@ -64,98 +64,98 @@ // 2) efficiency -- object functions can be easily inlined // 3) be Koenig-lookup-friendly - struct __abs + struct ___abs { template _Tp operator()(const _Tp& __t) const { return abs(__t); } }; - struct __cos + struct ___cos { template _Tp operator()(const _Tp& __t) const { return cos(__t); } }; - struct __acos + struct ___acos { template _Tp operator()(const _Tp& __t) const { return acos(__t); } }; - struct __cosh + struct ___cosh { template _Tp operator()(const _Tp& __t) const { return cosh(__t); } }; - struct __sin + struct ___sin { template _Tp operator()(const _Tp& __t) const { return sin(__t); } }; - struct __asin + struct ___asin { template _Tp operator()(const _Tp& __t) const { return asin(__t); } }; - struct __sinh + struct ___sinh { template _Tp operator()(const _Tp& __t) const { return sinh(__t); } }; - struct __tan + struct ___tan { template _Tp operator()(const _Tp& __t) const { return tan(__t); } }; - struct __atan + struct ___atan { template _Tp operator()(const _Tp& __t) const { return atan(__t); } }; - struct __tanh + struct ___tanh { template _Tp operator()(const _Tp& __t) const { return tanh(__t); } }; - struct __exp + struct ___exp { template _Tp operator()(const _Tp& __t) const { return exp(__t); } }; - struct __log + struct ___log { template _Tp operator()(const _Tp& __t) const { return log(__t); } }; - struct __log10 + struct ___log10 { template _Tp operator()(const _Tp& __t) const { return log10(__t); } }; - struct __sqrt + struct ___sqrt { template _Tp operator()(const _Tp& __t) const @@ -320,14 +320,14 @@ }; // The few binary functions we miss. - struct __atan2 + struct ___atan2 { template _Tp operator()(const _Tp& __x, const _Tp& __y) const { return atan2(__x, __y); } }; - struct __pow + struct ___pow { template _Tp operator()(const _Tp& __x, const _Tp& __y) const Index: libstdc++-v3/include/c_std/std_cstdlib.h =================================================================== --- libstdc++-v3/include/c_std/std_cstdlib.h (révision 119404) +++ libstdc++-v3/include/c_std/std_cstdlib.h (copie de travail) @@ -139,11 +139,13 @@ using ::wctomb; #endif // _GLIBCXX_USE_WCHAR_T +#if __cplusplus < 199711L inline long abs(long __i) { return labs(__i); } inline ldiv_t div(long __i, long __j) { return ldiv(__i, __j); } +#endif _GLIBCXX_END_NAMESPACE Index: libstdc++-v3/include/c_std/std_cmath.h =================================================================== --- libstdc++-v3/include/c_std/std_cmath.h (révision 119404) +++ libstdc++-v3/include/c_std/std_cmath.h (copie de travail) @@ -85,6 +85,7 @@ // an `exported' forward declaration. template _Tp __cmath_power(_Tp, unsigned int); +#if __cplusplus < 199711L inline double abs(double __x) { return __builtin_fabs(__x); } @@ -96,9 +97,11 @@ inline long double abs(long double __x) { return __builtin_fabsl(__x); } +#endif using ::acos; +#if __cplusplus < 199711L inline float acos(float __x) { return __builtin_acosf(__x); } @@ -106,6 +109,7 @@ inline long double acos(long double __x) { return __builtin_acosl(__x); } +#endif template inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, @@ -115,6 +119,7 @@ using ::asin; +#if __cplusplus < 199711L inline float asin(float __x) { return __builtin_asinf(__x); } @@ -122,6 +127,7 @@ inline long double asin(long double __x) { return __builtin_asinl(__x); } +#endif template inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, @@ -131,6 +137,7 @@ using ::atan; +#if __cplusplus < 199711L inline float atan(float __x) { return __builtin_atanf(__x); } @@ -138,6 +145,7 @@ inline long double atan(long double __x) { return __builtin_atanl(__x); } +#endif template inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, @@ -147,6 +155,7 @@ using ::atan2; +#if __cplusplus < 199711L inline float atan2(float __y, float __x) { return __builtin_atan2f(__y, __x); } @@ -154,6 +163,7 @@ inline long double atan2(long double __y, long double __x) { return __builtin_atan2l(__y, __x); } +#endif template inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value @@ -164,6 +174,7 @@ using ::ceil; +#if __cplusplus < 199711L inline float ceil(float __x) { return __builtin_ceilf(__x); } @@ -171,6 +182,7 @@ inline long double ceil(long double __x) { return __builtin_ceill(__x); } +#endif template inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, @@ -180,6 +192,7 @@ using ::cos; +#if __cplusplus < 199711L inline float cos(float __x) { return __builtin_cosf(__x); } @@ -187,6 +200,7 @@ inline long double cos(long double __x) { return __builtin_cosl(__x); } +#endif template inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, @@ -196,6 +210,7 @@ using ::cosh; +#if __cplusplus < 199711L inline float cosh(float __x) { return __builtin_coshf(__x); } @@ -203,6 +218,7 @@ inline long double cosh(long double __x) { return __builtin_coshl(__x); } +#endif template inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, @@ -212,6 +228,7 @@ using ::exp; +#if __cplusplus < 199711L inline float exp(float __x) { return __builtin_expf(__x); } @@ -219,6 +236,7 @@ inline long double exp(long double __x) { return __builtin_expl(__x); } +#endif template inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, @@ -228,6 +246,7 @@ using ::fabs; +#if __cplusplus < 199711L inline float fabs(float __x) { return __builtin_fabsf(__x); } @@ -235,6 +254,7 @@ inline long double fabs(long double __x) { return __builtin_fabsl(__x); } +#endif template inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, @@ -244,6 +264,7 @@ using ::floor; +#if __cplusplus < 199711L inline float floor(float __x) { return __builtin_floorf(__x); } @@ -251,6 +272,7 @@ inline long double floor(long double __x) { return __builtin_floorl(__x); } +#endif template inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, @@ -260,6 +282,7 @@ using ::fmod; +#if __cplusplus < 199711L inline float fmod(float __x, float __y) { return __builtin_fmodf(__x, __y); } @@ -267,9 +290,11 @@ inline long double fmod(long double __x, long double __y) { return __builtin_fmodl(__x, __y); } +#endif using ::frexp; +#if __cplusplus < 199711L inline float frexp(float __x, int* __exp) { return __builtin_frexpf(__x, __exp); } @@ -277,6 +302,7 @@ inline long double frexp(long double __x, int* __exp) { return __builtin_frexpl(__x, __exp); } +#endif template inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, @@ -286,6 +312,7 @@ using ::ldexp; +#if __cplusplus < 199711L inline float ldexp(float __x, int __exp) { return __builtin_ldexpf(__x, __exp); } @@ -293,6 +320,7 @@ inline long double ldexp(long double __x, int __exp) { return __builtin_ldexpl(__x, __exp); } +#endif template inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, @@ -302,6 +330,7 @@ using ::log; +#if __cplusplus < 199711L inline float log(float __x) { return __builtin_logf(__x); } @@ -309,6 +338,7 @@ inline long double log(long double __x) { return __builtin_logl(__x); } +#endif template inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, @@ -318,6 +348,7 @@ using ::log10; +#if __cplusplus < 199711L inline float log10(float __x) { return __builtin_log10f(__x); } @@ -325,6 +356,7 @@ inline long double log10(long double __x) { return __builtin_log10l(__x); } +#endif template inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, @@ -334,6 +366,7 @@ using ::modf; +#if __cplusplus < 199711L inline float modf(float __x, float* __iptr) { return __builtin_modff(__x, __iptr); } @@ -341,6 +374,7 @@ inline long double modf(long double __x, long double* __iptr) { return __builtin_modfl(__x, __iptr); } +#endif template inline _Tp @@ -353,6 +387,7 @@ using ::pow; +#if __cplusplus < 199711L inline float pow(float __x, float __y) { return __builtin_powf(__x, __y); } @@ -372,9 +407,11 @@ inline long double pow(long double __x, int __n) { return __builtin_powil(__x, __n); } +#endif using ::sin; +#if __cplusplus < 199711L inline float sin(float __x) { return __builtin_sinf(__x); } @@ -382,6 +419,7 @@ inline long double sin(long double __x) { return __builtin_sinl(__x); } +#endif template inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, @@ -391,6 +429,7 @@ using ::sinh; +#if __cplusplus < 199711L inline float sinh(float __x) { return __builtin_sinhf(__x); } @@ -398,6 +437,7 @@ inline long double sinh(long double __x) { return __builtin_sinhl(__x); } +#endif template inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, @@ -407,6 +447,7 @@ using ::sqrt; +#if __cplusplus < 199711L inline float sqrt(float __x) { return __builtin_sqrtf(__x); } @@ -414,6 +455,7 @@ inline long double sqrt(long double __x) { return __builtin_sqrtl(__x); } +#endif template inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, @@ -423,6 +465,7 @@ using ::tan; +#if __cplusplus < 199711L inline float tan(float __x) { return __builtin_tanf(__x); } @@ -430,6 +473,7 @@ inline long double tan(long double __x) { return __builtin_tanl(__x); } +#endif template inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, @@ -439,6 +483,7 @@ using ::tanh; +#if __cplusplus < 199711L inline float tanh(float __x) { return __builtin_tanhf(__x); } @@ -446,6 +491,7 @@ inline long double tanh(long double __x) { return __builtin_tanhl(__x); } +#endif template inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, Index: libstdc++-v3/include/c_std/std_cwchar.h =================================================================== --- libstdc++-v3/include/c_std/std_cwchar.h (révision 119404) +++ libstdc++-v3/include/c_std/std_cwchar.h (copie de travail) @@ -205,6 +205,7 @@ using ::wprintf; using ::wscanf; +#if __cplusplus < 199711L using ::wcschr; inline wchar_t* @@ -234,6 +235,7 @@ inline wchar_t* wmemchr(wchar_t* __p, wchar_t __c, size_t __n) { return wmemchr(const_cast(__p), __c, __n); } +#endif _GLIBCXX_END_NAMESPACE Index: libstdc++-v3/include/c_std/std_cstring.h =================================================================== --- libstdc++-v3/include/c_std/std_cstring.h (révision 119404) +++ libstdc++-v3/include/c_std/std_cstring.h (copie de travail) @@ -95,6 +95,7 @@ using ::strerror; using ::strlen; +#if __cplusplus < 199711L using ::memchr; inline void* @@ -124,6 +125,7 @@ inline char* strstr(char* __s1, const char* __s2) { return __builtin_strstr(const_cast(__s1), __s2); } +#endif _GLIBCXX_END_NAMESPACE Index: libcpp/init.c =================================================================== --- libcpp/init.c (révision 119404) +++ libcpp/init.c (copie de travail) @@ -376,7 +376,7 @@ } if (CPP_OPTION (pfile, cplusplus)) - _cpp_define_builtin (pfile, "__cplusplus 1"); + _cpp_define_builtin (pfile, "__cplusplus 199711L"); else if (CPP_OPTION (pfile, lang) == CLK_ASM) _cpp_define_builtin (pfile, "__ASSEMBLER__ 1"); else if (CPP_OPTION (pfile, lang) == CLK_STDC94)