From 4d507a6be6fd4bf89f2c28c31e5fae6f1852430a Mon Sep 17 00:00:00 2001 From: James Donald Date: Wed, 21 Sep 2016 11:59:15 -0700 Subject: [PATCH 01/14] Always set STL11_ALLOWED to true --- src/autowiring/C++11/cpp11.h | 90 +++++++++--------------------------- 1 file changed, 21 insertions(+), 69 deletions(-) diff --git a/src/autowiring/C++11/cpp11.h b/src/autowiring/C++11/cpp11.h index 682528979..7990eec8a 100644 --- a/src/autowiring/C++11/cpp11.h +++ b/src/autowiring/C++11/cpp11.h @@ -4,16 +4,8 @@ // The reason this header exists is due to the asymmetric availability of C++11 on our // various compiler targets. In particular, none of the typical headers for C++11 support // exist when building with libstdc++ on Apple, so we have to disable it across the board. -#ifdef __APPLE__ - #include // detect std::lib - #ifdef _LIBCPP_VERSION // clang + libc++ - #define STL11_ALLOWED 1 - #else // clang + libstdc++ - #define STL11_ALLOWED 0 - #endif -#else // gcc or MSVC - #define STL11_ALLOWED 1 -#endif + +#define STL11_ALLOWED 1 #define IS_CLANG defined(__clang_major__) #define CLANG_CHECK(maj, min) (__clang_major__ == maj && __clang_minor__ >= min || __clang_major__ > maj) @@ -102,7 +94,7 @@ #define HAS_STATIC_ASSERT 0 #endif -#if !HAS_STATIC_ASSERT || !STL11_ALLOWED +#if !HAS_STATIC_ASSERT // Static assert completely disabled if it's not available #define static_assert(...) #endif @@ -114,16 +106,12 @@ /********************* * system error availability *********************/ -#if STL11_ALLOWED - #define SYSTEM_ERROR_HEADER -#else - #define SYSTEM_ERROR_HEADER -#endif +#define SYSTEM_ERROR_HEADER /********************* * future availability *********************/ -#if (_MSC_VER >= 1700 || (STL11_ALLOWED)) && (!__ANDROID__ || (GCC_CHECK(4, 9) && __aarch64__)) +#if (!__ANDROID__ || (GCC_CHECK(4, 9) && __aarch64__)) #define FUTURE_HEADER #else // As of NDK r10, we still don't have an implementation of "future" for Android @@ -133,19 +121,14 @@ /** * type_index support */ -// Supported natively on any platform except Mac/libstdc++ -#if STL11_ALLOWED - #define TYPE_INDEX_HEADER -#else - #define TYPE_INDEX_HEADER -#endif +#define TYPE_INDEX_HEADER /********************* * Decide what version of type_traits we are going to use *********************/ #if _MSC_VER >= 1500 #define TYPE_TRAITS_AVAILABLE 1 -#elif __GXX_EXPERIMENTAL_CXX0X__ && STL11_ALLOWED +#elif __GXX_EXPERIMENTAL_CXX0X__ #define TYPE_TRAITS_AVAILABLE 1 #else #define TYPE_TRAITS_AVAILABLE 0 @@ -170,7 +153,7 @@ #define SHARED_PTR_IN_STL 0 #endif -#if SHARED_PTR_IN_STL && STL11_ALLOWED +#if SHARED_PTR_IN_STL #define MEMORY_HEADER #else #define MEMORY_HEADER @@ -180,7 +163,7 @@ #ifdef _MSC_VER #define HAS_NULLPTR_T 1 #elif IS_CLANG - #define HAS_NULLPTR_T (STL11_ALLOWED && __has_feature(cxx_nullptr)) + #define HAS_NULLPTR_T 1 #elif __cplusplus > 199711L #define HAS_NULLPTR_T 1 #else @@ -200,7 +183,7 @@ #ifdef _MSC_VER #define AUTOWIRE_cxx_is_constructible 1 #elif IS_CLANG - #define AUTOWIRE_cxx_is_constructible STL11_ALLOWED + #define AUTOWIRE_cxx_is_constructible 1 #else #define AUTOWIRE_cxx_is_constructible 1 #endif @@ -238,7 +221,7 @@ #define LAMBDAS_AVAILABLE 1 #endif -#if LAMBDAS_AVAILABLE && STL11_ALLOWED +#if LAMBDAS_AVAILABLE #define FUNCTIONAL_HEADER #define _WEBSOCKETPP_CPP11_FUNCTIONAL_ #else @@ -254,7 +237,7 @@ *********************/ #if _MSC_VER >= 1500 #define ARRAYS_AVAILABLE 1 -#elif __GXX_EXPERIMENTAL_CXX0X__ && STL11_ALLOWED +#elif __GXX_EXPERIMENTAL_CXX0X__ #define ARRAYS_AVAILABLE 1 #else #define ARRAYS_AVAILABLE 0 @@ -275,54 +258,29 @@ /** * R-value reference check */ -#if STL11_ALLOWED - #define RVALUE_HEADER - #define _WEBSOCKETPP_CPP11_MEMORY_ -#else - // Remove literal references in order to fix another missing header problem on *nix - // Defined by default on C++11 Clang - #if !defined(__APPLE__) || __cplusplus >= 201103L - #define BOOST_NO_UNICODE_LITERALS 1 - #endif - #define RVALUE_HEADER -#endif +#define RVALUE_HEADER +#define _WEBSOCKETPP_CPP11_MEMORY_ /** * Atomic */ -#if STL11_ALLOWED - #define ATOMIC_HEADER -#else - #define ATOMIC_HEADER -#endif +#define ATOMIC_HEADER /** * Tuple */ -#if STL11_ALLOWED - #define STL_TUPLE_HEADER -#else - #define STL_TUPLE_HEADER -#endif +#define STL_TUPLE_HEADER /** * Mutex */ -#if STL11_ALLOWED - #define MUTEX_HEADER -#else - #define MUTEX_HEADER -#endif +#define MUTEX_HEADER /** * Thread */ -#if STL11_ALLOWED - #define THREAD_HEADER - #define _WEBSOCKETPP_CPP11_THREAD_ -#else - #define THREAD_HEADER -#endif +#define THREAD_HEADER +#define _WEBSOCKETPP_CPP11_THREAD_ /** * Chrono @@ -332,18 +290,12 @@ /** * Utility */ -#if STL11_ALLOWED - #define UTILITY_HEADER -#else - #define UTILITY_HEADER -#endif +#define UTILITY_HEADER /** * System error */ -#if STL11_ALLOWED - #define _WEBSOCKETPP_CPP11_SYSTEM_ERROR_ -#endif +#define _WEBSOCKETPP_CPP11_SYSTEM_ERROR_ /** * Filesystem From 162e25c659addf3cad395ed28779ac87694155ea Mon Sep 17 00:00:00 2001 From: James Donald Date: Wed, 21 Sep 2016 12:02:21 -0700 Subject: [PATCH 02/14] Unify HAS_NULLPTR_T and AUTOWIRE_cxx_is_constructible --- src/autowiring/C++11/cpp11.h | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/src/autowiring/C++11/cpp11.h b/src/autowiring/C++11/cpp11.h index 7990eec8a..89727b9dc 100644 --- a/src/autowiring/C++11/cpp11.h +++ b/src/autowiring/C++11/cpp11.h @@ -159,34 +159,12 @@ #define MEMORY_HEADER #endif -// Nullptr_t has odd availability -#ifdef _MSC_VER - #define HAS_NULLPTR_T 1 -#elif IS_CLANG - #define HAS_NULLPTR_T 1 -#elif __cplusplus > 199711L - #define HAS_NULLPTR_T 1 -#else - // No idea--better safe than sorry! - #define HAS_NULLPTR_T 1 -#endif - -#if ! HAS_NULLPTR_T - // Have to provide our own dummy type, then, there's no header for this one - namespace std { typedef decltype(nullptr) nullptr_t; } -#endif - +#define HAS_NULLPTR_T 1 /********************* * Specific support for is_constructible *********************/ -#ifdef _MSC_VER - #define AUTOWIRE_cxx_is_constructible 1 -#elif IS_CLANG - #define AUTOWIRE_cxx_is_constructible 1 -#else - #define AUTOWIRE_cxx_is_constructible 1 -#endif +#define AUTOWIRE_cxx_is_constructible 1 /********************* * noexcept support From 23fb585ea99f30297e6cc69ad438aa7b59c0fc64 Mon Sep 17 00:00:00 2001 From: James Donald Date: Wed, 21 Sep 2016 12:08:57 -0700 Subject: [PATCH 03/14] Assume newer versions of clang with initializer_list --- src/autowiring/C++11/cpp11.h | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/autowiring/C++11/cpp11.h b/src/autowiring/C++11/cpp11.h index 89727b9dc..a2b82c8c9 100644 --- a/src/autowiring/C++11/cpp11.h +++ b/src/autowiring/C++11/cpp11.h @@ -11,6 +11,10 @@ #define CLANG_CHECK(maj, min) (__clang_major__ == maj && __clang_minor__ >= min || __clang_major__ > maj) #define GCC_CHECK(maj, min) (__GNUC__ == maj && __GNUC_MINOR__ >= min || __GNUC__ > maj) +#if IS_CLANG && !CLANG_CHECK(3, 6) + #error Autowiring is not supported on clang 3.5 or older +#endif + // If Boost.Thread is used, we want it to provide the new name for its class #define BOOST_THREAD_PROVIDES_FUTURE @@ -64,17 +68,8 @@ /********************* * initializer_list header *********************/ -#if IS_CLANG - #define HAS_INITIALIZER_LIST __has_feature(cxx_generalized_initializers) - #if HAS_INITIALIZER_LIST - #define INITIALIZER_LIST_HEADER - #else - #define INITIALIZER_LIST_HEADER - #endif -#else - #define HAS_INITIALIZER_LIST 1 - #define INITIALIZER_LIST_HEADER -#endif +#define HAS_INITIALIZER_LIST 1 +#define INITIALIZER_LIST_HEADER /********************* * Check override keyword availability From 8d10e3cb507b334222d8d4f491eba414adb67c07 Mon Sep 17 00:00:00 2001 From: James Donald Date: Wed, 21 Sep 2016 12:14:05 -0700 Subject: [PATCH 04/14] Remove another _LIBCPP_VERSION check --- src/autowiring/C++11/cpp11.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/autowiring/C++11/cpp11.h b/src/autowiring/C++11/cpp11.h index a2b82c8c9..2327791bd 100644 --- a/src/autowiring/C++11/cpp11.h +++ b/src/autowiring/C++11/cpp11.h @@ -57,13 +57,8 @@ /********************* * Location of the unordered_set header *********************/ -#if defined(__APPLE__) && !defined(_LIBCPP_VERSION) - #define STL_UNORDERED_SET - #define STL_UNORDERED_MAP -#else - #define STL_UNORDERED_SET - #define STL_UNORDERED_MAP -#endif +#define STL_UNORDERED_SET +#define STL_UNORDERED_MAP /********************* * initializer_list header From 1bb0ce591b12edc07cae3be2fea5ed6e9869978d Mon Sep 17 00:00:00 2001 From: James Donald Date: Wed, 21 Sep 2016 12:22:40 -0700 Subject: [PATCH 05/14] Another place to assume clang 3.6 and -std=c++11 --- src/autowiring/C++11/cpp11.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/autowiring/C++11/cpp11.h b/src/autowiring/C++11/cpp11.h index 2327791bd..775fdb0a8 100644 --- a/src/autowiring/C++11/cpp11.h +++ b/src/autowiring/C++11/cpp11.h @@ -178,13 +178,8 @@ *********************/ #if _MSC_VER >= 1500 #define LAMBDAS_AVAILABLE 1 -#elif CLANG_CHECK(3, 2) - // Only available if we're told we're using at least C++11 - #if __cplusplus >= 201103L - #define LAMBDAS_AVAILABLE 1 - #else - #define LAMBDAS_AVAILABLE 0 - #endif +#elif IS_CLANG + #define LAMBDAS_AVAILABLE 1 #elif __GXX_EXPERIMENTAL_CXX0X__ #define LAMBDAS_AVAILABLE 1 #endif From 36251988d1c9ca9a8af98adda190580e031e53ae Mon Sep 17 00:00:00 2001 From: James Donald Date: Wed, 21 Sep 2016 12:31:40 -0700 Subject: [PATCH 06/14] Assuming static_assert() on modern clang --- src/autowiring/C++11/cpp11.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/autowiring/C++11/cpp11.h b/src/autowiring/C++11/cpp11.h index 775fdb0a8..1cf07a325 100644 --- a/src/autowiring/C++11/cpp11.h +++ b/src/autowiring/C++11/cpp11.h @@ -76,7 +76,7 @@ /********************* * static_assert availability *********************/ -#if CLANG_CHECK(2, 9) || GCC_CHECK(4, 3) +#if IS_CLANG || GCC_CHECK(4, 3) #define HAS_STATIC_ASSERT 1 #elif _MSC_VER >= 1500 #define HAS_STATIC_ASSERT 1 From b6f92c8eaab54f02339dc50d87d2688e83f003e0 Mon Sep 17 00:00:00 2001 From: James Donald Date: Wed, 21 Sep 2016 12:34:06 -0700 Subject: [PATCH 07/14] Update header comment accordingly --- src/autowiring/C++11/cpp11.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/autowiring/C++11/cpp11.h b/src/autowiring/C++11/cpp11.h index 1cf07a325..f54dec538 100644 --- a/src/autowiring/C++11/cpp11.h +++ b/src/autowiring/C++11/cpp11.h @@ -1,9 +1,8 @@ -// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. +// Copyright (C) 2012-2016 Leap Motion, Inc. All rights reserved. #pragma once // The reason this header exists is due to the asymmetric availability of C++11 on our -// various compiler targets. In particular, none of the typical headers for C++11 support -// exist when building with libstdc++ on Apple, so we have to disable it across the board. +// various compiler targets. #define STL11_ALLOWED 1 From c024597d4d9b75b1f542ed0ffbd45fa6dda5c337 Mon Sep 17 00:00:00 2001 From: James Donald Date: Wed, 21 Sep 2016 12:46:25 -0700 Subject: [PATCH 08/14] Remove unneeded TR1 headers --- src/autowiring/C++11/tr1_unordered_map.h | 9 --------- src/autowiring/C++11/tr1_unordered_set.h | 9 --------- src/autowiring/CMakeLists.txt | 2 -- 3 files changed, 20 deletions(-) delete mode 100644 src/autowiring/C++11/tr1_unordered_map.h delete mode 100644 src/autowiring/C++11/tr1_unordered_set.h diff --git a/src/autowiring/C++11/tr1_unordered_map.h b/src/autowiring/C++11/tr1_unordered_map.h deleted file mode 100644 index 47a092f88..000000000 --- a/src/autowiring/C++11/tr1_unordered_map.h +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. -#pragma once - -#include - -namespace std { - using std::tr1::unordered_map; - using std::tr1::hash; -} diff --git a/src/autowiring/C++11/tr1_unordered_set.h b/src/autowiring/C++11/tr1_unordered_set.h deleted file mode 100644 index 5ab07ee7e..000000000 --- a/src/autowiring/C++11/tr1_unordered_set.h +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. -#pragma once - -#include - -namespace std { - using std::tr1::unordered_set; - using std::tr1::hash; -} diff --git a/src/autowiring/CMakeLists.txt b/src/autowiring/CMakeLists.txt index dd5c2f91b..19739ee38 100644 --- a/src/autowiring/CMakeLists.txt +++ b/src/autowiring/CMakeLists.txt @@ -198,8 +198,6 @@ add_conditional_sources( C++11/memory.h C++11/memory_nostl11.h C++11/mutex.h - C++11/tr1_unordered_map.h - C++11/tr1_unordered_set.h C++11/type_index.h C++11/unique_ptr.h ) From 8467e85e8881cc12a22c11bd336f255df41572cb Mon Sep 17 00:00:00 2001 From: James Donald Date: Wed, 21 Sep 2016 12:55:40 -0700 Subject: [PATCH 09/14] Remove specific now-unused boost headers --- Autowiring.nuspec.in | 13 +--- src/autowiring/C++11/boost_atomic.h | 18 ------ src/autowiring/C++11/boost_mutex.h | 21 ------ src/autowiring/C++11/boost_rvalue.h | 9 --- src/autowiring/C++11/boost_system_error.h | 17 ----- src/autowiring/C++11/boost_thread.h | 9 --- src/autowiring/C++11/boost_tuple.h | 78 ----------------------- src/autowiring/C++11/boost_utility.h | 8 --- src/autowiring/C++11/type_index.h | 52 --------------- src/autowiring/CMakeLists.txt | 9 --- 10 files changed, 2 insertions(+), 232 deletions(-) delete mode 100644 src/autowiring/C++11/boost_atomic.h delete mode 100644 src/autowiring/C++11/boost_mutex.h delete mode 100644 src/autowiring/C++11/boost_rvalue.h delete mode 100644 src/autowiring/C++11/boost_system_error.h delete mode 100644 src/autowiring/C++11/boost_thread.h delete mode 100644 src/autowiring/C++11/boost_tuple.h delete mode 100644 src/autowiring/C++11/boost_utility.h delete mode 100644 src/autowiring/C++11/type_index.h diff --git a/Autowiring.nuspec.in b/Autowiring.nuspec.in index 9525f586a..c0f19336a 100644 --- a/Autowiring.nuspec.in +++ b/Autowiring.nuspec.in @@ -9,7 +9,7 @@ false A C++11 Concurrent Inversion of Control framework Autowiring is an inversion-of-control framework for C++11. It provides a declarative way to manage resources through dependency injection. - Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. + Copyright (C) 2012-2016 Leap Motion, Inc. All rights reserved. en-US c++ ioc concurrent c++11 @@ -18,27 +18,18 @@ - - - - - - - - - @@ -189,4 +180,4 @@ - \ No newline at end of file + diff --git a/src/autowiring/C++11/boost_atomic.h b/src/autowiring/C++11/boost_atomic.h deleted file mode 100644 index 02ef8a6ca..000000000 --- a/src/autowiring/C++11/boost_atomic.h +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. -#pragma once - -#include -namespace std { - using autoboost::atomic; - using autoboost::atomic_flag; - using autoboost::atomic_thread_fence; - using autoboost::memory_order_relaxed; - using autoboost::memory_order_consume; - using autoboost::memory_order_acquire; - using autoboost::memory_order_release; - using autoboost::memory_order_acq_rel; - using autoboost::memory_order_seq_cst; -#if !defined(ATOMIC_FLAG_INIT) -#define ATOMIC_FLAG_INIT -#endif -} diff --git a/src/autowiring/C++11/boost_mutex.h b/src/autowiring/C++11/boost_mutex.h deleted file mode 100644 index 5cfe59fe9..000000000 --- a/src/autowiring/C++11/boost_mutex.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. -#pragma once - -#include -#include -#include -#include -#include -#include - -namespace std { - using autoboost::mutex; - using autoboost::recursive_mutex; - using autoboost::lock_guard; - using autoboost::unique_lock; - using autoboost::condition_variable; - using autoboost::condition_variable_any; - using autoboost::cv_status; - using autoboost::once_flag; - using autoboost::call_once; -} diff --git a/src/autowiring/C++11/boost_rvalue.h b/src/autowiring/C++11/boost_rvalue.h deleted file mode 100644 index a815e38fa..000000000 --- a/src/autowiring/C++11/boost_rvalue.h +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. -#pragma once - -#include - -namespace std { - using autoboost::forward; - using autoboost::move; -} diff --git a/src/autowiring/C++11/boost_system_error.h b/src/autowiring/C++11/boost_system_error.h deleted file mode 100644 index 564000dc2..000000000 --- a/src/autowiring/C++11/boost_system_error.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. -#pragma once - -#include -#include - -namespace std { - using autoboost::system::error_category; - using autoboost::system::generic_category; - using autoboost::system::system_error; - - using autoboost::system::is_error_code_enum; - - namespace errc { - using autoboost::system::errc::make_error_code; - } -} diff --git a/src/autowiring/C++11/boost_thread.h b/src/autowiring/C++11/boost_thread.h deleted file mode 100644 index 740b71ded..000000000 --- a/src/autowiring/C++11/boost_thread.h +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. -#pragma once - -#include - -namespace std { - using autoboost::thread; - namespace this_thread = autoboost::this_thread; -} diff --git a/src/autowiring/C++11/boost_tuple.h b/src/autowiring/C++11/boost_tuple.h deleted file mode 100644 index ae9befb3d..000000000 --- a/src/autowiring/C++11/boost_tuple.h +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. -#pragma once - -#include -#include - -namespace std { - template - class tuple; - - template - class tuple { - public: - tuple(void) {} - tuple(const T& ele, const Ts&... eles): - m_tuple(ele, eles...) - {} - virtual ~tuple(void){} - - tuple& operator=(const tuple& other) { - m_tuple = other.m_tuple; - return *this; - } - - template - tuple& operator=(const tuple& other) { - m_tuple = other; - return *this; - } - - bool operator==(const tuple& other) const { - return m_tuple == other.m_tuple; - } - - bool operator<(const tuple& other) const { - return m_tuple < other.m_tuple; - } - - autoboost::tuple m_tuple; - }; - - template<> - class tuple<> { - public: - tuple(void) {} - virtual ~tuple(void){} - - tuple& operator=(const tuple<>& other) { - return *this; - } - - bool operator==(const tuple<>& other) const { - return true; - } - - bool operator<(const tuple<>& other) const { - return false; - } - - autoboost::tuple<> m_tuple; - }; - - template - ::std::tuple tie(const Ts&... val) { - return ::std::tuple(val...) ; - } - - template - auto get(const ::std::tuple& tup) -> decltype(autoboost::get(tup.m_tuple)) { - return autoboost::get(tup.m_tuple); - } - - template - ::std::tuple make_tuple(const Ts&... ele) { - return ::std::tuple(ele...); - } - -}//namespace std diff --git a/src/autowiring/C++11/boost_utility.h b/src/autowiring/C++11/boost_utility.h deleted file mode 100644 index f3c482b21..000000000 --- a/src/autowiring/C++11/boost_utility.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. -#pragma once - -#include - -namespace std { - using autoboost::declval; -} diff --git a/src/autowiring/C++11/type_index.h b/src/autowiring/C++11/type_index.h deleted file mode 100644 index 8d7639358..000000000 --- a/src/autowiring/C++11/type_index.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. -#pragma once - -#include TYPE_TRAITS_HEADER -#include -#include - -namespace std { - -class type_index { -public: - type_index(const type_info& info): - _info(&info) - {} - - bool operator==(const type_index& rhs) const { - return *_info == *rhs._info; - } - - bool operator<(const type_index& rhs) const { - return (_info->before(*rhs._info) != 0); - } - - bool operator!=(const type_index& rhs) const { - return !operator==(rhs); - } - - size_t hash_code() const { - return (size_t)_info; - } - - const char* name() const { - return _info->name(); - } - -private: - const type_info* _info; - -}; - -namespace tr1 { - template<> - struct hash: - public std::unary_function - { - size_t operator()(std::type_index val) const { - return val.hash_code(); - } - }; -} - -}; diff --git a/src/autowiring/CMakeLists.txt b/src/autowiring/CMakeLists.txt index 19739ee38..9fa5b809f 100644 --- a/src/autowiring/CMakeLists.txt +++ b/src/autowiring/CMakeLists.txt @@ -177,28 +177,19 @@ add_conditional_sources( GROUP_NAME "C++11" FILES C++11/boost_array.h - C++11/boost_atomic.h C++11/boost_chrono.h C++11/boost_exception_ptr.h C++11/boost_functional.h C++11/boost_future.h - C++11/boost_mutex.h - C++11/boost_rvalue.h C++11/boost_shared_ptr.h - C++11/boost_system_error.h - C++11/boost_thread.h - C++11/boost_tuple.h C++11/boost_type_traits.h - C++11/boost_utility.h C++11/chrono_with_profiling_clock.h C++11/cpp11.h - C++11/empty_file.h C++11/filesystem.h C++11/make_unique.h C++11/memory.h C++11/memory_nostl11.h C++11/mutex.h - C++11/type_index.h C++11/unique_ptr.h ) From d34824231a5e35a9822d7596a2f77660a8823752 Mon Sep 17 00:00:00 2001 From: James Donald Date: Wed, 21 Sep 2016 12:59:29 -0700 Subject: [PATCH 10/14] Remove another STL11_ALLOWED and thus boost_chrono.h --- Autowiring.nuspec.in | 1 - src/autowiring/C++11/boost_chrono.h | 10 ---------- src/autowiring/C++11/chrono_with_profiling_clock.h | 6 +----- src/autowiring/CMakeLists.txt | 1 - 4 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 src/autowiring/C++11/boost_chrono.h diff --git a/Autowiring.nuspec.in b/Autowiring.nuspec.in index c0f19336a..f1e2f2cc3 100644 --- a/Autowiring.nuspec.in +++ b/Autowiring.nuspec.in @@ -18,7 +18,6 @@ - diff --git a/src/autowiring/C++11/boost_chrono.h b/src/autowiring/C++11/boost_chrono.h deleted file mode 100644 index 728a2f445..000000000 --- a/src/autowiring/C++11/boost_chrono.h +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. -#pragma once - -#include - -namespace std { - namespace chrono { - using namespace autoboost::chrono; - } -} diff --git a/src/autowiring/C++11/chrono_with_profiling_clock.h b/src/autowiring/C++11/chrono_with_profiling_clock.h index 4cab446e2..997d222de 100644 --- a/src/autowiring/C++11/chrono_with_profiling_clock.h +++ b/src/autowiring/C++11/chrono_with_profiling_clock.h @@ -1,11 +1,7 @@ // Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. #pragma once -#if STL11_ALLOWED - #include -#else - #include -#endif +#include // This solution taken from http://stackoverflow.com/questions/8386128/how-to-get-the-precision-of-high-resolution-clock // Hopefully it will be able to be depricated when VS2015 hits. diff --git a/src/autowiring/CMakeLists.txt b/src/autowiring/CMakeLists.txt index 9fa5b809f..3655fcce1 100644 --- a/src/autowiring/CMakeLists.txt +++ b/src/autowiring/CMakeLists.txt @@ -177,7 +177,6 @@ add_conditional_sources( GROUP_NAME "C++11" FILES C++11/boost_array.h - C++11/boost_chrono.h C++11/boost_exception_ptr.h C++11/boost_functional.h C++11/boost_future.h From 06790c4229e652cf23942a031d0b12f3d8fbd2c7 Mon Sep 17 00:00:00 2001 From: James Donald Date: Wed, 21 Sep 2016 13:02:12 -0700 Subject: [PATCH 11/14] Remove obsolete line now that we never use Boost.Thread --- src/autowiring/C++11/cpp11.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/autowiring/C++11/cpp11.h b/src/autowiring/C++11/cpp11.h index f54dec538..c6a3aedd6 100644 --- a/src/autowiring/C++11/cpp11.h +++ b/src/autowiring/C++11/cpp11.h @@ -14,9 +14,6 @@ #error Autowiring is not supported on clang 3.5 or older #endif -// If Boost.Thread is used, we want it to provide the new name for its class -#define BOOST_THREAD_PROVIDES_FUTURE - #ifdef AUTOWIRING_IS_BEING_BUILT // We know that we're using deprecated stuff in our unit tests, but the tests still // need to do what they do. Undefine all of the deprecated macros so we don't get From b40aba75157208feb76b5e68fbdd7a5f3fb53a91 Mon Sep 17 00:00:00 2001 From: James Donald Date: Wed, 21 Sep 2016 15:09:30 -0700 Subject: [PATCH 12/14] Make the copyright check more lenient for now --- scripts/copyright_check.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/copyright_check.sh b/scripts/copyright_check.sh index f311e4a62..348398076 100755 --- a/scripts/copyright_check.sh +++ b/scripts/copyright_check.sh @@ -5,12 +5,13 @@ # ENFORCED_FILES="examples src" -COPYRIGHT_HEADER="// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved." +COPYRIGHT_HEADER="// Copyright (C) 2012-2016 Leap Motion, Inc. All rights reserved." +COPYRIGHT_HEADER_FALLBACK="// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved." # Go to root directory for f in $(find $ENFORCED_FILES -name *.hpp -o -name *.cpp -o -name *.h); do - if [ "$(head -n 1 $f)" != "$COPYRIGHT_HEADER" ]; + if [ "$(head -n 1 $f)" != "$COPYRIGHT_HEADER" ] && [ "$(head -n 1 $f)" != "$COPYRIGHT_HEADER_FALLBACK" ]; then if [ "$BAD_FILES" == "" ] then From 0e89ab8a896db477f802b3b924e4f1a43fb78ee6 Mon Sep 17 00:00:00 2001 From: James Donald Date: Tue, 27 Sep 2016 14:44:33 -0700 Subject: [PATCH 13/14] Fix a stray git diff resolve line --- scripts/copyright_check.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/copyright_check.sh b/scripts/copyright_check.sh index 3be1f56c8..ff07040b2 100755 --- a/scripts/copyright_check.sh +++ b/scripts/copyright_check.sh @@ -6,7 +6,6 @@ ENFORCED_FILES="examples src" COPYRIGHT_HEADER="// Copyright (C) 2012-2016 Leap Motion, Inc. All rights reserved." ->>>>>>> origin/master # Go to root directory for f in $(find $ENFORCED_FILES -name *.hpp -o -name *.cpp -o -name *.h); From 876bc7afed451fd0f1eba52be44041044d051906 Mon Sep 17 00:00:00 2001 From: James Donald Date: Wed, 28 Sep 2016 19:40:58 -0700 Subject: [PATCH 14/14] Remove deprecated STL11_ALLOWED macro --- src/autowiring/C++11/cpp11.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/autowiring/C++11/cpp11.h b/src/autowiring/C++11/cpp11.h index c6a3aedd6..981d313e4 100644 --- a/src/autowiring/C++11/cpp11.h +++ b/src/autowiring/C++11/cpp11.h @@ -4,8 +4,6 @@ // The reason this header exists is due to the asymmetric availability of C++11 on our // various compiler targets. -#define STL11_ALLOWED 1 - #define IS_CLANG defined(__clang_major__) #define CLANG_CHECK(maj, min) (__clang_major__ == maj && __clang_minor__ >= min || __clang_major__ > maj) #define GCC_CHECK(maj, min) (__GNUC__ == maj && __GNUC_MINOR__ >= min || __GNUC__ > maj)