Add support for C++11 thread_local.

This commit is contained in:
jzmaddock
2016-07-02 09:09:19 +01:00
parent fb27cce043
commit 4fc32ad70a
28 changed files with 162 additions and 6 deletions

View File

@ -1,6 +1,6 @@
#
# *** DO NOT EDIT THIS FILE BY HAND ***
# This file was automatically generated on Sat Feb 27 18:40:12 2016
# This file was automatically generated on Fri Jul 1 18:47:25 2016
# by libs/config/tools/generate.cpp
# Copyright John Maddock.
# Use, modification and distribution are subject to the
@ -118,6 +118,7 @@ run-simple <define>TEST_BOOST_NO_CXX11_NUMERIC_LIMITS : cxx11_numeric_limits ;
run-simple <define>TEST_BOOST_NO_CXX11_REF_QUALIFIERS : cxx11_ref_qualifiers ;
run-simple <define>TEST_BOOST_NO_CXX11_SMART_PTR : cxx11_smart_ptr ;
run-simple <define>TEST_BOOST_NO_CXX11_STD_ALIGN : cxx11_std_align ;
run-simple <define>TEST_BOOST_NO_CXX11_THREAD_LOCAL : cxx11_thread_local ;
run-simple <define>TEST_BOOST_NO_CXX11_TRAILING_RESULT_TYPES : cxx11_trailing_result_types ;
run-simple <define>TEST_BOOST_NO_CXX11_USER_DEFINED_LITERALS : cxx11_user_defined_literals ;
run-simple <define>TEST_BOOST_NO_CXX14_BINARY_LITERALS : cxx14_binary_literals ;

View File

@ -1,4 +1,4 @@
// This file was automatically generated on Sat Feb 27 18:40:12 2016
// This file was automatically generated on Fri Jul 1 18:47:25 2016
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to the
@ -405,6 +405,10 @@ namespace test = boost_no_cxx11_smart_ptr;
# include "../test/boost_no_cxx11_std_align.ipp"
namespace test = boost_no_cxx11_std_align;
#endif
#ifdef TEST_BOOST_NO_CXX11_THREAD_LOCAL
# include "../test/boost_no_cxx11_thread_local.ipp"
namespace test = boost_no_cxx11_thread_local;
#endif
#ifdef TEST_BOOST_NO_CXX11_TRAILING_RESULT_TYPES
# include "../test/boost_no_cxx11_trailing_result_types.ipp"
namespace test = boost_no_cxx11_trailing_result_types;

View File

@ -3115,6 +3115,19 @@
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">BOOST_NO_CXX11_THREAD_LOCAL</span></code>
</p>
</td>
<td>
<p>
The compiler does not support the <code class="computeroutput"><span class="keyword">thread_local</span></code>
storage specifier.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">BOOST_NO_CXX11_TRAILING_RESULT_TYPES</span></code>

View File

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

View File

