Message ID | 56E1924E.6070703@verizon.net |
---|---|
State | New |
Headers | show |
The change approved in Jacksonville was to only add the special functions to <cmath> and not <math.h>
On 03/11/2016 10:55 AM, Jonathan Wakely wrote: > The change approved in Jacksonville was to only add the special > functions to <cmath> and not <math.h> > That's easy. OK, since they changed that and the macro and made it nonconditional I should also drop the old-style macros __WANT_MATH_CANNEVERREMEMBER__ and the old-style version macro. So, in other words, we're *not* actually supporting TR29124 (that's fine by me). We can tweak the web pages. People on C++11, C++14 can use tr1. Did they keep the Cisms like: float foobarf(float x); double foobar(double x); long double foobarl(long double x); I am keeping an eye out for the words of the draft github. Maybe I'll ping Axel and Walter. Ed
On 11 March 2016 at 16:31, Ed Smith-Rowland <3dw4rd@verizon.net> wrote: > On 03/11/2016 10:55 AM, Jonathan Wakely wrote: >> >> The change approved in Jacksonville was to only add the special >> functions to <cmath> and not <math.h> >> > That's easy. > OK, since they changed that and the macro and made it nonconditional I > should also drop the old-style macros __WANT_MATH_CANNEVERREMEMBER__ and the > old-style version macro. > So, in other words, we're *not* actually supporting TR29124 (that's fine by > me). > We can tweak the web pages. > People on C++11, C++14 can use tr1. I think we can keep 29124 support for pre-C++17, and for that case <math.h> will include the functions (when the ICANNEVERREMEMBEREITHER macro is defined). > Did they keep the Cisms like: > > float > foobarf(float x); > > double > foobar(double x); > > long double > foobarl(long double x); Yes, I think so. Let's do this after gcc6 though.
Index: include/bits/specfun.h =================================================================== --- include/bits/specfun.h (svn+ssh://emsr@gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/include) (revision 234110) +++ include/bits/specfun.h (.../include) (working copy) @@ -1,6 +1,6 @@ // Mathematical Special Functions for -*- C++ -*- -// Copyright (C) 2006-2015 Free Software Foundation, Inc. +// Copyright (C) 2006-2016 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -34,15 +34,21 @@ #include <bits/c++config.h> -#if __STDCPP_WANT_MATH_SPEC_FUNCS__ == 0 +#define __STDCPP_MATH_SPEC_FUNCS__ 201003L + +#define __cpp_lib_math_special_functions 201603L + +#if __cplusplus <= 201402L && __STDCPP_WANT_MATH_SPEC_FUNCS__ == 0 # error include <cmath> and define __STDCPP_WANT_MATH_SPEC_FUNCS__ #endif -#define __STDCPP_MATH_SPEC_FUNCS__ 201003L - +#include <limits> #include <bits/stl_algobase.h> -#include <limits> -#include <type_traits> +#if __cplusplus >= 201103L +# include <type_traits> +#else +# include <tr1/type_traits> +#endif #include <tr1/gamma.tcc> #include <tr1/bessel_function.tcc> Index: include/c_global/cmath =================================================================== --- include/c_global/cmath (svn+ssh://emsr@gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/include) (revision 234110) +++ include/c_global/cmath (.../include) (working copy) @@ -1790,7 +1790,7 @@ #endif // C++11 -#if __STDCPP_WANT_MATH_SPEC_FUNCS__ == 1 +#if __cplusplus > 201402L || __STDCPP_WANT_MATH_SPEC_FUNCS__ == 1 # include <bits/specfun.h> #endif Index: include/c_compatibility/math.h =================================================================== --- include/c_compatibility/math.h (svn+ssh://emsr@gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/include) (revision 234110) +++ include/c_compatibility/math.h (.../include) (working copy) @@ -111,7 +111,7 @@ using std::trunc; #endif // C++11 && _GLIBCXX_USE_C99_MATH_TR1 -#if __STDCPP_WANT_MATH_SPEC_FUNCS__ == 1 +#if __cplusplus > 201402L || __STDCPP_WANT_MATH_SPEC_FUNCS__ == 1 using std::assoc_laguerref; using std::assoc_laguerrel; using std::assoc_laguerre;