mirror of
https://github.com/ETLCPP/etl.git
synced 2026-11-09 14:49:53 +08:00
Merge remote-tracking branch 'origin/feature/min-max' into development
This commit is contained in:
commit
7eb8f4b10d
@ -55,13 +55,7 @@ SOFTWARE.
|
||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
#endif
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#endif
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef max
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
//*****************************************************************************
|
||||
///\defgroup basic_string basic_string
|
||||
@ -2234,13 +2228,7 @@ namespace etl
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
|
||||
@ -46,9 +46,7 @@ SOFTWARE.
|
||||
#include "integral_limits.h"
|
||||
#include "binary.h"
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
#include "error_handler.h"
|
||||
|
||||
@ -1018,8 +1016,6 @@ void swap(etl::bitset<MAXN>& lhs, etl::bitset<MAXN>& rhs)
|
||||
lhs.swap(rhs);
|
||||
}
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#endif
|
||||
|
||||
@ -39,9 +39,7 @@ SOFTWARE.
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
#if defined(ETL_COMPILER_MICROSOFT)
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
@ -227,8 +225,6 @@ namespace etl
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(ETL_COMPILER_MICROSOFT)
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#endif
|
||||
|
||||
@ -52,9 +52,7 @@ SOFTWARE.
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "1"
|
||||
@ -2194,8 +2192,6 @@ bool operator >=(const etl::ideque<T>& lhs, const etl::ideque<T>& rhs)
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#endif
|
||||
|
||||
@ -50,9 +50,7 @@ SOFTWARE.
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "6"
|
||||
@ -1536,9 +1534,7 @@ bool operator >=(const etl::iforward_list<T>& lhs, const etl::iforward_list<T>&
|
||||
return !(lhs < rhs);
|
||||
}
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
|
||||
@ -66,9 +66,7 @@ SOFTWARE.
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "34"
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef max
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
@ -1215,8 +1213,6 @@ namespace etl
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#endif
|
||||
|
||||
@ -78,9 +78,7 @@ cog.outl("//********************************************************************
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "34"
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef max
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
@ -538,8 +536,6 @@ namespace etl
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#endif
|
||||
|
||||
@ -37,10 +37,7 @@ SOFTWARE.
|
||||
#include "platform.h"
|
||||
#include "type_traits.h"
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#undef max
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
//*****************************************************************************
|
||||
///\defgroup integral_limits integral_limits
|
||||
@ -213,9 +210,6 @@ namespace etl
|
||||
};
|
||||
}
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#endif
|
||||
|
||||
@ -33,9 +33,7 @@ SOFTWARE.
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
#include <iterator>
|
||||
#include <algorithm>
|
||||
@ -1046,9 +1044,7 @@ namespace etl
|
||||
};
|
||||
}
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
|
||||
@ -33,9 +33,7 @@ SOFTWARE.
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
#include <iterator>
|
||||
#include <algorithm>
|
||||
@ -1078,9 +1076,7 @@ namespace etl
|
||||
};
|
||||
}
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
|
||||
@ -51,9 +51,7 @@ SOFTWARE.
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "7"
|
||||
@ -1768,9 +1766,7 @@ bool operator >=(const etl::ilist<T>& lhs, const etl::ilist<T>& rhs)
|
||||
}
|
||||
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
|
||||
@ -51,9 +51,7 @@ SOFTWARE.
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "8"
|
||||
@ -2186,9 +2184,7 @@ bool operator >=(const etl::imap<TKey, TMapped, TKeyCompare>& lhs, const etl::im
|
||||
return !(lhs < rhs);
|
||||
}
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
|
||||
@ -50,9 +50,7 @@ SOFTWARE.
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "9"
|
||||
@ -2071,9 +2069,7 @@ bool operator >=(const etl::imultimap<TKey, TMapped, TKeyCompare>& lhs, const et
|
||||
return !(lhs < rhs);
|
||||
}
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
|
||||
@ -50,9 +50,7 @@ SOFTWARE.
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "10"
|
||||
@ -2051,9 +2049,7 @@ bool operator >=(const etl::imultiset<T, TCompare>& lhs, const etl::imultiset<T,
|
||||
return !(lhs < rhs);
|
||||
}
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
|
||||
@ -28,9 +28,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_SPSC_QUEUE_FREERTOS__
|
||||
#define __ETL_SPSC_QUEUE_FREERTOS__
|
||||
/*
|
||||
* The header include guard has been intentionally omitted.
|
||||
* This file is intended to evaluated multiple times by design.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#pragma pop_macro("min")
|
||||
#pragma pop_macro("max")
|
||||
#endif
|
||||
41
include/etl/private/minmax_push.h
Normal file
41
include/etl/private/minmax_push.h
Normal file
@ -0,0 +1,41 @@
|
||||
///\file
|
||||
|
||||
/******************************************************************************
|
||||
The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
https://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2018 jwellbelove
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files(the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions :
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* The header include guard has been intentionally omitted.
|
||||
* This file is intended to evaluated multiple times by design.
|
||||
*/
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#pragma push_macro("min")
|
||||
#pragma push_macro("max")
|
||||
#undef min
|
||||
#undef max
|
||||
#endif
|
||||
@ -48,9 +48,7 @@ SOFTWARE.
|
||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
#endif
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#endif
|
||||
#include "minmax_push.h"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
@ -594,9 +592,7 @@ namespace etl
|
||||
bool operator >=(const etl::pvoidvector& lhs, const etl::pvoidvector& rhs);
|
||||
}
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "minmax_pop.h"
|
||||
|
||||
#undef ETL_IN_PVOIDVECTOR
|
||||
|
||||
|
||||
@ -50,9 +50,7 @@ SOFTWARE.
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "14"
|
||||
@ -2109,9 +2107,7 @@ bool operator >=(const etl::iset<T, TCompare>& lhs, const etl::iset<T, TCompare>
|
||||
return !(lhs < rhs);
|
||||
}
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
|
||||
@ -49,10 +49,7 @@ SOFTWARE.
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "42"
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#undef max
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
@ -864,10 +861,7 @@ void swap(etl::basic_string_view<T, TTraits>& lhs, etl::basic_string_view<T, TTr
|
||||
lhs.swap(rhs);
|
||||
}
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
|
||||
@ -39,9 +39,7 @@ SOFTWARE.
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
#if defined(ETL_COMPILER_MICROSOFT)
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
@ -231,8 +229,6 @@ namespace etl
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(ETL_COMPILER_MICROSOFT)
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#endif
|
||||
|
||||
@ -39,9 +39,7 @@ SOFTWARE.
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
#if defined(ETL_COMPILER_MICROSOFT)
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
@ -231,8 +229,6 @@ namespace etl
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(ETL_COMPILER_MICROSOFT)
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#endif
|
||||
|
||||
@ -39,9 +39,7 @@ SOFTWARE.
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
#if defined(ETL_COMPILER_MICROSOFT)
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
@ -232,8 +230,6 @@ namespace etl
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(ETL_COMPILER_MICROSOFT)
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#endif
|
||||
|
||||
@ -36,8 +36,6 @@ SOFTWARE.
|
||||
#include "fnv_1.h"
|
||||
#include "integral_limits.h"
|
||||
|
||||
#undef max
|
||||
|
||||
// Count bits the easy way.
|
||||
template <typename T>
|
||||
size_t test_count(T value)
|
||||
|
||||
@ -34,9 +34,6 @@ SOFTWARE.
|
||||
|
||||
#include "bitset.h"
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
namespace
|
||||
{
|
||||
SUITE(test_bitset)
|
||||
|
||||
@ -28,8 +28,6 @@ SOFTWARE.
|
||||
|
||||
#include "UnitTest++.h"
|
||||
|
||||
#undef max
|
||||
|
||||
#include "constant.h"
|
||||
#include "integral_limits.h"
|
||||
|
||||
|
||||
@ -34,9 +34,6 @@ SOFTWARE.
|
||||
|
||||
#include "integral_limits.h"
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
namespace
|
||||
{
|
||||
SUITE(test_integral_limits)
|
||||
|
||||
@ -35,8 +35,6 @@ SOFTWARE.
|
||||
#include "cstring.h"
|
||||
#include "fnv_1.h"
|
||||
|
||||
#undef min
|
||||
|
||||
#undef STR
|
||||
#define STR(x) x
|
||||
|
||||
|
||||
@ -34,8 +34,6 @@ SOFTWARE.
|
||||
|
||||
#include "u16string.h"
|
||||
|
||||
#undef min
|
||||
|
||||
#undef STR
|
||||
#define STR(x) u##x
|
||||
|
||||
|
||||
@ -34,8 +34,6 @@ SOFTWARE.
|
||||
|
||||
#include "u32string.h"
|
||||
|
||||
#undef min
|
||||
|
||||
#undef STR
|
||||
#define STR(x) U##x
|
||||
|
||||
|
||||
@ -34,8 +34,6 @@ SOFTWARE.
|
||||
|
||||
#include "wstring.h"
|
||||
|
||||
#undef min
|
||||
|
||||
#undef STR
|
||||
#define STR(x) L##x
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user