This is an automated email from the ASF dual-hosted git repository. bcall pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push: new a8dc53f Removed internal C++14 and C++17 features in ink_std_compat.h a8dc53f is described below commit a8dc53ff708ddfc51e095919a3c3686927da8297 Author: Bryan Call <bc...@apache.org> AuthorDate: Tue May 15 11:44:28 2018 -0700 Removed internal C++14 and C++17 features in ink_std_compat.h --- CMakeLists.txt | 1 - iocore/hostdb/HostDB.cc | 2 - lib/ts/BufferWriter.h | 1 - lib/ts/BufferWriterForward.h | 1 - lib/ts/Makefile.am | 1 - lib/ts/ink_memory.h | 4 -- lib/ts/ink_std_compat.h | 157 ------------------------------------------- plugins/tcpinfo/tcpinfo.cc | 1 - 8 files changed, 168 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b083bd..5d5929b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1237,7 +1237,6 @@ add_library(libtsutil SHARED lib/ts/ink_sprintf.h lib/ts/ink_stack_trace.cc lib/ts/ink_stack_trace.h - lib/ts/ink_std_compat.h lib/ts/ink_string++.cc lib/ts/ink_string++.h lib/ts/ink_string.cc diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc index b6e3430..237208e 100644 --- a/iocore/hostdb/HostDB.cc +++ b/iocore/hostdb/HostDB.cc @@ -23,8 +23,6 @@ #define _HOSTDB_CC_ -#include "ts/ink_std_compat.h" - #include "P_HostDB.h" #include "P_RefCountCacheSerializer.h" #include "ts/I_Layout.h" diff --git a/lib/ts/BufferWriter.h b/lib/ts/BufferWriter.h index d12d9de..2d92d4d 100644 --- a/lib/ts/BufferWriter.h +++ b/lib/ts/BufferWriter.h @@ -29,7 +29,6 @@ #include <vector> #include <string> #include <iosfwd> -#include <ts/ink_std_compat.h> #include <ts/TextView.h> #include <ts/MemSpan.h> diff --git a/lib/ts/BufferWriterForward.h b/lib/ts/BufferWriterForward.h index 0d50f77..475a7e2 100644 --- a/lib/ts/BufferWriterForward.h +++ b/lib/ts/BufferWriterForward.h @@ -28,7 +28,6 @@ #include <cstring> #include <vector> #include <map> -#include <ts/ink_std_compat.h> #include <ts/TextView.h> #include <ts/ink_assert.h> diff --git a/lib/ts/Makefile.am b/lib/ts/Makefile.am index 0ace85c..746436f 100644 --- a/lib/ts/Makefile.am +++ b/lib/ts/Makefile.am @@ -141,7 +141,6 @@ libtsutil_la_SOURCES = \ ink_sock.h \ ink_sprintf.cc \ ink_sprintf.h \ - ink_std_compat.h \ ink_stack_trace.cc \ ink_stack_trace.h \ ink_string.cc \ diff --git a/lib/ts/ink_memory.h b/lib/ts/ink_memory.h index 42c5518..5ea54d9 100644 --- a/lib/ts/ink_memory.h +++ b/lib/ts/ink_memory.h @@ -31,10 +31,6 @@ #include "ts/string_view.h" #include "ts/ink_config.h" -#ifdef __cplusplus -#include "ink_std_compat.h" -#endif - #if HAVE_UNISTD_H #include <unistd.h> #endif diff --git a/lib/ts/ink_std_compat.h b/lib/ts/ink_std_compat.h deleted file mode 100644 index b7d37a0..0000000 --- a/lib/ts/ink_std_compat.h +++ /dev/null @@ -1,157 +0,0 @@ -/** @file - - Compatibility with future versions of the C++ standard library - - @section license License - - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -#pragma once - -#ifdef __cplusplus -// -#if __cplusplus < 201402L -// -// C++ 14 compatibility -// -#include <memory> -#include <type_traits> - -namespace std -{ -template <typename T, typename... Args> -std::unique_ptr<T> -make_unique(Args &&... args) -{ - return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); -} -// Local implementation of integer sequence templates from <utility> in C++14. -// Drop once we move to C++14. - -template <typename T, T... N> struct integer_sequence { - typedef T value_type; - static_assert(std::is_integral<T>::value, "std::integer_sequence requires an integral type"); - - static inline std::size_t - size() - { - return (sizeof...(N)); - } -}; - -template <std::size_t... N> using index_sequence = integer_sequence<std::size_t, N...>; - -namespace sequence_expander_detail -{ - // Expand a sequence (4 ways) - template <typename T, std::size_t... _Extra> struct seq_expand; - - template <typename T, T... N, std::size_t... _Extra> struct seq_expand<integer_sequence<T, N...>, _Extra...> { - typedef integer_sequence<T, N..., 1 * sizeof...(N) + N..., 2 * sizeof...(N) + N..., 3 * sizeof...(N) + N..., _Extra...> type; - }; - - template <std::size_t N> struct modulus; - template <std::size_t N> struct construct : modulus<N % 4>::template modular_construct<N> { - }; - - // 4 base cases (e.g. modulo 4) - template <> struct construct<0> { - typedef integer_sequence<std::size_t> type; - }; - template <> struct construct<1> { - typedef integer_sequence<std::size_t, 0> type; - }; - template <> struct construct<2> { - typedef integer_sequence<std::size_t, 0, 1> type; - }; - template <> struct construct<3> { - typedef integer_sequence<std::size_t, 0, 1, 2> type; - }; - - // Modulus cases - split 4 ways and pick up the remainder explicitly. - template <> struct modulus<0> { - template <std::size_t N> struct modular_construct : seq_expand<typename construct<N / 4>::type> { - }; - }; - template <> struct modulus<1> { - template <std::size_t N> struct modular_construct : seq_expand<typename construct<N / 4>::type, N - 1> { - }; - }; - template <> struct modulus<2> { - template <std::size_t N> struct modular_construct : seq_expand<typename construct<N / 4>::type, N - 2, N - 1> { - }; - }; - template <> struct modulus<3> { - template <std::size_t N> struct modular_construct : seq_expand<typename construct<N / 4>::type, N - 3, N - 2, N - 1> { - }; - }; - - template <typename T, typename U> struct convert { - template <typename> struct result; - - template <T... N> struct result<integer_sequence<T, N...>> { - typedef integer_sequence<U, N...> type; - }; - }; - - template <typename T> struct convert<T, T> { - template <typename U> struct result { - typedef U type; - }; - }; - - template <typename T, T N> - using make_integer_sequence_unchecked = typename convert<std::size_t, T>::template result<typename construct<N>::type>::type; - - template <typename T, T N> struct make_integer_sequence { - static_assert(std::is_integral<T>::value, "std::make_integer_sequence can only be instantiated with an integral type"); - static_assert(0 <= N, "std::make_integer_sequence input shall not be negative"); - - typedef make_integer_sequence_unchecked<T, N> type; - }; - -} // namespace sequence_expander_detail - -template <typename T, T N> using make_integer_sequence = typename sequence_expander_detail::make_integer_sequence<T, N>::type; - -template <std::size_t N> using make_index_sequence = make_integer_sequence<std::size_t, N>; - -template <typename... T> using index_sequence_for = make_index_sequence<sizeof...(T)>; - -} // namespace std -#endif // C++ 14 compatibility - -// -#if __cplusplus < 201700L -// -// C++ 17 compatibility -// -#include <cassert> -namespace std -{ -template <typename T> -inline const T & -clamp(const T &v, const T &lo, const T &hi) -{ - assert(lo <= hi); - return (v < lo) ? lo : ((hi < v) ? hi : v); -} - -} // namespace std -#endif // C++ 17 compatibility -#endif // __cplusplus diff --git a/plugins/tcpinfo/tcpinfo.cc b/plugins/tcpinfo/tcpinfo.cc index b9ff79b..580b98c 100644 --- a/plugins/tcpinfo/tcpinfo.cc +++ b/plugins/tcpinfo/tcpinfo.cc @@ -40,7 +40,6 @@ #include "ts/ink_defs.h" #include "ts/ParseRules.h" -#include "ts/ink_std_compat.h" #if defined(TCP_INFO) && defined(HAVE_STRUCT_TCP_INFO) #define TCPI_PLUGIN_SUPPORTED 1 -- To stop receiving notification emails like this one, please contact bc...@apache.org.