From 15fa6fd8b9af7dbd415b9dcfc50fb9494c4bdba6 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 13 Aug 2015 17:13:32 +0100 Subject: [PATCH] Add BOOST_HAS_FLOAT128 for compilers that support __float128 as a distinct type. --- checks/Jamfile.v2 | 5 ++++- checks/test_case.cpp | 6 +++++- .../boost_config/boost_macro_reference.html | 19 +++++++++++++++++++ doc/html/index.html | 2 +- doc/macro_reference.qbk | 3 +++ include/boost/config/compiler/gcc.hpp | 13 +++++++++++++ test/all/Jamfile.v2 | 5 ++++- test/config_info.cpp | 2 ++ test/config_test.cpp | 12 +++++++++++- 9 files changed, 62 insertions(+), 5 deletions(-) diff --git a/checks/Jamfile.v2 b/checks/Jamfile.v2 index 21b55d6b..3ae69ce9 100644 --- a/checks/Jamfile.v2 +++ b/checks/Jamfile.v2 @@ -1,6 +1,6 @@ # # *** DO NOT EDIT THIS FILE BY HAND *** -# This file was automatically generated on Fri Jun 26 21:48:00 2015 +# This file was automatically generated on Thu Aug 13 16:32:12 2015 # by libs/config/tools/generate.cpp # Copyright John Maddock. # Use, modification and distribution are subject to the @@ -41,6 +41,9 @@ explicit dirent_h ; run-simple test_case.cpp : : : TEST_BOOST_HAS_EXPM1 : expm1 ; alias expm1 : expm1.output ; explicit expm1 ; +run-simple test_case.cpp : : : TEST_BOOST_HAS_FLOAT128 : float128 ; +alias float128 : float128.output ; +explicit float128 ; run-simple test_case.cpp : : : TEST_BOOST_HAS_FTIME : ftime ; alias ftime : ftime.output ; explicit ftime ; diff --git a/checks/test_case.cpp b/checks/test_case.cpp index 9eaf99a1..6193e82d 100644 --- a/checks/test_case.cpp +++ b/checks/test_case.cpp @@ -1,4 +1,4 @@ -// This file was automatically generated on Fri Jun 26 21:48:00 2015 +// This file was automatically generated on Thu Aug 13 16:32:12 2015 // by libs/config/tools/generate.cpp // Copyright John Maddock 2002-4. // Use, modification and distribution are subject to the @@ -29,6 +29,10 @@ namespace test = boost_has_dirent_h; # include "../test/boost_has_expm1.ipp" namespace test = boost_has_expm1; #endif +#ifdef TEST_BOOST_HAS_FLOAT128 +# include "../test/boost_has_float128.ipp" +namespace test = boost_has_float128; +#endif #ifdef TEST_BOOST_HAS_FTIME # include "../test/boost_has_ftime.ipp" namespace test = boost_has_ftime; diff --git a/doc/html/boost_config/boost_macro_reference.html b/doc/html/boost_config/boost_macro_reference.html index 3138e4fb..acda8ff0 100644 --- a/doc/html/boost_config/boost_macro_reference.html +++ b/doc/html/boost_config/boost_macro_reference.html @@ -1427,6 +1427,25 @@ + +

+ BOOST_HAS_FLOAT128 +

+ + +

+ Compiler +

+ + +

+ The compiler has __float128 + as a native type which is distinct from all the regular C++ floating + point types. +

+ + +

BOOST_HAS_FTIME diff --git a/doc/html/index.html b/doc/html/index.html index faecedf4..b1e51ae0 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -988,7 +988,7 @@ - +

Last revised: July 07, 2015 at 10:18:34 GMT

Last revised: August 13, 2015 at 16:11:58 GMT


