Add BOOST_HAS_FLOAT128 for compilers that support __float128 as a distinct type.

This commit is contained in:
jzmaddock
2015-08-13 17:13:32 +01:00
parent a8f96e4b6e
commit 15fa6fd8b9
9 changed files with 62 additions and 5 deletions

View File

@ -1,6 +1,6 @@
# #
# *** DO NOT EDIT THIS FILE BY HAND *** # *** 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 # by libs/config/tools/generate.cpp
# Copyright John Maddock. # Copyright John Maddock.
# Use, modification and distribution are subject to the # Use, modification and distribution are subject to the
@ -41,6 +41,9 @@ explicit dirent_h ;
run-simple test_case.cpp : : : <define>TEST_BOOST_HAS_EXPM1 : expm1 ; run-simple test_case.cpp : : : <define>TEST_BOOST_HAS_EXPM1 : expm1 ;
alias expm1 : expm1.output ; alias expm1 : expm1.output ;
explicit expm1 ; explicit expm1 ;
run-simple test_case.cpp : : : <define>TEST_BOOST_HAS_FLOAT128 : float128 ;
alias float128 : float128.output ;
explicit float128 ;
run-simple test_case.cpp : : : <define>TEST_BOOST_HAS_FTIME : ftime ; run-simple test_case.cpp : : : <define>TEST_BOOST_HAS_FTIME : ftime ;
alias ftime : ftime.output ; alias ftime : ftime.output ;
explicit ftime ; explicit ftime ;

View File

@ -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 // by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4. // Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to the // Use, modification and distribution are subject to the
@ -29,6 +29,10 @@ namespace test = boost_has_dirent_h;
# include "../test/boost_has_expm1.ipp" # include "../test/boost_has_expm1.ipp"
namespace test = boost_has_expm1; namespace test = boost_has_expm1;
#endif #endif
#ifdef TEST_BOOST_HAS_FLOAT128
# include "../test/boost_has_float128.ipp"
namespace test = boost_has_float128;
#endif
#ifdef TEST_BOOST_HAS_FTIME #ifdef TEST_BOOST_HAS_FTIME
# include "../test/boost_has_ftime.ipp" # include "../test/boost_has_ftime.ipp"
namespace test = boost_has_ftime; namespace test = boost_has_ftime;

View File

@ -1427,6 +1427,25 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">BOOST_HAS_FLOAT128</span></code>
</p>
</td>
<td>
<p>
Compiler
</p>
</td>
<td>
<p>
The compiler has <code class="computeroutput"><span class="identifier">__float128</span></code>
as a native type which is distinct from all the regular C++ floating
point types.
</p>
</td>
</tr>
<tr>
<td> <td>
<p> <p>
<code class="computeroutput"><span class="identifier">BOOST_HAS_FTIME</span></code> <code class="computeroutput"><span class="identifier">BOOST_HAS_FTIME</span></code>

View File

@ -988,7 +988,7 @@
</div> </div>
</div> </div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"><p><small>Last revised: July 07, 2015 at 10:18:34 GMT</small></p></td> <td align="left"><p><small>Last revised: August 13, 2015 at 16:11:58 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td> <td align="right"><div class="copyright-footer"></div></td>
</tr></table> </tr></table>
<hr> <hr>

View File