@ -702,6 +702,8 @@ scoped enumerations (`enum class`).
]]
[[`BOOST_NO_CXX11_TEMPLATE_ALIASES`][The compiler does not support template aliases.
]]
[[`BOOST_NO_CXX11_THREAD_LOCAL`][The compiler does not support the `thread_local` storage specifier.
]]
[[`BOOST_NO_CXX11_TRAILING_RESULT_TYPES`][The compiler does not support the new function result type
specification syntax (e.g. `auto foo(T) -> T;`).]]
[[`BOOST_NO_CXX11_UNICODE_LITERALS`][The compiler does not support

View File

@ -196,6 +196,7 @@
#define BOOST_NO_CXX11_INLINE_NAMESPACES
#define BOOST_NO_CXX11_REF_QUALIFIERS
#define BOOST_NO_CXX11_FINAL
#define BOOST_NO_CXX11_THREAD_LOCAL
// C++ 14:
#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)

View File

@ -39,6 +39,10 @@
# define BOOST_NO_TYPEID
#endif
#if !__has_feature(cxx_thread_local)
# define BOOST_NO_CXX11_THREAD_LOCAL
#endif
#ifdef __is_identifier
#if !__is_identifier(__int64) && !defined(__GNUC__)
# define BOOST_HAS_MS_INT64

View File

@ -122,6 +122,7 @@
#define BOOST_NO_CXX11_INLINE_NAMESPACES
#define BOOST_NO_CXX11_REF_QUALIFIERS
#define BOOST_NO_CXX11_FINAL
#define BOOST_NO_CXX11_THREAD_LOCAL
// C++ 14:
#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)

View File

@ -106,6 +106,7 @@
#define BOOST_NO_CXX11_INLINE_NAMESPACES
#define BOOST_NO_CXX11_REF_QUALIFIERS
#define BOOST_NO_CXX11_FINAL
#define BOOST_NO_CXX11_THREAD_LOCAL
// C++ 14:
#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)

View File

@ -60,6 +60,7 @@
#define BOOST_NO_CXX11_CHAR16_T
#define BOOST_NO_CXX11_REF_QUALIFIERS
#define BOOST_NO_CXX11_FINAL
#define BOOST_NO_CXX11_THREAD_LOCAL
//#define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG

View File

@ -82,6 +82,7 @@
#define BOOST_NO_CXX11_INLINE_NAMESPACES
#define BOOST_NO_CXX11_REF_QUALIFIERS
#define BOOST_NO_CXX11_FINAL
#define BOOST_NO_CXX11_THREAD_LOCAL
// C++ 14:
#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)

View File

@ -252,6 +252,7 @@
//
#if (BOOST_GCC_VERSION < 40800) || !defined(BOOST_GCC_CXX11)
# define BOOST_NO_CXX11_ALIGNAS
# define BOOST_NO_CXX11_THREAD_LOCAL
#endif
// C++0x features in 4.8.1 and later

View File

@ -59,7 +59,8 @@
# define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
# define BOOST_NO_CXX11_INLINE_NAMESPACES
# define BOOST_NO_CXX11_REF_QUALIFIERS
#define BOOST_NO_CXX11_FINAL
# define BOOST_NO_CXX11_FINAL
# define BOOST_NO_CXX11_THREAD_LOCAL
// C++ 14:
#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)

View File

@ -123,6 +123,7 @@
#define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
#define BOOST_NO_CXX11_INLINE_NAMESPACES
#define BOOST_NO_CXX11_REF_QUALIFIERS
#define BOOST_NO_CXX11_THREAD_LOCAL
/*
See https://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1443331 and

View File

@ -125,6 +125,7 @@
#define BOOST_NO_CXX11_INLINE_NAMESPACES
#define BOOST_NO_CXX11_REF_QUALIFIERS
#define BOOST_NO_CXX11_FINAL
#define BOOST_NO_CXX11_THREAD_LOCAL
// C++ 14:
#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)

View File

@ -74,6 +74,7 @@
#define BOOST_NO_CXX11_INLINE_NAMESPACES
#define BOOST_NO_CXX11_REF_QUALIFIERS
#define BOOST_NO_CXX11_FINAL
#define BOOST_NO_CXX11_THREAD_LOCAL
// C++ 14:
#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)

View File

@ -82,6 +82,7 @@
# define BOOST_NO_CXX11_INLINE_NAMESPACES
# define BOOST_NO_CXX11_REF_QUALIFIERS
# define BOOST_NO_CXX11_FINAL
# define BOOST_NO_CXX11_THREAD_LOCAL
// C++ 14:
#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)

View File

@ -120,6 +120,7 @@
#define BOOST_NO_CXX11_INLINE_NAMESPACES
#define BOOST_NO_CXX11_REF_QUALIFIERS
#define BOOST_NO_CXX11_FINAL
#define BOOST_NO_CXX11_THREAD_LOCAL
// C++ 14:
#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)

View File

@ -132,6 +132,7 @@
#define BOOST_NO_CXX11_DECLTYPE_N3276
#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
#define BOOST_NO_CXX11_REF_QUALIFIERS
#define BOOST_NO_CXX11_THREAD_LOCAL
#endif
#define BOOST_NO_COMPLETE_VALUE_INITIALIZATION

View File

@ -131,6 +131,7 @@
#define BOOST_NO_CXX11_INLINE_NAMESPACES
#define BOOST_NO_CXX11_REF_QUALIFIERS
#define BOOST_NO_CXX11_FINAL
#define BOOST_NO_CXX11_THREAD_LOCAL
// C++ 14:
#if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304)

View File

@ -180,6 +180,7 @@
# define BOOST_NO_CXX14_BINARY_LITERALS
# define BOOST_NO_CXX14_GENERIC_LAMBDAS
# define BOOST_NO_CXX14_DIGIT_SEPARATORS
# define BOOST_NO_CXX11_THREAD_LOCAL
#endif
// MSVC including version 14 has not yet completely

View File

@ -238,6 +238,10 @@
# define BOOST_NO_CXX14_VARIABLE_TEMPLATES
#endif
#if !__has_feature(cxx_thread_local)
# define BOOST_NO_CXX11_THREAD_LOCAL
#endif
#if __cplusplus < 201400
// All versions with __cplusplus above this value seem to support this:
# define BOOST_NO_CXX14_DIGIT_SEPARATORS

View File

@ -1,7 +1,7 @@
#
# Regression test Jamfile for boost configuration setup.
# *** DO NOT EDIT THIS FILE BY HAND ***
# This file was automatically generated on Sat Feb 27 18:40:12 2016
# This file was automatically generated on Fri Jul 1 18:47:25 2016
# by libs/config/tools/generate.cpp
# Copyright John Maddock.
# Use, modification and distribution are subject to the
@ -319,6 +319,9 @@ test-suite "BOOST_NO_CXX11_SMART_PTR" :
test-suite "BOOST_NO_CXX11_STD_ALIGN" :
[ run ../no_cxx11_std_align_pass.cpp ]
[ compile-fail ../no_cxx11_std_align_fail.cpp ] ;
test-suite "BOOST_NO_CXX11_THREAD_LOCAL" :
[ run ../no_cxx11_thread_local_pass.cpp ]
[ compile-fail ../no_cxx11_thread_local_fail.cpp ] ;
test-suite "BOOST_NO_CXX11_TRAILING_RESULT_TYPES" :
[ run ../no_cxx11_trailing_result_types_pass.cpp ]
[ compile-fail ../no_cxx11_trailing_result_types_fail.cpp ] ;

View File

@ -0,0 +1,24 @@
// (C) Copyright John Maddock 2012.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/config for most recent version.
// MACRO: BOOST_NO_CXX11_THREAD_LOCAL
// TITLE: thread_local
// DESCRIPTION: The compiler supports the thread_local storage specifier.
#include <string>
namespace boost_no_cxx11_thread_local{
int test()
{
static thread_local std::string local("hello");
return 0;
}
}

View File

@ -1057,6 +1057,7 @@ void print_boost_macros()
PRINT_MACRO(BOOST_NO_CXX11_STATIC_ASSERT);
PRINT_MACRO(BOOST_NO_CXX11_STD_ALIGN);
PRINT_MACRO(BOOST_NO_CXX11_TEMPLATE_ALIASES);
PRINT_MACRO(BOOST_NO_CXX11_THREAD_LOCAL);
PRINT_MACRO(BOOST_NO_CXX11_TRAILING_RESULT_TYPES);
PRINT_MACRO(BOOST_NO_CXX11_UNICODE_LITERALS);
PRINT_MACRO(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX);
@ -1139,6 +1140,7 @@ void print_boost_macros()
// END GENERATED BLOCK
PRINT_MACRO(BOOST_INTEL);

View File

@ -1,4 +1,4 @@
// This file was automatically generated on Sat Feb 27 18:40:12 2016
// This file was automatically generated on Fri Jul 1 18:47:25 2016
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to the
@ -252,6 +252,11 @@ namespace boost_no_cxx11_smart_ptr = empty_boost;
#else
namespace boost_no_cxx11_std_align = empty_boost;
#endif
#ifndef BOOST_NO_CXX11_THREAD_LOCAL
#include "boost_no_cxx11_thread_local.ipp"
#else
namespace boost_no_cxx11_thread_local = empty_boost;
#endif
#ifndef BOOST_NO_CXX11_TRAILING_RESULT_TYPES
#include "boost_no_cxx11_trailing_result_types.ipp"
#else
@ -1491,6 +1496,11 @@ int main( int, char *[] )
std::cerr << "Failed test for BOOST_NO_CXX11_STD_ALIGN at: " << __FILE__ << ":" << __LINE__ << std::endl;
++error_count;
}
if(0 != boost_no_cxx11_thread_local::test())
{
std::cerr << "Failed test for BOOST_NO_CXX11_THREAD_LOCAL at: " << __FILE__ << ":" << __LINE__ << std::endl;
++error_count;
}
if(0 != boost_no_cxx11_trailing_result_types::test())
{
std::cerr << "Failed test for BOOST_NO_CXX11_TRAILING_RESULT_TYPES at: " << __FILE__ << ":" << __LINE__ << std::endl;

View File

@ -0,0 +1,37 @@
// This file was automatically generated on Fri Jul 1 18:47:25 2016
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/config for the most recent version.//
// Revision $Id$
//
// Test file for macro BOOST_NO_CXX11_THREAD_LOCAL
// This file should not compile, if it does then
// BOOST_NO_CXX11_THREAD_LOCAL should not be defined.
// See file boost_no_cxx11_thread_local.ipp for details
// Must not have BOOST_ASSERT_CONFIG set; it defeats
// the objective of this file:
#ifdef BOOST_ASSERT_CONFIG
# undef BOOST_ASSERT_CONFIG
#endif
#include <boost/config.hpp>
#include "test.hpp"
#ifdef BOOST_NO_CXX11_THREAD_LOCAL
#include "boost_no_cxx11_thread_local.ipp"
#else
#error "this file should not compile"
#endif
int main( int, char *[] )
{
return boost_no_cxx11_thread_local::test();
}

View File

@ -0,0 +1,37 @@
// This file was automatically generated on Fri Jul 1 18:47:25 2016
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/config for the most recent version.//
// Revision $Id$
//
// Test file for macro BOOST_NO_CXX11_THREAD_LOCAL
// This file should compile, if it does not then
// BOOST_NO_CXX11_THREAD_LOCAL should be defined.
// See file boost_no_cxx11_thread_local.ipp for details
// Must not have BOOST_ASSERT_CONFIG set; it defeats
// the objective of this file:
#ifdef BOOST_ASSERT_CONFIG
# undef BOOST_ASSERT_CONFIG
#endif
#include <boost/config.hpp>
#include "test.hpp"
#ifndef BOOST_NO_CXX11_THREAD_LOCAL
#include "boost_no_cxx11_thread_local.ipp"
#else
namespace boost_no_cxx11_thread_local = empty_boost;
#endif
int main( int, char *[] )
{
return boost_no_cxx11_thread_local::test();
}