diff --git a/doc/macro_reference.qbk b/doc/macro_reference.qbk index d1e03d59..0973c365 100644 --- a/doc/macro_reference.qbk +++ b/doc/macro_reference.qbk @@ -348,6 +348,9 @@ The platform has the POSIX header ``. [[`BOOST_HAS_EXPM1`][Platform][ The platform has the functions `expm1`, `expm1f` and `expm1l` in `` ]] +[[`BOOST_HAS_FLOAT128`][Compiler][ +The compiler has `__float128` as a native type which is distinct +from all the regular C++ floating point types.]] [[`BOOST_HAS_FTIME`][Platform][ The platform has the Win32 API type FTIME. ]] diff --git a/include/boost/config/compiler/gcc.hpp b/include/boost/config/compiler/gcc.hpp index 41705df0..07147ee0 100644 --- a/include/boost/config/compiler/gcc.hpp +++ b/include/boost/config/compiler/gcc.hpp @@ -143,6 +143,19 @@ #if defined(__SIZEOF_INT128__) && !defined(__CUDACC__) # define BOOST_HAS_INT128 #endif +// +// Recent GCC versions have a __float128 native type, we need to +// include a std lib header to detect this - not ideal, but we'll +// be including later anyway when we select the std lib. +// +#ifdef __cplusplus +#include +#else +#include +#endif +#if defined(_GLIBCXX_USE_FLOAT128) && !defined(__STRICT_ANSI__) +# define BOOST_HAS_FLOAT128 +#endif // C++0x features in 4.3.n and later // diff --git a/test/all/Jamfile.v2 b/test/all/Jamfile.v2 index 1bca6e6b..9d0b1e09 100644 --- a/test/all/Jamfile.v2 +++ b/test/all/Jamfile.v2 @@ -1,7 +1,7 @@ # # Regression test Jamfile for boost configuration setup. # *** DO NOT EDIT THIS FILE BY HAND *** -# This file was automatically generated on Fri Jun 26 21:48:00 2015 +# This file was automatically generated on Thu Aug 13 16:32:12 2015 # by libs/config/tools/generate.cpp # Copyright John Maddock. # Use, modification and distribution are subject to the @@ -37,6 +37,9 @@ test-suite "BOOST_HAS_DIRENT_H" : test-suite "BOOST_HAS_EXPM1" : [ run ../has_expm1_pass.cpp ] [ compile-fail ../has_expm1_fail.cpp ] ; +test-suite "BOOST_HAS_FLOAT128" : +[ run ../has_float128_pass.cpp ] +[ compile-fail ../has_float128_fail.cpp ] ; test-suite "BOOST_HAS_FTIME" : [ run ../has_ftime_pass.cpp ] [ compile-fail ../has_ftime_fail.cpp ] ; diff --git a/test/config_info.cpp b/test/config_info.cpp index b466c43c..bb512ac3 100644 --- a/test/config_info.cpp +++ b/test/config_info.cpp @@ -937,6 +937,7 @@ void print_boost_macros() PRINT_MACRO(BOOST_HAS_CLOCK_GETTIME); PRINT_MACRO(BOOST_HAS_DIRENT_H); PRINT_MACRO(BOOST_HAS_EXPM1); + PRINT_MACRO(BOOST_HAS_FLOAT128); PRINT_MACRO(BOOST_HAS_FTIME); PRINT_MACRO(BOOST_HAS_GETSYSTEMTIMEASFILETIME); PRINT_MACRO(BOOST_HAS_GETTIMEOFDAY); @@ -1125,6 +1126,7 @@ void print_boost_macros() PRINT_MACRO(BOOST_NO_VOID_RETURNS); + // END GENERATED BLOCK PRINT_MACRO(BOOST_INTEL); diff --git a/test/config_test.cpp b/test/config_test.cpp index 3a3f5ba5..18b3726d 100644 --- a/test/config_test.cpp +++ b/test/config_test.cpp @@ -1,4 +1,4 @@ -// This file was automatically generated on Fri Jun 26 21:48:00 2015 +// This file was automatically generated on Thu Aug 13 16:32:12 2015 // by libs/config/tools/generate.cpp // Copyright John Maddock 2002-4. // Use, modification and distribution are subject to the @@ -753,6 +753,11 @@ namespace boost_has_dirent_h = empty_boost; #else namespace boost_has_expm1 = empty_boost; #endif +#ifdef BOOST_HAS_FLOAT128 +#include "boost_has_float128.ipp" +#else +namespace boost_has_float128 = empty_boost; +#endif #ifdef BOOST_HAS_FTIME #include "boost_has_ftime.ipp" #else @@ -1016,6 +1021,11 @@ int main( int, char *[] ) std::cerr << "Failed test for BOOST_HAS_EXPM1 at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } + if(0 != boost_has_float128::test()) + { + std::cerr << "Failed test for BOOST_HAS_FLOAT128 at: " << __FILE__ << ":" << __LINE__ << std::endl; + ++error_count; + } if(0 != boost_has_ftime::test()) { std::cerr << "Failed test for BOOST_HAS_FTIME at: " << __FILE__ << ":" << __LINE__ << std::endl;