@ -348,6 +348,9 @@ The platform has the POSIX header `<dirent.h>`.
[[`BOOST_HAS_EXPM1`][Platform][ [[`BOOST_HAS_EXPM1`][Platform][
The platform has the functions `expm1`, `expm1f` and `expm1l` in `<math.h>` The platform has the functions `expm1`, `expm1f` and `expm1l` in `<math.h>`
]] ]]
[[`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][ [[`BOOST_HAS_FTIME`][Platform][
The platform has the Win32 API type FTIME. The platform has the Win32 API type FTIME.
]] ]]

View File

@ -143,6 +143,19 @@
#if defined(__SIZEOF_INT128__) && !defined(__CUDACC__) #if defined(__SIZEOF_INT128__) && !defined(__CUDACC__)
# define BOOST_HAS_INT128 # define BOOST_HAS_INT128
#endif #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 <cstddef> later anyway when we select the std lib.
//
#ifdef __cplusplus
#include <cstddef>
#else
#include <stddef.h>
#endif
#if defined(_GLIBCXX_USE_FLOAT128) && !defined(__STRICT_ANSI__)
# define BOOST_HAS_FLOAT128
#endif
// C++0x features in 4.3.n and later // C++0x features in 4.3.n and later
// //

View File

@ -1,7 +1,7 @@
# #
# Regression test Jamfile for boost configuration setup. # Regression test Jamfile for boost configuration setup.
# *** DO NOT EDIT THIS FILE BY HAND *** # *** 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 # by libs/config/tools/generate.cpp
# Copyright John Maddock. # Copyright John Maddock.
# Use, modification and distribution are subject to the # Use, modification and distribution are subject to the
@ -37,6 +37,9 @@ test-suite "BOOST_HAS_DIRENT_H" :
test-suite "BOOST_HAS_EXPM1" : test-suite "BOOST_HAS_EXPM1" :
[ run ../has_expm1_pass.cpp ] [ run ../has_expm1_pass.cpp ]
[ compile-fail ../has_expm1_fail.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" : test-suite "BOOST_HAS_FTIME" :
[ run ../has_ftime_pass.cpp ] [ run ../has_ftime_pass.cpp ]
[ compile-fail ../has_ftime_fail.cpp ] ; [ compile-fail ../has_ftime_fail.cpp ] ;

View File

@ -937,6 +937,7 @@ void print_boost_macros()
PRINT_MACRO(BOOST_HAS_CLOCK_GETTIME); PRINT_MACRO(BOOST_HAS_CLOCK_GETTIME);
PRINT_MACRO(BOOST_HAS_DIRENT_H); PRINT_MACRO(BOOST_HAS_DIRENT_H);
PRINT_MACRO(BOOST_HAS_EXPM1); PRINT_MACRO(BOOST_HAS_EXPM1);
PRINT_MACRO(BOOST_HAS_FLOAT128);
PRINT_MACRO(BOOST_HAS_FTIME); PRINT_MACRO(BOOST_HAS_FTIME);
PRINT_MACRO(BOOST_HAS_GETSYSTEMTIMEASFILETIME); PRINT_MACRO(BOOST_HAS_GETSYSTEMTIMEASFILETIME);
PRINT_MACRO(BOOST_HAS_GETTIMEOFDAY); PRINT_MACRO(BOOST_HAS_GETTIMEOFDAY);
@ -1125,6 +1126,7 @@ void print_boost_macros()
PRINT_MACRO(BOOST_NO_VOID_RETURNS); PRINT_MACRO(BOOST_NO_VOID_RETURNS);
// END GENERATED BLOCK // END GENERATED BLOCK
PRINT_MACRO(BOOST_INTEL); PRINT_MACRO(BOOST_INTEL);

View File

@ -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 // by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4. // Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to the // Use, modification and distribution are subject to the
@ -753,6 +753,11 @@ namespace boost_has_dirent_h = empty_boost;
#else #else
namespace boost_has_expm1 = empty_boost; namespace boost_has_expm1 = empty_boost;
#endif #endif
#ifdef BOOST_HAS_FLOAT128
#include "boost_has_float128.ipp"
#else
namespace boost_has_float128 = empty_boost;
#endif
#ifdef BOOST_HAS_FTIME #ifdef BOOST_HAS_FTIME
#include "boost_has_ftime.ipp" #include "boost_has_ftime.ipp"
#else #else
@ -1016,6 +1021,11 @@ int main( int, char *[] )
std::cerr << "Failed test for BOOST_HAS_EXPM1 at: " << __FILE__ << ":" << __LINE__ << std::endl; std::cerr << "Failed test for BOOST_HAS_EXPM1 at: " << __FILE__ << ":" << __LINE__ << std::endl;
++error_count; ++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()) if(0 != boost_has_ftime::test())
{ {
std::cerr << "Failed test for BOOST_HAS_FTIME at: " << __FILE__ << ":" << __LINE__ << std::endl; std::cerr << "Failed test for BOOST_HAS_FTIME at: " << __FILE__ << ":" << __LINE__ << std::endl;