Merge branch 'hotfix/C++03_compatibility' into development

This commit is contained in:
John Wellbelove 2020-03-20 20:00:05 +00:00
commit ed57e8a8f5
9 changed files with 45 additions and 14 deletions

View File

@ -0,0 +1,4 @@
Objects/
RTE/
Listings/
DebugConfig/

View File

@ -10,7 +10,7 @@
<TargetName>Target 1</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>6130001::V6.13.1::.\ARMCLANG</pCCUsed>
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>
@ -336,7 +336,7 @@
<v6Rtti>0</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define>ETL_NO_STL __STDC_LIMIT_MACROS</Define>
<Define>__STDC_LIMIT_MACROS</Define>
<Undefine></Undefine>
<IncludePath>..\..\include;..\ArmTimerCallbacks - C++</IncludePath>
</VariousControls>

View File

@ -8,7 +8,7 @@
#define ETL_IVECTOR_REPAIR_ENABLE
#define ETL_IDEQUE_REPAIR_ENABLE
#define ETL_CALLBACK_TIMER_USE_ATOMIC_LOCK
//#define ETL_NO_STL
#define ETL_NO_STL
#include "etl/profiles/auto.h"

View File

@ -336,7 +336,7 @@ namespace etl
TIterator2 move_backward(TIterator1 sb, TIterator1 se, TIterator2 de)
{
// Move not supported. Defer to copy_backward.
return std::copy_backward(sb, se, de);
return ETL_OR_STD::copy_backward(sb, se, de);
}
#endif
@ -648,7 +648,13 @@ namespace etl
template<typename TIterator, typename TSize, typename TValue>
TIterator fill_n(TIterator first, TSize count, const TValue& value)
{
return std::fill_n(first, count, value);;
#if ETL_CPP11_SUPPORTED
return std::fill_n(first, count, value);
#else
std::fill_n(first, count, value);
std::advance(first, count);
return first;
#endif
}
#endif
@ -929,7 +935,6 @@ namespace etl
}
#endif
#if defined (ETL_NO_STL)
//***************************************************************************
// Heap
namespace private_heap
@ -1001,6 +1006,7 @@ namespace etl
}
}
#if defined (ETL_NO_STL)
// Pop Heap
template <typename TIterator, typename TCompare>
void pop_heap(TIterator first, TIterator last, TCompare compare)
@ -1166,7 +1172,11 @@ namespace etl
ETL_NODISCARD
bool is_heap(TIterator first, TIterator last, TCompare compare)
{
#if ETL_CPP11_SUPPORTED
return std::is_heap(first, last, compare);
#else
return private_heap::is_heap(first, last - first, compare());
#endif
}
// Is Heap
@ -1174,7 +1184,12 @@ namespace etl
ETL_NODISCARD
bool is_heap(TIterator first, TIterator last)
{
#if ETL_CPP11_SUPPORTED
return std::is_heap(first, last);
#else
typedef etl::less<typename etl::iterator_traits<TIterator>::value_type> compare;
return private_heap::is_heap(first, last - first, compare());
#endif
}
// Sort Heap

View File

@ -473,7 +473,7 @@ namespace etl
TOutputIterator uninitialized_move(TInputIterator i_begin, TInputIterator i_end, TOutputIterator o_begin)
{
// Move not supported. Defer to copy.
return std::uninitialized_copy(i_begin, i_end, o_begin);
return ETL_OR_STD::uninitialized_copy(i_begin, i_end, o_begin);
}
//*****************************************************************************
@ -488,7 +488,7 @@ namespace etl
count += int32_t(etl::distance(i_begin, i_end));
// Move not supported. Defer to copy.
return std::uninitialized_copy(i_begin, i_end, o_begin);
return ETL_OR_STD::uninitialized_copy(i_begin, i_end, o_begin);
}
#endif
@ -594,11 +594,15 @@ namespace etl
/// https://en.cppreference.com/w/cpp/memory/uninitialized_move_n
///\ingroup memory
//*****************************************************************************
template <typename TInputIterator, typename TOutputIterator>
template <typename TInputIterator, typename TSize, typename TOutputIterator>
TOutputIterator uninitialized_move_n(TInputIterator i_begin, TSize n, TOutputIterator o_begin)
{
// Move not supported. Defer to copy.
#if ETL_CPP11_SUPPORTED
return std::uninitialized_copy_n(i_begin, n, o_begin);
#else
return etl::uninitialized_copy_n(i_begin, n, o_begin);
#endif
}
//*****************************************************************************
@ -607,13 +611,17 @@ namespace etl
/// https://en.cppreference.com/w/cpp/memory/uninitialized_move
///\ingroup memory
//*****************************************************************************
template <typename TInputIterator, typename TOutputIterator, typename TCounter>
template <typename TInputIterator, typename TSize, typename TOutputIterator, typename TCounter>
TOutputIterator uninitialized_move_n(TInputIterator i_begin, TSize n, TOutputIterator o_begin, TCounter& count)
{
count += TCounter(n);
// Move not supported. Defer to copy.
#if ETL_CPP11_SUPPORTED
return std::uninitialized_copy_n(i_begin, n, o_begin);
#else
return etl::uninitialized_copy_n(i_begin, n, o_begin);
#endif
}
#endif

View File

@ -35,7 +35,11 @@ SOFTWARE.
#include "type_traits.h"
#if !defined(ETL_NO_STL)
#include <utility>
#if ETL_CPP11_SUPPORTED
#include <utility>
#else
#include <algorithm>
#endif
#endif
///\defgroup utility utility

View File

@ -39,7 +39,7 @@ SOFTWARE.
#define ETL_VERSION_MAJOR 16
#define ETL_VERSION_MINOR 7
#define ETL_VERSION_PATCH 0
#define ETL_VERSION_PATCH 1
#define ETL_VERSION ETL_STRINGIFY(ETL_VERSION_MAJOR) "." ETL_STRINGIFY(ETL_VERSION_MINOR) "." ETL_STRINGIFY(ETL_VERSION_PATCH)
#define ETL_VERSION_W ETL_STRINGIFY(ETL_VERSION_MAJOR) L"." ETL_STRINGIFY(ETL_VERSION_MINOR) L"." ETL_STRINGIFY(ETL_VERSION_PATCH)
#define ETL_VERSION_U16 ETL_STRINGIFY(ETL_VERSION_MAJOR) u"." ETL_STRINGIFY(ETL_VERSION_MINOR) u"." ETL_STRINGIFY(ETL_VERSION_PATCH)

View File

@ -1,6 +1,6 @@
{
"name": "Embedded Template Library",
"version": "16.7.0",
"version": "16.7.1",
"authors": {
"name": "John Wellbelove",
"email": "john.wellbelove@etlcpp.com"

View File

@ -1,5 +1,5 @@
name=Embedded Template Library
version=16.7.0
version=16.7.1
author= John Wellbelove <john.wellbelove@etlcpp.com>
maintainer=John Wellbelove <john.wellbelove@etlcpp.com>
license=MIT