From d6f8b693269389e9e3fb748b85374844d3529227 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Fri, 27 Dec 2019 12:57:34 +0000 Subject: [PATCH] Merge remote-tracking branch 'origin/feature/determine_compiler_versions' into development # Conflicts: # examples/ArmTimerCallbacks - C++/ArmTimerCallbacks.uvprojx # examples/ArmTimerCallbacks - C++/main.cpp # include/etl/algorithm.h # include/etl/platform.h # include/etl/stl/alternate/limits.h # include/etl/version.h # library.json # library.properties # support/Release notes.txt # test/codeblocks/ETL.cbp # test/etl_profile.h # test/vs2017/etl.vcxproj # test/vs2017/etl.vcxproj.filters --- .../ArmTimerCallbacks.uvoptx | 2 +- .../ArmTimerCallbacks.uvprojx | 10 +- .../ArmTimerCallbacks - C++/etl_profile.h | 18 +- examples/ArmTimerCallbacks - C++/main.cpp | 9 - include/etl/algorithm.h | 3 +- include/etl/alignment.h | 4 + include/etl/callback_timer.h | 54 ++--- include/etl/platform.h | 24 +-- .../ecl_user.h => include/etl/profiles/auto.h | 24 +-- include/etl/profiles/auto_no_stl.h | 37 ++++ include/etl/profiles/determine_compiler.h | 121 +++++++++++ .../determine_compiler_language_support.h | 58 ++++++ .../etl/profiles/determine_compiler_version.h | 71 +++++++ include/etl/stl/alternate/algorithm.h | 4 +- include/etl/stl/alternate/limits.h | 189 +++++++++--------- include/etl/type_traits.h | 27 +-- include/etl/type_traits_generator.h | 17 +- include/etl/version.h | 4 +- library.json | 2 +- library.properties | 2 +- support/Release notes.txt | 7 + test/codeblocks/ETL.cbp | 62 +++--- test/etl_profile.h | 12 +- test/test_binary.cpp | 1 + test/vs2017/etl.vcxproj | 12 +- test/vs2017/etl.vcxproj.filters | 12 ++ 26 files changed, 545 insertions(+), 241 deletions(-) rename test/ecl_user.h => include/etl/profiles/auto.h (63%) create mode 100644 include/etl/profiles/auto_no_stl.h create mode 100644 include/etl/profiles/determine_compiler.h create mode 100644 include/etl/profiles/determine_compiler_language_support.h create mode 100644 include/etl/profiles/determine_compiler_version.h diff --git a/examples/ArmTimerCallbacks - C++/ArmTimerCallbacks.uvoptx b/examples/ArmTimerCallbacks - C++/ArmTimerCallbacks.uvoptx index 0315aa0b..52e14341 100644 --- a/examples/ArmTimerCallbacks - C++/ArmTimerCallbacks.uvoptx +++ b/examples/ArmTimerCallbacks - C++/ArmTimerCallbacks.uvoptx @@ -140,7 +140,7 @@ 0 ST-LINKIII-KEIL_SWO - -U066CFF485550707267024134 -O207 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P2 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_512.FLM -FS08000000 -FL080000 -FP0($$Device:STM32F401RETx$CMSIS\Flash\STM32F4xx_512.FLM) + -U066CFF485550707267024134 -O207 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P2 -N00("ARM CoreSight SW-DP (ARM Core") -D00(2BA01477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_512.FLM -FS08000000 -FL080000 -FP0($$Device:STM32F401RETx$CMSIS\Flash\STM32F4xx_512.FLM) 0 diff --git a/examples/ArmTimerCallbacks - C++/ArmTimerCallbacks.uvprojx b/examples/ArmTimerCallbacks - C++/ArmTimerCallbacks.uvprojx index 04579270..f89a79e0 100644 --- a/examples/ArmTimerCallbacks - C++/ArmTimerCallbacks.uvprojx +++ b/examples/ArmTimerCallbacks - C++/ArmTimerCallbacks.uvprojx @@ -10,8 +10,8 @@ Target 1 0x4 ARM-ADS - 5060750::V5.06 update 6 (build 750)::ARMCC - 0 + 6130001::V6.13.1::.\ARMCLANG + 1 STM32F401RETx @@ -312,7 +312,7 @@ 1 - 1 + 7 0 0 1 @@ -321,7 +321,7 @@ 1 0 0 - 2 + 3 0 0 1 @@ -336,7 +336,7 @@ 0 - + ETL_NO_STL __STDC_LIMIT_MACROS ..\..\include;..\ArmTimerCallbacks - C++ diff --git a/examples/ArmTimerCallbacks - C++/etl_profile.h b/examples/ArmTimerCallbacks - C++/etl_profile.h index 6362a416..fe7052fb 100644 --- a/examples/ArmTimerCallbacks - C++/etl_profile.h +++ b/examples/ArmTimerCallbacks - C++/etl_profile.h @@ -8,22 +8,8 @@ #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 -#if (__CC_ARM == 1) - // ARM5 compiler - #if defined(ETL_NO_STL) - #include "etl/profiles/armv5_no_stl.h" - #else - #include "etl/profiles/armv5.h" - #endif -#else - // ARM6 compiler - #if defined(ETL_NO_STL) - #include "etl/profiles/armv6_no_stl.h" - #else - #include "etl/profiles/armv6.h" - #endif -#endif +#include "etl/profiles/auto.h" #endif diff --git a/examples/ArmTimerCallbacks - C++/main.cpp b/examples/ArmTimerCallbacks - C++/main.cpp index 4c525f4a..7f002981 100644 --- a/examples/ArmTimerCallbacks - C++/main.cpp +++ b/examples/ArmTimerCallbacks - C++/main.cpp @@ -18,8 +18,6 @@ extern "C" #include "etl/vector.h" #include "etl/iterator.h" -static bool b = etl::is_input_iterator::value; - struct FP { void (*function)(); @@ -33,7 +31,6 @@ void register_poweroff_callback(void (*function)()) power_callbacks.push_back(fp); } - const int N_TIMERS = 4; etl::callback_timer callback_timer; @@ -130,12 +127,6 @@ int main() LED_Initialize(); Buttons_Initialize(); - - long int v = __cplusplus; - - char16_t c16; - - int* p = nullptr; // The LEDs will start flashing fast after 2 seconds. // After another 5 seconds they will start flashing slower. diff --git a/include/etl/algorithm.h b/include/etl/algorithm.h index 7c36bd9e..690a802b 100644 --- a/include/etl/algorithm.h +++ b/include/etl/algorithm.h @@ -46,6 +46,7 @@ SOFTWARE. #include "platform.h" #include "iterator.h" #include "type_traits.h" +#include "container.h" namespace etl { @@ -1180,7 +1181,7 @@ namespace etl { for (TIterator itr = first; itr != last; ++itr) { - ETL_STD::rotate(ETL_STD::upper_bound(first, itr, *itr, compare), itr, ETL_STD::next(itr)); + ETL_STD::rotate(ETL_STD::upper_bound(first, itr, *itr, compare), itr, etl::next(itr)); } } diff --git a/include/etl/alignment.h b/include/etl/alignment.h index 8b308cb6..b2e53866 100644 --- a/include/etl/alignment.h +++ b/include/etl/alignment.h @@ -180,11 +180,15 @@ namespace etl return reinterpret_cast(data); } +#if ETL_CPP11_SUPPORTED + alignas(ALIGNMENT) char data[LENGTH]; +#else union { char data[LENGTH]; typename etl::type_with_alignment::type etl_alignment_type; // A POD type that has the same alignment as ALIGNMENT. }; +#endif }; }; diff --git a/include/etl/callback_timer.h b/include/etl/callback_timer.h index 282fa863..487f5789 100644 --- a/include/etl/callback_timer.h +++ b/include/etl/callback_timer.h @@ -446,38 +446,38 @@ namespace etl return id; } - //******************************************* - /// Register a timer. - //******************************************* + //******************************************* + /// Register a timer. + //******************************************* #if ETL_CPP11_SUPPORTED - etl::timer::id::type register_timer(etl::delegate& callback_, - uint32_t period_, - bool repeating_) - { - etl::timer::id::type id = etl::timer::id::NO_TIMER; + etl::timer::id::type register_timer(etl::delegate& callback_, + uint32_t period_, + bool repeating_) + { + etl::timer::id::type id = etl::timer::id::NO_TIMER; - bool is_space = (registered_timers < MAX_TIMERS); + bool is_space = (registered_timers < MAX_TIMERS); - if (is_space) - { - // Search for the free space. - for (uint_least8_t i = 0; i < MAX_TIMERS; ++i) - { - etl::callback_timer_data& timer = timer_array[i]; + if (is_space) + { + // Search for the free space. + for (uint_least8_t i = 0; i < MAX_TIMERS; ++i) + { + etl::callback_timer_data& timer = timer_array[i]; - if (timer.id == etl::timer::id::NO_TIMER) - { - // Create in-place. - new (&timer) callback_timer_data(i, callback_, period_, repeating_); - ++registered_timers; - id = i; - break; - } - } - } + if (timer.id == etl::timer::id::NO_TIMER) + { + // Create in-place. + new (&timer) callback_timer_data(i, callback_, period_, repeating_); + ++registered_timers; + id = i; + break; + } + } + } - return id; - } + return id; + } #endif //******************************************* diff --git a/include/etl/platform.h b/include/etl/platform.h index 7d6186e4..c2e9cd14 100644 --- a/include/etl/platform.h +++ b/include/etl/platform.h @@ -38,8 +38,10 @@ SOFTWARE. #define ETL_8BIT_SUPPORT (CHAR_BIT == 8) // Define a debug macro -#if defined(_DEBUG) || defined(DEBUG) -#define ETL_DEBUG +#if !defined(ETL_DEBUG) + #if defined(_DEBUG) || defined(DEBUG) + #define ETL_DEBUG + #endif #endif // Undefine all of the macros. @@ -62,25 +64,23 @@ SOFTWARE. #include "etl_profile.h" -// The macros below are dependent on the profile. - -#if defined(ETL_COMPILER_GCC) - #define ETL_COMPILER_VERSION __GNUC__ - #define ETL_COMPILER_FULL_VERSION ((__GNUC__ * 10000) + (__GNUC_MINOR__ * 100) + __GNUC_PATCHLEVEL__) -#elif defined(ETL_COMPILER_MICROSOFT) - #define ETL_COMPILER_VERSION _MSC_VER - #define ETL_COMPILER_FULL_VERSION _MSC_FULL_VER +#if defined(ETL_AUTO_DETERMINE_COMPILER_INFO) + // Figure out things about the compiler. + #include "profiles/determine_compiler.h" + #include "profiles/determine_compiler_version.h" + #include "profiles/determine_compiler_language_support.h" #endif +// The macros below are dependent on the profile. #if ETL_CPP11_SUPPORTED #define ETL_CONSTEXPR constexpr - #define ETL_CONST constexpr + #define ETL_CONST_OR_CONSTEXPR constexpr #define ETL_DELETE = delete #define ETL_NOEXCEPT noexcept #define ETL_NOEXCEPT_EXPR(expression) noexcept(expression) #else #define ETL_CONSTEXPR - #define ETL_CONST const + #define ETL_CONST_OR_CONSTEXPR const #define ETL_DELETE #define ETL_NOEXCEPT #define ETL_NOEXCEPT_EXPR(expression) diff --git a/test/ecl_user.h b/include/etl/profiles/auto.h similarity index 63% rename from test/ecl_user.h rename to include/etl/profiles/auto.h index cc2c8f03..48cb7cc8 100644 --- a/test/ecl_user.h +++ b/include/etl/profiles/auto.h @@ -1,3 +1,5 @@ +///\file + /****************************************************************************** The MIT License(MIT) @@ -5,7 +7,7 @@ Embedded Template Library. https://github.com/ETLCPP/etl https://www.etlcpp.com -Copyright(c) 2017 jwellbelove +Copyright(c) 2019 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 @@ -26,23 +28,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************************/ -#ifndef ECL_USER_INCLUDED -#define ECL_USER_INCLUDED +#ifndef ETL_AUTO_PROFILE_INCLUDED +#define ETL_AUTO_PROFILE_INCLUDED -#include - -extern uint32_t timer_semaphore; - -#if defined(_MSC_VER) - #include - - #define ECL_TIMER_DISABLE_PROCESSING InterlockedIncrement((volatile long*)&timer_semaphore) - #define ECL_TIMER_ENABLE_PROCESSING InterlockedDecrement((volatile long*)&timer_semaphore) - #define ECL_TIMER_PROCESSING_ENABLED (InterlockedAdd((volatile long*)&timer_semaphore, 0) == 0) -#else - #define ECL_TIMER_DISABLE_PROCESSING __sync_fetch_and_add(&timer_semaphore, 1) - #define ECL_TIMER_ENABLE_PROCESSING __sync_fetch_and_sub(&timer_semaphore, 1) - #define ECL_TIMER_PROCESSING_ENABLED (__sync_fetch_and_add(&timer_semaphore, 0) == 0) -#endif +#define ETL_AUTO_DETERMINE_COMPILER_INFO #endif diff --git a/include/etl/profiles/auto_no_stl.h b/include/etl/profiles/auto_no_stl.h new file mode 100644 index 00000000..3ccafcfc --- /dev/null +++ b/include/etl/profiles/auto_no_stl.h @@ -0,0 +1,37 @@ +///\file + +/****************************************************************************** +The MIT License(MIT) + +Embedded Template Library. +https://github.com/ETLCPP/etl +https://www.etlcpp.com + +Copyright(c) 2019 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. +******************************************************************************/ + +#ifndef ETL_AUTO_NO_STL_INCLUDED +#define ETL_AUTO_NO_STL_INCLUDED + +#define ETL_AUTO_DETERMINE_COMPILER_INFO +#define ETL_NO_STL + +#endif diff --git a/include/etl/profiles/determine_compiler.h b/include/etl/profiles/determine_compiler.h new file mode 100644 index 00000000..26665bf2 --- /dev/null +++ b/include/etl/profiles/determine_compiler.h @@ -0,0 +1,121 @@ +///\file + +/****************************************************************************** +The MIT License(MIT) + +Embedded Template Library. +https://github.com/ETLCPP/etl +https://www.etlcpp.com + +Copyright(c) 2019 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. +******************************************************************************/ + +#ifndef ETL_DETERMINE_COMPILER_H_INCLUDED +#define ETL_DETERMINE_COMPILER_H_INCLUDED + +#if !defined(ETL_COMPILER_GCC) && \ + !defined(ETL_COMPILER_MICROSOFT) && \ + !defined(ETL_COMPILER_ARM5) && \ + !defined(ETL_COMPILER_ARM6) && \ + !defined(ETL_COMPILER_ARM7) && \ + !defined(ETL_COMPILER_CLANG) && \ + !defined(ETL_COMPILER_GREEN_HILLS) && \ + !defined(ETL_COMPILER_IAR) && \ + !defined(ETL_COMPILER_INTEL) && \ + !defined(ETL_COMPILER_TEXAS_INSTRUMENTS) && \ + !defined(ETL_COMPILER_GENERIC) + + #if !defined(ETL_COMPILER_TYPE_DETECTED) && !defined(ETL_COMPILER_ARM5) + #if defined(__CC_ARM) + #define ETL_COMPILER_ARM5 + #define ETL_COMPILER_TYPE_DETECTED + #endif + #endif + + #if !defined(ETL_COMPILER_TYPE_DETECTED) && !defined(ETL_COMPILER_ARM6) + #if defined(__ARMCOMPILER_VERSION) && (__ARMCOMPILER_VERSION >= 6000000L) && (__ARMCOMPILER_VERSION < 7000000L) + #define ETL_COMPILER_ARM6 + #define ETL_COMPILER_TYPE_DETECTED + #endif + #endif + + #if !defined(ETL_COMPILER_TYPE_DETECTED) && !defined(ETL_COMPILER_ARM7) + #if defined(__ARMCOMPILER_VERSION) && (__ARMCOMPILER_VERSION >= 7000000L) && (__ARMCOMPILER_VERSION < 8000000L) + #define ETL_COMPILER_ARM7 + #define ETL_COMPILER_TYPE_DETECTED + #endif + #endif + + #if !defined(ETL_COMPILER_TYPE_DETECTED) && !defined(ETL_COMPILER_GCC) + #if defined(__GNUC__) + #define ETL_COMPILER_GCC + #define ETL_COMPILER_TYPE_DETECTED + #endif + #endif + + #if !defined(ETL_COMPILER_TYPE_DETECTED) && !defined(ETL_COMPILER_CLANG) + #if defined(__clang__) || defined(__llvm__) + #define ETL_COMPILER_CLANG + #define ETL_COMPILER_TYPE_DETECTED + #endif + #endif + + #if !defined(ETL_COMPILER_TYPE_DETECTED) && !defined(ETL_COMPILER_GREEN_HILLS) + #if defined(__ghs__) + #define ETL_COMPILER_GREEN_HILLS + #define ETL_COMPILER_TYPE_DETECTED + #endif + #endif + + #if !defined(ETL_COMPILER_TYPE_DETECTED) && !defined(ETL_COMPILER_IAR) + #if defined(__IAR_SYSTEMS_ICC__) + #define ETL_COMPILER_IAR + #define ETL_COMPILER_TYPE_DETECTED + #endif + #endif + + #if !defined(ETL_COMPILER_TYPE_DETECTED) && !defined(ETL_COMPILER_INTEL) + #if defined(__INTEL_COMPILER) + #define ETL_COMPILER_INTEL + #define ETL_COMPILER_TYPE_DETECTED + #endif + #endif + + #if !defined(ETL_COMPILER_TYPE_DETECTED) && !defined(ETL_COMPILER_TEXAS_INSTRUMENTS) + #if defined(__TI_COMPILER_VERSION__) + #define ETL_COMPILER_TEXAS_INSTRUMENTS + #define ETL_COMPILER_TYPE_DETECTED + #endif + #endif + + #if !defined(ETL_COMPILER_TYPE_DETECTED) && !defined(ETL_COMPILER_MICROSOFT) + #if defined(_MSC_VER) + #define ETL_COMPILER_MICROSOFT + #define ETL_COMPILER_TYPE_DETECTED + #endif + #endif + + #if !defined(ETL_COMPILER_TYPE_DETECTED) + #define ETL_COMPILER_GENERIC + #endif +#endif + +#endif diff --git a/include/etl/profiles/determine_compiler_language_support.h b/include/etl/profiles/determine_compiler_language_support.h new file mode 100644 index 00000000..836b9116 --- /dev/null +++ b/include/etl/profiles/determine_compiler_language_support.h @@ -0,0 +1,58 @@ +///\file + +/****************************************************************************** +The MIT License(MIT) + +Embedded Template Library. +https://github.com/ETLCPP/etl +https://www.etlcpp.com + +Copyright(c) 2019 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. +******************************************************************************/ + +#ifndef ETL_DETERMINE_COMPILER_LANGUAGE_SUPPORT_H_INCLUDED +#define ETL_DETERMINE_COMPILER_LANGUAGE_SUPPORT_H_INCLUDED + +#ifdef __cplusplus + #if defined(ETL_COMPILER_MICROSOFT) + #define ETL_CPP11_SUPPORTED (_MSC_VER >= 1600) + #define ETL_CPP14_SUPPORTED (_MSC_VER >= 1900) + #define ETL_CPP17_SUPPORTED (_MSC_VER >= 1914) + #elif defined(ETL_COMPILER_ARM5) + #define ETL_CPP11_SUPPORTED 0 + #define ETL_CPP14_SUPPORTED 0 + #define ETL_CPP17_SUPPORTED 0 + #else + #define ETL_CPP11_SUPPORTED (__cplusplus >= 201103L) + #define ETL_CPP14_SUPPORTED (__cplusplus >= 201402L) + #define ETL_CPP17_SUPPORTED (__cplusplus >= 201703L) + #endif +#else + #define ETL_CPP11_SUPPORTED 0 + #define ETL_CPP14_SUPPORTED 0 + #define ETL_CPP17_SUPPORTED 0 +#endif + +#define ETL_NO_NULLPTR_SUPPORT !ETL_CPP11_SUPPORTED +#define ETL_NO_LARGE_CHAR_SUPPORT !ETL_CPP11_SUPPORTED +#define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED ETL_CPP14_SUPPORTED + +#endif diff --git a/include/etl/profiles/determine_compiler_version.h b/include/etl/profiles/determine_compiler_version.h new file mode 100644 index 00000000..38af2b18 --- /dev/null +++ b/include/etl/profiles/determine_compiler_version.h @@ -0,0 +1,71 @@ +///\file + +/****************************************************************************** +The MIT License(MIT) + +Embedded Template Library. +https://github.com/ETLCPP/etl +https://www.etlcpp.com + +Copyright(c) 2019 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. +******************************************************************************/ + +#ifndef ETL_DETERMINE_COMPILER_VERSION_H_INCLUDED +#define ETL_DETERMINE_COMPILER_VERSION_H_INCLUDED + +#if !defined(ETL_COMPILER_VERSION) && !defined(ETL_COMPILER_FULL_VERSION) + #if defined(ETL_COMPILER_GCC) + #define ETL_COMPILER_VERSION __GNUC__ + #define ETL_COMPILER_FULL_VERSION ((__GNUC__ * 10000) + (__GNUC_MINOR__ * 100) + __GNUC_PATCHLEVEL__) + #elif defined(ETL_COMPILER_MICROSOFT) + #define ETL_COMPILER_VERSION _MSC_VER + #define ETL_COMPILER_FULL_VERSION _MSC_FULL_VER + #elif defined(ETL_COMPILER_ARM5) + #define ETL_COMPILER_VERSION __ARMCC_VERSION + #define ETL_COMPILER_FULL_VERSION __ARMCC_VERSION + #elif defined(ETL_COMPILER_ARM6) + #define ETL_COMPILER_VERSION __ARMCOMPILER_VERSION + #define ETL_COMPILER_FULL_VERSION __ARMCOMPILER_VERSION + #elif defined(ETL_COMPILER_ARM7) + #define ETL_COMPILER_VERSION __ARMCOMPILER_VERSION + #define ETL_COMPILER_FULL_VERSION __ARMCOMPILER_VERSION + #elif defined(ETL_COMPILER_CLANG) + #define ETL_COMPILER_VERSION __clang_version__ + #define ETL_COMPILER_FULL_VERSION ((__clang_major__ * 10000) + (__clang_minor__ * 100) + __clang_patchlevel__) + #elif defined(ETL_COMPILER_GREEN_HILLS) + #define ETL_COMPILER_VERSION __GHS_VERSION_NUMBER__ + #define ETL_COMPILER_FULL_VERSION __GHS_VERSION_NUMBER__ + #elif defined(ETL_COMPILER_IAR) + #define ETL_COMPILER_VERSION __VER__ + #define ETL_COMPILER_FULL_VERSION __VER__ + #elif defined(ETL_COMPILER_INTEL) + #define ETL_COMPILER_VERSION __INTEL_COMPILER + #define ETL_COMPILER_FULL_VERSION __INTEL_COMPILER + #elif defined(ETL_COMPILER_TEXAS_INSTRUMENTS) + #define ETL_COMPILER_VERSION __TI_COMPILER_VERSION__ + #define ETL_COMPILER_FULL_VERSION __TI_COMPILER_VERSION__ + #else + #define ETL_COMPILER_VERSION 0 + #define ETL_COMPILER_FULL_VERSION 0 + #endif +#endif + +#endif diff --git a/include/etl/stl/alternate/algorithm.h b/include/etl/stl/alternate/algorithm.h index 7b693abc..e9c880f5 100644 --- a/include/etl/stl/alternate/algorithm.h +++ b/include/etl/stl/alternate/algorithm.h @@ -114,7 +114,7 @@ namespace etlstd difference_t count = (se - sb); - return TIterator2(memcpy(db, sb, sizeof(value_t) * count)) + count; + return TIterator2(memmove(db, sb, sizeof(value_t) * count)) + count; } // Other iterator @@ -156,7 +156,7 @@ namespace etlstd { typedef typename etlstd::iterator_traits::value_type value_t; - return TIterator2(memcpy(db, sb, sizeof(value_t) * count)) + count; + return TIterator2(memmove(db, sb, sizeof(value_t) * count)) + count; } // Other iterator diff --git a/include/etl/stl/alternate/limits.h b/include/etl/stl/alternate/limits.h index ec8df96a..2b73be81 100644 --- a/include/etl/stl/alternate/limits.h +++ b/include/etl/stl/alternate/limits.h @@ -71,45 +71,45 @@ namespace etlstd class etl_integral_type { public: - static ETL_CONST bool is_specialized = true; + static ETL_CONST_OR_CONSTEXPR bool is_specialized = true; - static ETL_CONST int max_digits10 = 0; + static ETL_CONST_OR_CONSTEXPR int max_digits10 = 0; - static ETL_CONST bool is_integer = true; - static ETL_CONST bool is_exact = true; + static ETL_CONST_OR_CONSTEXPR bool is_integer = true; + static ETL_CONST_OR_CONSTEXPR bool is_exact = true; - static ETL_CONST int radix = 2; + static ETL_CONST_OR_CONSTEXPR int radix = 2; static ETL_CONSTEXPR T epsilon() { return 0; } static ETL_CONSTEXPR T round_error() { return 0; } - static ETL_CONST int digits = (CHAR_BIT * sizeof(T)) - (etl::is_signed::value ? 1 : 0); - static ETL_CONST int digits10 = ETL_LOG2(digits); + static ETL_CONST_OR_CONSTEXPR int digits = (CHAR_BIT * sizeof(T)) - (etl::is_signed::value ? 1 : 0); + static ETL_CONST_OR_CONSTEXPR int digits10 = ETL_LOG2(digits); - static ETL_CONST bool is_signed = etl::is_signed::value; + static ETL_CONST_OR_CONSTEXPR bool is_signed = etl::is_signed::value; - static ETL_CONST int min_exponent = 0; - static ETL_CONST int min_exponent10 = 0; - static ETL_CONST int max_exponent = 0; - static ETL_CONST int max_exponent10 = 0; + static ETL_CONST_OR_CONSTEXPR int min_exponent = 0; + static ETL_CONST_OR_CONSTEXPR int min_exponent10 = 0; + static ETL_CONST_OR_CONSTEXPR int max_exponent = 0; + static ETL_CONST_OR_CONSTEXPR int max_exponent10 = 0; - static ETL_CONST bool has_infinity = false; - static ETL_CONST bool has_quiet_NaN = false; - static ETL_CONST bool has_signaling_NaN = false; - static ETL_CONST float_denorm_style has_denorm = denorm_absent; - static ETL_CONST bool has_denorm_loss = false; + static ETL_CONST_OR_CONSTEXPR bool has_infinity = false; + static ETL_CONST_OR_CONSTEXPR bool has_quiet_NaN = false; + static ETL_CONST_OR_CONSTEXPR bool has_signaling_NaN = false; + static ETL_CONST_OR_CONSTEXPR float_denorm_style has_denorm = denorm_absent; + static ETL_CONST_OR_CONSTEXPR bool has_denorm_loss = false; static ETL_CONSTEXPR T infinity() { return 0; } static ETL_CONSTEXPR T quiet_NaN() { return 0; } static ETL_CONSTEXPR T signaling_NaN() { return 0; } static ETL_CONSTEXPR T denorm_min() { return 0; } - static ETL_CONST bool is_iec559 = false; - static ETL_CONST bool is_bounded = true; - static ETL_CONST bool is_modulo = etl::is_unsigned::value; + static ETL_CONST_OR_CONSTEXPR bool is_iec559 = false; + static ETL_CONST_OR_CONSTEXPR bool is_bounded = true; + static ETL_CONST_OR_CONSTEXPR bool is_modulo = etl::is_unsigned::value; - static ETL_CONST bool traps = false; - static ETL_CONST bool tinyness_before = false; - static ETL_CONST float_round_style round_style = round_toward_zero; + static ETL_CONST_OR_CONSTEXPR bool traps = false; + static ETL_CONST_OR_CONSTEXPR bool tinyness_before = false; + static ETL_CONST_OR_CONSTEXPR float_round_style round_style = round_toward_zero; }; //*************************************************************************** @@ -118,39 +118,48 @@ namespace etlstd class etl_floating_point_type { public: - static ETL_CONST bool is_specialized = true; + static ETL_CONST_OR_CONSTEXPR bool is_specialized = true; - static ETL_CONST bool is_signed = true; - static ETL_CONST bool is_integer = false; - static ETL_CONST bool is_exact = false; + static ETL_CONST_OR_CONSTEXPR bool is_signed = true; + static ETL_CONST_OR_CONSTEXPR bool is_integer = false; + static ETL_CONST_OR_CONSTEXPR bool is_exact = false; - static ETL_CONST int radix = 2; + static ETL_CONST_OR_CONSTEXPR int radix = 2; - static ETL_CONST bool has_infinity = false; - static ETL_CONST bool has_quiet_NaN = false; - static ETL_CONST bool has_signaling_NaN = false; - static ETL_CONST float_denorm_style has_denorm = denorm_present; - static ETL_CONST bool has_denorm_loss = true; + static ETL_CONST_OR_CONSTEXPR bool has_infinity = false; + static ETL_CONST_OR_CONSTEXPR bool has_quiet_NaN = false; + static ETL_CONST_OR_CONSTEXPR bool has_signaling_NaN = false; + static ETL_CONST_OR_CONSTEXPR float_denorm_style has_denorm = denorm_present; + static ETL_CONST_OR_CONSTEXPR bool has_denorm_loss = true; - static ETL_CONST bool is_iec559 = true; - static ETL_CONST bool is_bounded = true; - static ETL_CONST bool is_modulo = false; + static ETL_CONST_OR_CONSTEXPR bool is_iec559 = true; + static ETL_CONST_OR_CONSTEXPR bool is_bounded = true; + static ETL_CONST_OR_CONSTEXPR bool is_modulo = false; static ETL_CONSTEXPR T round_error() { return T(0.5); } static ETL_CONSTEXPR T infinity() { return 0; } static ETL_CONSTEXPR T quiet_NaN() { return 0; } static ETL_CONSTEXPR T signaling_NaN() { return 0; } - static ETL_CONST bool traps = false; - static ETL_CONST bool tinyness_before = true; - static ETL_CONST float_round_style round_style = round_to_nearest; + static ETL_CONST_OR_CONSTEXPR bool traps = false; + static ETL_CONST_OR_CONSTEXPR bool tinyness_before = true; + static ETL_CONST_OR_CONSTEXPR float_round_style round_style = round_to_nearest; }; //*************************************************************************** // Default - template + template class numeric_limits; + template + class numeric_limits : public numeric_limits { }; + + template + class numeric_limits : public numeric_limits { }; + + template + class numeric_limits : public numeric_limits { }; + //*************************************************************************** // bool template<> @@ -158,47 +167,47 @@ namespace etlstd { public: - static ETL_CONST bool is_specialized = true; + static ETL_CONST_OR_CONSTEXPR bool is_specialized = true; static ETL_CONSTEXPR bool min() { return false; } static ETL_CONSTEXPR bool max() { return true; } static ETL_CONSTEXPR bool lowest() { return false; } - static ETL_CONST int digits = 1; - static ETL_CONST int digits10 = 0; - static ETL_CONST int max_digits10 = 0; + static ETL_CONST_OR_CONSTEXPR int digits = 1; + static ETL_CONST_OR_CONSTEXPR int digits10 = 0; + static ETL_CONST_OR_CONSTEXPR int max_digits10 = 0; - static ETL_CONST bool is_signed = false; - static ETL_CONST bool is_integer = true; - static ETL_CONST bool is_exact = true; + static ETL_CONST_OR_CONSTEXPR bool is_signed = false; + static ETL_CONST_OR_CONSTEXPR bool is_integer = true; + static ETL_CONST_OR_CONSTEXPR bool is_exact = true; - static ETL_CONST int radix = 2; - static ETL_CONST bool epsilon() { return 0; } - static ETL_CONST bool round_error() { return 0; } + static ETL_CONST_OR_CONSTEXPR int radix = 2; + static ETL_CONST_OR_CONSTEXPR bool epsilon() { return false; } + static ETL_CONST_OR_CONSTEXPR bool round_error() { return false; } - static ETL_CONST int min_exponent = 0; - static ETL_CONST int min_exponent10 = 0; - static ETL_CONST int max_exponent = 0; - static ETL_CONST int max_exponent10 = 0; + static ETL_CONST_OR_CONSTEXPR int min_exponent = 0; + static ETL_CONST_OR_CONSTEXPR int min_exponent10 = 0; + static ETL_CONST_OR_CONSTEXPR int max_exponent = 0; + static ETL_CONST_OR_CONSTEXPR int max_exponent10 = 0; - static ETL_CONST bool has_infinity = false; - static ETL_CONST bool has_quiet_NaN = false; - static ETL_CONST bool has_signaling_NaN = false; - static ETL_CONST float_denorm_style has_denorm = denorm_absent; - static ETL_CONST bool has_denorm_loss = false; + static ETL_CONST_OR_CONSTEXPR bool has_infinity = false; + static ETL_CONST_OR_CONSTEXPR bool has_quiet_NaN = false; + static ETL_CONST_OR_CONSTEXPR bool has_signaling_NaN = false; + static ETL_CONST_OR_CONSTEXPR float_denorm_style has_denorm = denorm_absent; + static ETL_CONST_OR_CONSTEXPR bool has_denorm_loss = false; - static ETL_CONSTEXPR bool infinity() { return 0; } - static ETL_CONSTEXPR bool quiet_NaN() { return 0; } - static ETL_CONSTEXPR bool signaling_NaN() { return 0; } - static ETL_CONSTEXPR bool denorm_min() { return 0; } + static ETL_CONSTEXPR bool infinity() { return false; } + static ETL_CONSTEXPR bool quiet_NaN() { return false; } + static ETL_CONSTEXPR bool signaling_NaN() { return false; } + static ETL_CONSTEXPR bool denorm_min() { return false; } - static ETL_CONST bool is_iec559 = false; - static ETL_CONST bool is_bounded = true; - static ETL_CONST bool is_modulo = false; + static ETL_CONST_OR_CONSTEXPR bool is_iec559 = false; + static ETL_CONST_OR_CONSTEXPR bool is_bounded = true; + static ETL_CONST_OR_CONSTEXPR bool is_modulo = false; - static ETL_CONST bool traps = false; - static ETL_CONST bool tinyness_before = false; - static ETL_CONST float_round_style round_style = round_toward_zero; + static ETL_CONST_OR_CONSTEXPR bool traps = false; + static ETL_CONST_OR_CONSTEXPR bool tinyness_before = false; + static ETL_CONST_OR_CONSTEXPR float_round_style round_style = round_toward_zero; }; //*************************************************************************** @@ -384,14 +393,14 @@ namespace etlstd static ETL_CONSTEXPR float epsilon() { return FLT_EPSILON; } static ETL_CONSTEXPR float denorm_min() { return FLT_MIN; } - static ETL_CONST int digits = FLT_MANT_DIG; - static ETL_CONST int digits10 = FLT_DIG; - static ETL_CONST int max_digits10 = ETL_LOG2(FLT_MANT_DIG) + 2; + static ETL_CONST_OR_CONSTEXPR int digits = FLT_MANT_DIG; + static ETL_CONST_OR_CONSTEXPR int digits10 = FLT_DIG; + static ETL_CONST_OR_CONSTEXPR int max_digits10 = ETL_LOG2(FLT_MANT_DIG) + 2; - static ETL_CONST int min_exponent = FLT_MIN_EXP; - static ETL_CONST int min_exponent10 = FLT_MIN_10_EXP; - static ETL_CONST int max_exponent = FLT_MAX_EXP; - static ETL_CONST int max_exponent10 = FLT_MAX_10_EXP; + static ETL_CONST_OR_CONSTEXPR int min_exponent = FLT_MIN_EXP; + static ETL_CONST_OR_CONSTEXPR int min_exponent10 = FLT_MIN_10_EXP; + static ETL_CONST_OR_CONSTEXPR int max_exponent = FLT_MAX_EXP; + static ETL_CONST_OR_CONSTEXPR int max_exponent10 = FLT_MAX_10_EXP; }; //*************************************************************************** @@ -407,14 +416,14 @@ namespace etlstd static ETL_CONSTEXPR double epsilon() { return DBL_EPSILON; } static ETL_CONSTEXPR double denorm_min() { return DBL_MIN; } - static ETL_CONST int digits = DBL_MANT_DIG; - static ETL_CONST int digits10 = DBL_DIG; - static ETL_CONST int max_digits10 = ETL_LOG2(DBL_MANT_DIG) + 2; + static ETL_CONST_OR_CONSTEXPR int digits = DBL_MANT_DIG; + static ETL_CONST_OR_CONSTEXPR int digits10 = DBL_DIG; + static ETL_CONST_OR_CONSTEXPR int max_digits10 = ETL_LOG2(DBL_MANT_DIG) + 2; - static ETL_CONST int min_exponent = DBL_MIN_EXP; - static ETL_CONST int min_exponent10 = DBL_MIN_10_EXP; - static ETL_CONST int max_exponent = DBL_MAX_EXP; - static ETL_CONST int max_exponent10 = DBL_MAX_10_EXP; + static ETL_CONST_OR_CONSTEXPR int min_exponent = DBL_MIN_EXP; + static ETL_CONST_OR_CONSTEXPR int min_exponent10 = DBL_MIN_10_EXP; + static ETL_CONST_OR_CONSTEXPR int max_exponent = DBL_MAX_EXP; + static ETL_CONST_OR_CONSTEXPR int max_exponent10 = DBL_MAX_10_EXP; }; //*************************************************************************** @@ -430,14 +439,14 @@ namespace etlstd static ETL_CONSTEXPR long double epsilon() { return LDBL_EPSILON; } static ETL_CONSTEXPR long double denorm_min() { return LDBL_MIN; } - static ETL_CONST int digits = LDBL_MANT_DIG; - static ETL_CONST int digits10 = LDBL_DIG; - static ETL_CONST int max_digits10 = ETL_LOG2(LDBL_MANT_DIG) + 2; + static ETL_CONST_OR_CONSTEXPR int digits = LDBL_MANT_DIG; + static ETL_CONST_OR_CONSTEXPR int digits10 = LDBL_DIG; + static ETL_CONST_OR_CONSTEXPR int max_digits10 = ETL_LOG2(LDBL_MANT_DIG) + 2; - static ETL_CONST int min_exponent = LDBL_MIN_EXP; - static ETL_CONST int min_exponent10 = LDBL_MIN_10_EXP; - static ETL_CONST int max_exponent = LDBL_MAX_EXP; - static ETL_CONST int max_exponent10 = LDBL_MAX_10_EXP; + static ETL_CONST_OR_CONSTEXPR int min_exponent = LDBL_MIN_EXP; + static ETL_CONST_OR_CONSTEXPR int min_exponent10 = LDBL_MIN_10_EXP; + static ETL_CONST_OR_CONSTEXPR int max_exponent = LDBL_MAX_EXP; + static ETL_CONST_OR_CONSTEXPR int max_exponent10 = LDBL_MAX_10_EXP; }; } diff --git a/include/etl/type_traits.h b/include/etl/type_traits.h index d01e2084..ebd296b8 100644 --- a/include/etl/type_traits.h +++ b/include/etl/type_traits.h @@ -482,15 +482,16 @@ namespace etl /// Alignment templates. /// These require compiler specific intrinsics. ///\ingroup type_traits -#ifdef ETL_COMPILER_MICROSOFT - template struct alignment_of : integral_constant {}; - -#elif defined(ETL_COMPILER_IAR) || defined(ETL_COMPILER_TI) - template struct alignment_of : integral_constant {}; - +#if ETL_CPP11_SUPPORTED + template struct alignment_of : integral_constant {}; #else - template struct alignment_of : integral_constant {}; - + #ifdef ETL_COMPILER_MICROSOFT + template struct alignment_of : integral_constant {}; + #elif defined(ETL_COMPILER_IAR) || defined(ETL_COMPILER_TI) + template struct alignment_of : integral_constant {}; + #else + template struct alignment_of : integral_constant {}; + #endif #endif /// Specialisation of 'alignment_of' for 'void'. @@ -523,14 +524,14 @@ namespace etl ///\ingroup types //*************************************************************************** template struct is_one_of { - static const bool value = + static const bool value = etl::is_same::value || etl::is_same::value || etl::is_same::value || diff --git a/include/etl/type_traits_generator.h b/include/etl/type_traits_generator.h index c7449af6..f090f469 100644 --- a/include/etl/type_traits_generator.h +++ b/include/etl/type_traits_generator.h @@ -494,15 +494,16 @@ namespace etl /// Alignment templates. /// These require compiler specific intrinsics. ///\ingroup type_traits -#ifdef ETL_COMPILER_MICROSOFT - template struct alignment_of : integral_constant {}; - -#elif defined(ETL_COMPILER_IAR) || defined(ETL_COMPILER_TI) - template struct alignment_of : integral_constant {}; - +#if ETL_CPP11_SUPPORTED + template struct alignment_of : integral_constant {}; #else - template struct alignment_of : integral_constant {}; - + #ifdef ETL_COMPILER_MICROSOFT + template struct alignment_of : integral_constant {}; + #elif defined(ETL_COMPILER_IAR) || defined(ETL_COMPILER_TI) + template struct alignment_of : integral_constant {}; + #else + template struct alignment_of : integral_constant {}; + #endif #endif /// Specialisation of 'alignment_of' for 'void'. diff --git a/include/etl/version.h b/include/etl/version.h index 017c3b33..69cbc002 100644 --- a/include/etl/version.h +++ b/include/etl/version.h @@ -38,8 +38,8 @@ SOFTWARE. ///\ingroup utilities #define ETL_VERSION_MAJOR 15 -#define ETL_VERSION_MINOR 4 -#define ETL_VERSION_PATCH 2 +#define ETL_VERSION_MINOR 5 +#define ETL_VERSION_PATCH 0 #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) diff --git a/library.json b/library.json index 4602fc58..9bcfadfb 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Embedded Template Library", - "version": "15.4.2", + "version": "15.5.0", "authors": { "name": "John Wellbelove", "email": "" diff --git a/library.properties b/library.properties index e73a128f..84d0db75 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Embedded Template Library -version=15.4.2 +version=15.5.0 author= John Wellbelove maintainer=John Wellbelove license=MIT diff --git a/support/Release notes.txt b/support/Release notes.txt index dedbee68..742a4cdd 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,10 @@ +=============================================================================== +15.5.0 +Added the ability to self determine the compiler type, version and language support +by defining ETL_AUTO_DETERMINE_COMPILER_INFO or including the 'auto.h' profile. +Added support for C++11's 'alignas' and 'alignof' +Changed 'memcpy' to 'memmove' in alternate STL algorithms. + =============================================================================== 15.4.2 Fix visitor overridden test virtual visit function parameters diff --git a/test/codeblocks/ETL.cbp b/test/codeblocks/ETL.cbp index 35dc8529..7221311a 100644 --- a/test/codeblocks/ETL.cbp +++ b/test/codeblocks/ETL.cbp @@ -28,18 +28,35 @@ + + - - - - - + + - @@ -300,10 +295,21 @@ + + + + + + + + + + + @@ -321,6 +327,8 @@ + + diff --git a/test/etl_profile.h b/test/etl_profile.h index 02690eab..66a7cb46 100644 --- a/test/etl_profile.h +++ b/test/etl_profile.h @@ -95,10 +95,14 @@ SOFTWARE. #define ETL_TIMER_SEMAPHORE_TYPE uint32_t #endif -#ifdef _MSC_VER - #include "etl/profiles/msvc_x86.h" -#else - #include "etl/profiles/gcc_windows_x86.h" +#if defined(WIN32) || defined(WIN64) || defined(_WIN32) || defined(_WIN64) + #define ETL_TARGET_OS_WINDOWS #endif +#if defined(linux) + #define ETL_TARGET_OS_LINUX +#endif + +#include "etl/profiles/auto.h" + #endif diff --git a/test/test_binary.cpp b/test/test_binary.cpp index 6923a0f7..6c11fcfe 100644 --- a/test/test_binary.cpp +++ b/test/test_binary.cpp @@ -30,6 +30,7 @@ SOFTWARE. #include #include +#include #include "etl/binary.h" #include "etl/bitset.h" diff --git a/test/vs2017/etl.vcxproj b/test/vs2017/etl.vcxproj index 483c5cad..3e2240c0 100644 --- a/test/vs2017/etl.vcxproj +++ b/test/vs2017/etl.vcxproj @@ -342,7 +342,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;__clang__;%(PreprocessorDefinitions) ../../../unittest-cpp/UnitTest++/;../../include;../../include/etl/c;../../test @@ -350,7 +350,7 @@ stdcpp17 false ProgramDatabase - -Wno-self-assign %(AdditionalOptions) + -Wno-self-assign /Zc:__cplusplus %(AdditionalOptions) Console @@ -366,7 +366,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;ETL_NO_STL;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;ETL_NO_STL;__clang__;%(PreprocessorDefinitions) ../../../unittest-cpp/UnitTest++/;../../include;../../include/etl/c;../../test @@ -374,7 +374,7 @@ stdcpp17 false ProgramDatabase - -Wno-self-assign %(AdditionalOptions) + -Wno-self-assign /Zc:__cplusplus %(AdditionalOptions) Console @@ -747,9 +747,13 @@ + + + + diff --git a/test/vs2017/etl.vcxproj.filters b/test/vs2017/etl.vcxproj.filters index 16c1c10c..a467fa68 100644 --- a/test/vs2017/etl.vcxproj.filters +++ b/test/vs2017/etl.vcxproj.filters @@ -846,6 +846,18 @@ ETL\Maths + + ETL\Profiles + + + ETL\Profiles + + + ETL\Profiles + + + ETL\Profiles +