From d2ba5e99567754ec1ec34cf2e8d9e4488050bf04 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Tue, 14 Dec 2021 10:52:49 +0000 Subject: [PATCH] Multiple code changes, delegates & timers --- include/etl/buffer_descriptors.h | 8 +- include/etl/callback_timer.h | 13 +-- include/etl/callback_timer_atomic.h | 4 - include/etl/callback_timer_locked.h | 7 -- include/etl/crc16.h | 2 +- include/etl/crc16_a.h | 2 +- include/etl/crc16_arc.h | 2 +- include/etl/crc16_aug_ccitt.h | 2 +- include/etl/crc16_buypass.h | 2 +- include/etl/crc16_ccitt.h | 2 +- include/etl/crc16_cdma2000.h | 2 +- include/etl/crc16_dds110.h | 2 +- include/etl/crc16_dectr.h | 2 +- include/etl/crc16_dectx.h | 2 +- include/etl/crc16_dnp.h | 2 +- include/etl/crc16_en13757.h | 2 +- include/etl/crc16_genibus.h | 2 +- include/etl/crc16_kermit.h | 2 +- include/etl/crc16_maxim.h | 2 +- include/etl/crc16_mcrf4xx.h | 2 +- include/etl/crc16_modbus.h | 2 +- include/etl/crc16_profibus.h | 2 +- include/etl/crc16_riello.h | 2 +- include/etl/crc16_t10dif.h | 2 +- include/etl/crc16_teledisk.h | 2 +- include/etl/crc16_tms37157.h | 2 +- include/etl/crc16_usb.h | 2 +- include/etl/crc16_x25.h | 2 +- include/etl/crc8_ccitt.h | 2 +- include/etl/crc8_cdma2000.h | 2 +- include/etl/crc8_darc.h | 2 +- include/etl/crc8_dvbs2.h | 2 +- include/etl/crc8_ebu.h | 2 +- include/etl/crc8_icode.h | 2 +- include/etl/crc8_itu.h | 2 +- include/etl/crc8_maxim.h | 2 +- include/etl/crc8_rohc.h | 2 +- include/etl/crc8_wcdma.h | 2 +- include/etl/delegate.h | 2 +- include/etl/delegate_service.h | 8 +- include/etl/fsm.h | 6 +- include/etl/generators/fsm_generator.h | 6 +- include/etl/generators/largest_generator.h | 6 +- .../etl/generators/message_packet_generator.h | 2 +- .../etl/generators/message_router_generator.h | 2 +- include/etl/generators/smallest_generator.h | 2 +- .../etl/generators/type_lookup_generator.h | 2 +- .../etl/generators/type_select_generator.h | 2 +- include/etl/indirect_vector.h | 2 +- include/etl/largest.h | 6 +- include/etl/mem_cast.h | 2 +- include/etl/memory.h | 4 +- include/etl/message_packet.h | 2 +- include/etl/message_router.h | 2 +- include/etl/message_timer_locked.h | 7 -- include/etl/observer.h | 4 +- include/etl/optional.h | 2 +- include/etl/priority_queue.h | 2 +- include/etl/private/delegate_cpp03.h | 26 +++-- include/etl/private/delegate_cpp11.h | 4 +- include/etl/private/variant_legacy.h | 2 +- include/etl/queue.h | 2 +- include/etl/queue_lockable.h | 10 +- include/etl/queue_mpmc_mutex.h | 8 +- include/etl/queue_spsc_atomic.h | 6 +- include/etl/queue_spsc_isr.h | 8 +- include/etl/queue_spsc_locked.h | 10 +- include/etl/smallest.h | 2 +- include/etl/type_lookup.h | 2 +- include/etl/type_select.h | 2 +- include/etl/vector.h | 2 +- include/etl/visitor.h | 4 +- test/etl_profile.h | 44 ++++----- test/runsanitychecks.sh | 2 + test/runtests.sh | 3 +- test/sanity-check/c++03/etl_profile.h | 42 ++++---- test/sanity-check/c++11/etl_profile.h | 42 ++++---- test/sanity-check/c++14/etl_profile.h | 42 ++++---- test/sanity-check/c++17/etl_profile.h | 42 ++++---- test/test_delegate.cpp | 4 +- test/test_delegate_cpp03.cpp | 96 ++++++++++--------- test/test_delegate_service.cpp | 2 +- test/test_delegate_service_compile_time.cpp | 2 +- test/test_delegate_service_cpp03.cpp | 4 +- test/test_indirect_vector.cpp | 2 +- test/test_largest.cpp | 4 +- test/test_queue_mpmc_mutex.cpp | 2 +- test/test_queue_mpmc_mutex_small.cpp | 2 +- test/test_queue_spsc_atomic.cpp | 2 +- test/test_queue_spsc_atomic_small.cpp | 2 +- test/test_queue_spsc_locked.cpp | 2 +- test/test_queue_spsc_locked_small.cpp | 2 +- test/test_type_lookup.cpp | 18 ++-- test/test_type_select.cpp | 6 +- test/test_vector_non_trivial.cpp | 2 +- test/vs2019/etl.vcxproj | 2 +- 96 files changed, 309 insertions(+), 321 deletions(-) diff --git a/include/etl/buffer_descriptors.h b/include/etl/buffer_descriptors.h index 2b4ba0a4..4c58e407 100644 --- a/include/etl/buffer_descriptors.h +++ b/include/etl/buffer_descriptors.h @@ -196,11 +196,11 @@ namespace etl }; // The type of the callback function. -#if ETL_CPP11_SUPPORTED & !defined(ETL_DELEGATE_FORCE_CPP03) +//#if ETL_CPP11_SUPPORTED & !defined(ETL_DELEGATE_FORCE_CPP03_IMPLEMENTATION) typedef etl::delegate callback_type; -#else - typedef etl::delegate callback_type; -#endif +//#else +// typedef etl::delegate callback_type; +//#endif //********************************* buffer_descriptors(TBuffer* pbuffers_, callback_type callback_ = callback_type()) diff --git a/include/etl/callback_timer.h b/include/etl/callback_timer.h index 16dea466..fcb96f00 100644 --- a/include/etl/callback_timer.h +++ b/include/etl/callback_timer.h @@ -40,10 +40,7 @@ SOFTWARE. #include "atomic.h" #include "error_handler.h" #include "placement_new.h" - -#if ETL_CPP11_SUPPORTED - #include "delegate.h" -#endif +#include "delegate.h" #if defined(ETL_IN_UNIT_TEST) && ETL_NOT_USING_STL #define ETL_DISABLE_TIMER_UPDATES @@ -84,11 +81,7 @@ namespace etl /// The configuration of a timer. struct callback_timer_data { -#if ETL_CPP11_SUPPORTED && !defined(ETL_DELEGATE_FORCE_CPP03) typedef etl::delegate callback_type; -#else - typedef etl::delegate callback_type; -#endif enum callback_type_id { @@ -386,11 +379,7 @@ namespace etl { public: -#if ETL_CPP11_SUPPORTED && !defined(ETL_DELEGATE_FORCE_CPP03) typedef etl::delegate callback_type; -#else - typedef etl::delegate callback_type; -#endif //******************************************* /// Register a timer. diff --git a/include/etl/callback_timer_atomic.h b/include/etl/callback_timer_atomic.h index 938a44ab..9df96bb6 100644 --- a/include/etl/callback_timer_atomic.h +++ b/include/etl/callback_timer_atomic.h @@ -55,11 +55,7 @@ namespace etl { public: -#if ETL_CPP11_SUPPORTED && !defined(ETL_DELEGATE_FORCE_CPP03) typedef etl::delegate callback_type; -#else - typedef etl::delegate callback_type; -#endif //******************************************* /// Register a timer. diff --git a/include/etl/callback_timer_locked.h b/include/etl/callback_timer_locked.h index d7a4912e..c3b2abda 100644 --- a/include/etl/callback_timer_locked.h +++ b/include/etl/callback_timer_locked.h @@ -50,17 +50,10 @@ namespace etl { public: -#if ETL_CPP11_SUPPORTED && !defined(ETL_DELEGATE_FORCE_CPP03) typedef etl::delegate callback_type; typedef etl::delegate try_lock_type; typedef etl::delegate lock_type; typedef etl::delegate unlock_type; -#else - typedef etl::delegate callback_type; - typedef etl::delegate try_lock_type; - typedef etl::delegate lock_type; - typedef etl::delegate unlock_type; -#endif //******************************************* /// Register a timer. diff --git a/include/etl/crc16.h b/include/etl/crc16.h index bbb5b5b4..1e079fb2 100644 --- a/include/etl/crc16.h +++ b/include/etl/crc16.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_t = etl::crc_type; #else diff --git a/include/etl/crc16_a.h b/include/etl/crc16_a.h index be98d3ef..88c619e6 100644 --- a/include/etl/crc16_a.h +++ b/include/etl/crc16_a.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_a_t = etl::crc_type; #else diff --git a/include/etl/crc16_arc.h b/include/etl/crc16_arc.h index 80799617..95722fa0 100644 --- a/include/etl/crc16_arc.h +++ b/include/etl/crc16_arc.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_arc_t = etl::crc_type; #else diff --git a/include/etl/crc16_aug_ccitt.h b/include/etl/crc16_aug_ccitt.h index 807d432f..cb2461d9 100644 --- a/include/etl/crc16_aug_ccitt.h +++ b/include/etl/crc16_aug_ccitt.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_aug_ccitt_t = etl::crc_type; #else diff --git a/include/etl/crc16_buypass.h b/include/etl/crc16_buypass.h index 462a17ce..4b3c902e 100644 --- a/include/etl/crc16_buypass.h +++ b/include/etl/crc16_buypass.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_buypass_t = etl::crc_type; #else diff --git a/include/etl/crc16_ccitt.h b/include/etl/crc16_ccitt.h index 9a444345..12990247 100644 --- a/include/etl/crc16_ccitt.h +++ b/include/etl/crc16_ccitt.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_ccitt_t = etl::crc_type; #else diff --git a/include/etl/crc16_cdma2000.h b/include/etl/crc16_cdma2000.h index 7784c9ae..2d5555bc 100644 --- a/include/etl/crc16_cdma2000.h +++ b/include/etl/crc16_cdma2000.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_cdma2000_t = etl::crc_type; #else diff --git a/include/etl/crc16_dds110.h b/include/etl/crc16_dds110.h index 7a998e66..9fe62906 100644 --- a/include/etl/crc16_dds110.h +++ b/include/etl/crc16_dds110.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_dds110_t = etl::crc_type; #else diff --git a/include/etl/crc16_dectr.h b/include/etl/crc16_dectr.h index 327dfc51..0f2b0c0a 100644 --- a/include/etl/crc16_dectr.h +++ b/include/etl/crc16_dectr.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_dect_r_t = etl::crc_type; #else diff --git a/include/etl/crc16_dectx.h b/include/etl/crc16_dectx.h index a8497d8d..d98babca 100644 --- a/include/etl/crc16_dectx.h +++ b/include/etl/crc16_dectx.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_dect_x_t = etl::crc_type; #else diff --git a/include/etl/crc16_dnp.h b/include/etl/crc16_dnp.h index 02c67c4f..f94cedcc 100644 --- a/include/etl/crc16_dnp.h +++ b/include/etl/crc16_dnp.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_dnp_t = etl::crc_type; #else diff --git a/include/etl/crc16_en13757.h b/include/etl/crc16_en13757.h index d5ec5fed..5dc9c579 100644 --- a/include/etl/crc16_en13757.h +++ b/include/etl/crc16_en13757.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_en13757_t = etl::crc_type; #else diff --git a/include/etl/crc16_genibus.h b/include/etl/crc16_genibus.h index a7cbb382..a46fbc9a 100644 --- a/include/etl/crc16_genibus.h +++ b/include/etl/crc16_genibus.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_genibus_t = etl::crc_type; #else diff --git a/include/etl/crc16_kermit.h b/include/etl/crc16_kermit.h index 66dedb5b..e4399249 100644 --- a/include/etl/crc16_kermit.h +++ b/include/etl/crc16_kermit.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_kermit_t = etl::crc_type; #else diff --git a/include/etl/crc16_maxim.h b/include/etl/crc16_maxim.h index 896ab11d..cbbde8c0 100644 --- a/include/etl/crc16_maxim.h +++ b/include/etl/crc16_maxim.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_maxim_t = etl::crc_type; #else diff --git a/include/etl/crc16_mcrf4xx.h b/include/etl/crc16_mcrf4xx.h index 06a3f890..f3236c89 100644 --- a/include/etl/crc16_mcrf4xx.h +++ b/include/etl/crc16_mcrf4xx.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_mcrf4xx_t = etl::crc_type; #else diff --git a/include/etl/crc16_modbus.h b/include/etl/crc16_modbus.h index 5743ef41..423706ad 100644 --- a/include/etl/crc16_modbus.h +++ b/include/etl/crc16_modbus.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_modbus_t = etl::crc_type; #else diff --git a/include/etl/crc16_profibus.h b/include/etl/crc16_profibus.h index 9b6951c1..4f4a6688 100644 --- a/include/etl/crc16_profibus.h +++ b/include/etl/crc16_profibus.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_profibus_t = etl::crc_type; #else diff --git a/include/etl/crc16_riello.h b/include/etl/crc16_riello.h index ed1332e5..00d718c7 100644 --- a/include/etl/crc16_riello.h +++ b/include/etl/crc16_riello.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_riello_t = etl::crc_type; #else diff --git a/include/etl/crc16_t10dif.h b/include/etl/crc16_t10dif.h index 44e767a8..e9f7fa50 100644 --- a/include/etl/crc16_t10dif.h +++ b/include/etl/crc16_t10dif.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_t10dif_t = etl::crc_type; #else diff --git a/include/etl/crc16_teledisk.h b/include/etl/crc16_teledisk.h index f90d8964..4bcd9974 100644 --- a/include/etl/crc16_teledisk.h +++ b/include/etl/crc16_teledisk.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_teledisk_t = etl::crc_type; #else diff --git a/include/etl/crc16_tms37157.h b/include/etl/crc16_tms37157.h index 31de01c5..01a63bc6 100644 --- a/include/etl/crc16_tms37157.h +++ b/include/etl/crc16_tms37157.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_tms37157_t = etl::crc_type; #else diff --git a/include/etl/crc16_usb.h b/include/etl/crc16_usb.h index bb67e42c..138e9fec 100644 --- a/include/etl/crc16_usb.h +++ b/include/etl/crc16_usb.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_usb_t = etl::crc_type; #else diff --git a/include/etl/crc16_x25.h b/include/etl/crc16_x25.h index 9120a7c2..24a26ce5 100644 --- a/include/etl/crc16_x25.h +++ b/include/etl/crc16_x25.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc16_x25_t = etl::crc_type; #else diff --git a/include/etl/crc8_ccitt.h b/include/etl/crc8_ccitt.h index d95b85c2..2e23e8cc 100644 --- a/include/etl/crc8_ccitt.h +++ b/include/etl/crc8_ccitt.h @@ -36,7 +36,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc8_ccitt_t = etl::crc_type; #else diff --git a/include/etl/crc8_cdma2000.h b/include/etl/crc8_cdma2000.h index f1607e56..c88ba206 100644 --- a/include/etl/crc8_cdma2000.h +++ b/include/etl/crc8_cdma2000.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc8_cdma2000_t = etl::crc_type; #else diff --git a/include/etl/crc8_darc.h b/include/etl/crc8_darc.h index f419a706..480fa22a 100644 --- a/include/etl/crc8_darc.h +++ b/include/etl/crc8_darc.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc8_darc_t = etl::crc_type; #else diff --git a/include/etl/crc8_dvbs2.h b/include/etl/crc8_dvbs2.h index bd55a255..6409c077 100644 --- a/include/etl/crc8_dvbs2.h +++ b/include/etl/crc8_dvbs2.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc8_dvbs2_t = etl::crc_type; #else diff --git a/include/etl/crc8_ebu.h b/include/etl/crc8_ebu.h index 47b4613b..b981a8b8 100644 --- a/include/etl/crc8_ebu.h +++ b/include/etl/crc8_ebu.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc8_ebu_t = etl::crc_type; #else diff --git a/include/etl/crc8_icode.h b/include/etl/crc8_icode.h index e51c6dfb..a02eac60 100644 --- a/include/etl/crc8_icode.h +++ b/include/etl/crc8_icode.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc8_icode_t = etl::crc_type; #else diff --git a/include/etl/crc8_itu.h b/include/etl/crc8_itu.h index f84aa025..df8c00f5 100644 --- a/include/etl/crc8_itu.h +++ b/include/etl/crc8_itu.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc8_itu_t = etl::crc_type; #else diff --git a/include/etl/crc8_maxim.h b/include/etl/crc8_maxim.h index a138657f..b496aa41 100644 --- a/include/etl/crc8_maxim.h +++ b/include/etl/crc8_maxim.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc8_maxim_t = etl::crc_type; #else diff --git a/include/etl/crc8_rohc.h b/include/etl/crc8_rohc.h index 34e61dbe..88a026a1 100644 --- a/include/etl/crc8_rohc.h +++ b/include/etl/crc8_rohc.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc8_rohc_t = etl::crc_type; #else diff --git a/include/etl/crc8_wcdma.h b/include/etl/crc8_wcdma.h index f30d3529..eac133d0 100644 --- a/include/etl/crc8_wcdma.h +++ b/include/etl/crc8_wcdma.h @@ -39,7 +39,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) template using crc8_wcdma_t = etl::crc_type; #else diff --git a/include/etl/delegate.h b/include/etl/delegate.h index 1427f916..3d3357ed 100644 --- a/include/etl/delegate.h +++ b/include/etl/delegate.h @@ -33,7 +33,7 @@ SOFTWARE. #include "platform.h" -#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) #include "private/delegate_cpp11.h" #else #include "private/delegate_cpp03.h" diff --git a/include/etl/delegate_service.h b/include/etl/delegate_service.h index efc8db55..4bb49517 100644 --- a/include/etl/delegate_service.h +++ b/include/etl/delegate_service.h @@ -46,7 +46,7 @@ namespace etl /// \tparam Delegates Pointer to an array of delegate pointers. /// The delegate ids must range between Offset and Offset + Range - 1. //*************************************************************************** -#if ETL_CPP11_SUPPORTED && !defined(ETL_DELEGATE_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_DELEGATE_FORCE_CPP03_IMPLEMENTATION) template * Delegates = nullptr> @@ -98,7 +98,7 @@ namespace etl //*************************************************************************** template -#if ETL_CPP11_SUPPORTED && !defined(ETL_DELEGATE_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_DELEGATE_FORCE_CPP03_IMPLEMENTATION) class delegate_service #else class delegate_service @@ -106,11 +106,7 @@ namespace etl { public: -#if ETL_CPP11_SUPPORTED && !defined(ETL_DELEGATE_FORCE_CPP03) typedef etl::delegate delegate_type; -#else - typedef etl::delegate delegate_type; -#endif //************************************************************************* /// Default constructor. diff --git a/include/etl/fsm.h b/include/etl/fsm.h index 0d33ade9..8f42016a 100644 --- a/include/etl/fsm.h +++ b/include/etl/fsm.h @@ -80,7 +80,7 @@ namespace etl // For internal FSM use. typedef typename etl::larger_type::type fsm_internal_id_t; -#if ETL_CPP17_SUPPORTED && !defined(ETL_FSM_FORCE_CPP03) // For C++17 and above +#if ETL_CPP17_SUPPORTED && !defined(ETL_FSM_FORCE_CPP03_IMPLEMENTATION) // For C++17 and above template class fsm_state; #else @@ -184,7 +184,7 @@ namespace etl friend class etl::fsm; friend class etl::hfsm; -#if ETL_CPP17_SUPPORTED && !defined(ETL_FSM_FORCE_CPP03) // For C++17 and above +#if ETL_CPP17_SUPPORTED && !defined(ETL_FSM_FORCE_CPP03_IMPLEMENTATION) // For C++17 and above template friend class fsm_state; #else @@ -494,7 +494,7 @@ namespace etl //************************************************************************************************* // For C++17 and above. //************************************************************************************************* -#if ETL_CPP17_SUPPORTED && !defined(ETL_FSM_FORCE_CPP03) // For C++17 and above +#if ETL_CPP17_SUPPORTED && !defined(ETL_FSM_FORCE_CPP03_IMPLEMENTATION) // For C++17 and above //*************************************************************************** // The definition for all types. //*************************************************************************** diff --git a/include/etl/generators/fsm_generator.h b/include/etl/generators/fsm_generator.h index 3df14641..fabf80fe 100644 --- a/include/etl/generators/fsm_generator.h +++ b/include/etl/generators/fsm_generator.h @@ -92,7 +92,7 @@ namespace etl // For internal FSM use. typedef typename etl::larger_type::type fsm_internal_id_t; -#if ETL_CPP17_SUPPORTED && !defined(ETL_FSM_FORCE_CPP03) // For C++17 and above +#if ETL_CPP17_SUPPORTED && !defined(ETL_FSM_FORCE_CPP03_IMPLEMENTATION) // For C++17 and above template class fsm_state; #else @@ -203,7 +203,7 @@ namespace etl friend class etl::fsm; friend class etl::hfsm; -#if ETL_CPP17_SUPPORTED && !defined(ETL_FSM_FORCE_CPP03) // For C++17 and above +#if ETL_CPP17_SUPPORTED && !defined(ETL_FSM_FORCE_CPP03_IMPLEMENTATION) // For C++17 and above template friend class fsm_state; #else @@ -520,7 +520,7 @@ namespace etl //************************************************************************************************* // For C++17 and above. //************************************************************************************************* -#if ETL_CPP17_SUPPORTED && !defined(ETL_FSM_FORCE_CPP03) // For C++17 and above +#if ETL_CPP17_SUPPORTED && !defined(ETL_FSM_FORCE_CPP03_IMPLEMENTATION) // For C++17 and above //*************************************************************************** // The definition for all types. //*************************************************************************** diff --git a/include/etl/generators/largest_generator.h b/include/etl/generators/largest_generator.h index d748e2dd..37c9efdf 100644 --- a/include/etl/generators/largest_generator.h +++ b/include/etl/generators/largest_generator.h @@ -75,7 +75,7 @@ cog.outl("//******************************************************************** namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_LARGEST_TYPE_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_LARGEST_TYPE_FORCE_CPP03_IMPLEMENTATION) //*************************************************************************** /// Template to determine the largest type and size. /// Defines 'value_type' which is the type of the largest parameter. @@ -197,7 +197,7 @@ namespace etl /*[[[end]]]*/ #endif -#if ETL_CPP11_SUPPORTED && !defined(ETL_LARGEST_ALIGNMENT_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_LARGEST_ALIGNMENT_FORCE_CPP03_IMPLEMENTATION) //*************************************************************************** /// Template to determine the largest alignment. /// Defines value which is the largest alignment of all the parameters. @@ -372,7 +372,7 @@ namespace etl using larger_type_t = typename larger_type::type; #endif -#if ETL_CPP11_SUPPORTED && !defined(ETL_LARGEST_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_LARGEST_FORCE_CPP03_IMPLEMENTATION) //*************************************************************************** /// Template to determine the largest type, size and alignment. /// Defines value which is the largest type, size and alignment of all the parameters. diff --git a/include/etl/generators/message_packet_generator.h b/include/etl/generators/message_packet_generator.h index f4239fc1..1524e8f6 100644 --- a/include/etl/generators/message_packet_generator.h +++ b/include/etl/generators/message_packet_generator.h @@ -74,7 +74,7 @@ cog.outl("//******************************************************************** namespace etl { -#if ETL_CPP17_SUPPORTED && !defined(ETL_MESSAGE_PACKET_FORCE_CPP03) +#if ETL_CPP17_SUPPORTED && !defined(ETL_MESSAGE_PACKET_FORCE_CPP03_IMPLEMENTATION) //*************************************************************************** // The definition for all message types. //*************************************************************************** diff --git a/include/etl/generators/message_router_generator.h b/include/etl/generators/message_router_generator.h index 16de3016..57f32e59 100644 --- a/include/etl/generators/message_router_generator.h +++ b/include/etl/generators/message_router_generator.h @@ -334,7 +334,7 @@ namespace etl //************************************************************************************************* // For C++17 and above. //************************************************************************************************* -#if ETL_CPP17_SUPPORTED && !defined(ETL_MESSAGE_ROUTER_FORCE_CPP03) +#if ETL_CPP17_SUPPORTED && !defined(ETL_MESSAGE_ROUTER_FORCE_CPP03_IMPLEMENTATION) //*************************************************************************** // The definition for all message types. //*************************************************************************** diff --git a/include/etl/generators/smallest_generator.h b/include/etl/generators/smallest_generator.h index 5dff3527..38e59a85 100644 --- a/include/etl/generators/smallest_generator.h +++ b/include/etl/generators/smallest_generator.h @@ -75,7 +75,7 @@ cog.outl("//******************************************************************** namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_SMALLEST_TYPE_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_SMALLEST_TYPE_FORCE_CPP03_IMPLEMENTATION) //*************************************************************************** /// Template to determine the largest type and size. /// Defines 'value_type' which is the type of the largest parameter. diff --git a/include/etl/generators/type_lookup_generator.h b/include/etl/generators/type_lookup_generator.h index 718769cc..43c7fd98 100644 --- a/include/etl/generators/type_lookup_generator.h +++ b/include/etl/generators/type_lookup_generator.h @@ -83,7 +83,7 @@ namespace etl typedef T2 type2; }; -#if ETL_CPP11_SUPPORTED && !defined(ETL_TYPE_SELECT_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_TYPE_SELECT_FORCE_CPP03_IMPLEMENTATION) //*************************************************************************** // type_id_lookup //*************************************************************************** diff --git a/include/etl/generators/type_select_generator.h b/include/etl/generators/type_select_generator.h index bdf1d833..74424f03 100644 --- a/include/etl/generators/type_select_generator.h +++ b/include/etl/generators/type_select_generator.h @@ -56,7 +56,7 @@ cog.outl("//******************************************************************** namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_TYPE_SELECT_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_TYPE_SELECT_FORCE_CPP03_IMPLEMENTATION) //*************************************************************************** // Variadic version. //*************************************************************************** diff --git a/include/etl/indirect_vector.h b/include/etl/indirect_vector.h index 3e6339af..c6d07f25 100644 --- a/include/etl/indirect_vector.h +++ b/include/etl/indirect_vector.h @@ -774,7 +774,7 @@ namespace etl } #endif -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_VECTOR_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_VECTOR_FORCE_CPP03_IMPLEMENTATION) //********************************************************************* /// Constructs a value at the end of the indirect_vector. /// If asserts or exceptions are enabled, emits vector_full if the indirect_vector is already full. diff --git a/include/etl/largest.h b/include/etl/largest.h index 210b4cee..8e1760e8 100644 --- a/include/etl/largest.h +++ b/include/etl/largest.h @@ -63,7 +63,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_LARGEST_TYPE_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_LARGEST_TYPE_FORCE_CPP03_IMPLEMENTATION) //*************************************************************************** /// Template to determine the largest type and size. /// Defines 'value_type' which is the type of the largest parameter. @@ -167,7 +167,7 @@ namespace etl }; #endif -#if ETL_CPP11_SUPPORTED && !defined(ETL_LARGEST_ALIGNMENT_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_LARGEST_ALIGNMENT_FORCE_CPP03_IMPLEMENTATION) //*************************************************************************** /// Template to determine the largest alignment. /// Defines value which is the largest alignment of all the parameters. @@ -324,7 +324,7 @@ namespace etl using larger_type_t = typename larger_type::type; #endif -#if ETL_CPP11_SUPPORTED && !defined(ETL_LARGEST_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_LARGEST_FORCE_CPP03_IMPLEMENTATION) //*************************************************************************** /// Template to determine the largest type, size and alignment. /// Defines value which is the largest type, size and alignment of all the parameters. diff --git a/include/etl/mem_cast.h b/include/etl/mem_cast.h index 3388d4ac..8e91b45b 100644 --- a/include/etl/mem_cast.h +++ b/include/etl/mem_cast.h @@ -572,7 +572,7 @@ namespace etl /// mem_cast_var /// mem_cast from a variadic list of types //***************************************************************************** -#if ETL_CPP11_SUPPORTED && !defined(ETL_MEM_CAST_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_MEM_CAST_FORCE_CPP03_IMPLEMENTATION) template using mem_cast_types = etl::mem_cast::size, etl::largest::alignment>; #else diff --git a/include/etl/memory.h b/include/etl/memory.h index 81dae7ba..e0b804d2 100644 --- a/include/etl/memory.h +++ b/include/etl/memory.h @@ -1987,7 +1987,7 @@ namespace etl return reinterpret_cast(raw); } -#if ETL_CPP11_SUPPORTED && !defined(ETL_COMPILER_ARM5) && !defined(ETL_UNINITIALIZED_BUFFER_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_COMPILER_ARM5) && !defined(ETL_UNINITIALIZED_BUFFER_FORCE_CPP03_IMPLEMENTATION) alignas(VAlignment) char raw[Object_Size * N_Objects]; #else union @@ -2076,7 +2076,7 @@ namespace etl return reinterpret_cast(raw + (sizeof(T) * N_Objects)); } -#if ETL_CPP11_SUPPORTED && !defined(ETL_COMPILER_ARM5) && !defined(ETL_UNINITIALIZED_BUFFER_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_COMPILER_ARM5) && !defined(ETL_UNINITIALIZED_BUFFER_FORCE_CPP03_IMPLEMENTATION) alignas(Alignment) char raw[sizeof(T) * N_Objects]; #else union diff --git a/include/etl/message_packet.h b/include/etl/message_packet.h index 8a637dea..b3e3f527 100644 --- a/include/etl/message_packet.h +++ b/include/etl/message_packet.h @@ -62,7 +62,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP17_SUPPORTED && !defined(ETL_MESSAGE_PACKET_FORCE_CPP03) +#if ETL_CPP17_SUPPORTED && !defined(ETL_MESSAGE_PACKET_FORCE_CPP03_IMPLEMENTATION) //*************************************************************************** // The definition for all message types. //*************************************************************************** diff --git a/include/etl/message_router.h b/include/etl/message_router.h index 2f3deb77..f182a2c5 100644 --- a/include/etl/message_router.h +++ b/include/etl/message_router.h @@ -322,7 +322,7 @@ namespace etl //************************************************************************************************* // For C++17 and above. //************************************************************************************************* -#if ETL_CPP17_SUPPORTED && !defined(ETL_MESSAGE_ROUTER_FORCE_CPP03) +#if ETL_CPP17_SUPPORTED && !defined(ETL_MESSAGE_ROUTER_FORCE_CPP03_IMPLEMENTATION) //*************************************************************************** // The definition for all message types. //*************************************************************************** diff --git a/include/etl/message_timer_locked.h b/include/etl/message_timer_locked.h index 65d9c016..1e2750c6 100644 --- a/include/etl/message_timer_locked.h +++ b/include/etl/message_timer_locked.h @@ -51,17 +51,10 @@ namespace etl { public: -#if ETL_CPP11_SUPPORTED && !defined(ETL_DELEGATE_FORCE_CPP03) typedef etl::delegate callback_type; typedef etl::delegate try_lock_type; typedef etl::delegate lock_type; typedef etl::delegate unlock_type; -#else - typedef etl::delegate callback_type; - typedef etl::delegate try_lock_type; - typedef etl::delegate lock_type; - typedef etl::delegate unlock_type; -#endif public: diff --git a/include/etl/observer.h b/include/etl/observer.h index 7a637b9d..9dd83114 100644 --- a/include/etl/observer.h +++ b/include/etl/observer.h @@ -232,7 +232,7 @@ namespace etl return observer_list.size(); } -#if ETL_CPP11_SUPPORTED && !defined(ETL_OBSERVER_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_OBSERVER_FORCE_CPP03_IMPLEMENTATION) //***************************************************************** /// Notify all of the observers, sending them the notification. ///\tparam TNotification the notification type. @@ -297,7 +297,7 @@ namespace etl Observer_List observer_list; }; -#if ETL_CPP11_SUPPORTED && !defined(ETL_OBSERVER_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_OBSERVER_FORCE_CPP03_IMPLEMENTATION) //***************************************************************** /// The observer class for N types. diff --git a/include/etl/optional.h b/include/etl/optional.h index 328cabbe..b3586c2e 100644 --- a/include/etl/optional.h +++ b/include/etl/optional.h @@ -414,7 +414,7 @@ namespace etl } } -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_OPTIONAL_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_OPTIONAL_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* /// Emplaces a value. ///\param args The arguments to construct with. diff --git a/include/etl/priority_queue.h b/include/etl/priority_queue.h index 9734df70..8633d9e1 100644 --- a/include/etl/priority_queue.h +++ b/include/etl/priority_queue.h @@ -180,7 +180,7 @@ namespace etl } #endif -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_PRIORITY_QUEUE_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_PRIORITY_QUEUE_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* /// Emplaces a value to the queue. /// If asserts or exceptions are enabled, throws an etl::priority_queue_full diff --git a/include/etl/private/delegate_cpp03.h b/include/etl/private/delegate_cpp03.h index d365dfcf..9070808c 100644 --- a/include/etl/private/delegate_cpp03.h +++ b/include/etl/private/delegate_cpp03.h @@ -55,7 +55,11 @@ #include "../utility.h" #include "../optional.h" +#if defined(ETL_IN_DELEGATE_CPP03_UNIT_TEST) +namespace etl_cpp03 +#else namespace etl +#endif { namespace private_delegate { @@ -167,12 +171,17 @@ namespace etl //************************************************************************* /// Declaration. //************************************************************************* - template - class delegate : public private_delegate::call_if_impl, TReturn, TParam> + template + class delegate; + + + + template + class delegate : public private_delegate::call_if_impl, TReturn, TParam> { public: - using private_delegate::call_if_impl< delegate, TReturn, TParam>::call_if; + using private_delegate::call_if_impl, TReturn, TParam>::call_if; //************************************************************************* /// Default constructor. @@ -368,7 +377,11 @@ namespace etl //************************************************************************* /// Create from function (Compile time). //************************************************************************* - delegate& operator =(const delegate& rhs) = default; + delegate& operator =(const delegate& rhs) + { + invocation = rhs.invocation; + return *this; + } //************************************************************************* /// Create from Lambda or Functor. @@ -551,11 +564,12 @@ namespace etl /// Specialisation for void parameter. //************************************************************************* template - class delegate : public private_delegate::call_if_impl, TReturn, void> + class delegate + : public private_delegate::call_if_impl, TReturn, void> { public: - using private_delegate::call_if_impl< delegate, TReturn, void>::call_if; + using private_delegate::call_if_impl< delegate, TReturn, void>::call_if; //************************************************************************* /// Default constructor. diff --git a/include/etl/private/delegate_cpp11.h b/include/etl/private/delegate_cpp11.h index 2559f6f3..a3d30012 100644 --- a/include/etl/private/delegate_cpp11.h +++ b/include/etl/private/delegate_cpp11.h @@ -417,8 +417,10 @@ namespace etl /// Constructs a delegate from an object and stub. //************************************************************************* ETL_CONSTEXPR14 delegate(void* object, stub_type stub) - : invocation(object, stub) + //: invocation(object, stub) { + invocation.object = object; + invocation.stub = stub; } //************************************************************************* diff --git a/include/etl/private/variant_legacy.h b/include/etl/private/variant_legacy.h index 847b2b0c..29f1064b 100644 --- a/include/etl/private/variant_legacy.h +++ b/include/etl/private/variant_legacy.h @@ -464,7 +464,7 @@ namespace etl type_id = other.type_id; } -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_VARIANT_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_VARIANT_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* /// Emplace with variadic constructor parameters. //************************************************************************* diff --git a/include/etl/queue.h b/include/etl/queue.h index 40236523..956aeaf6 100644 --- a/include/etl/queue.h +++ b/include/etl/queue.h @@ -333,7 +333,7 @@ namespace etl } #endif -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* /// Constructs a value in the queue 'in place'. /// If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full. diff --git a/include/etl/queue_lockable.h b/include/etl/queue_lockable.h index 736be720..e8454666 100644 --- a/include/etl/queue_lockable.h +++ b/include/etl/queue_lockable.h @@ -284,7 +284,7 @@ namespace etl return result; } -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKABLE_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKABLE_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* /// Push a value to the queue without locking. //************************************************************************* @@ -308,7 +308,7 @@ namespace etl } #endif -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKABLE_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKABLE_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* /// Constructs a value in the queue 'in place'. //************************************************************************* @@ -578,7 +578,7 @@ namespace etl return false; } -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKABLE_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKABLE_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* /// Push a value to the queue without locking. //************************************************************************* @@ -600,7 +600,7 @@ namespace etl } #endif -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKABLE_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKABLE_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* /// Constructs a value in the queue 'in place'. //************************************************************************* @@ -738,7 +738,7 @@ namespace etl return false; } -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKABLE_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKABLE_FORCE_CPP03_IMPLEMENTATION) value = etl::move(p_buffer[this->read_index]); #else value = p_buffer[this->read_index]; diff --git a/include/etl/queue_mpmc_mutex.h b/include/etl/queue_mpmc_mutex.h index b3a583a3..5e3e8b25 100644 --- a/include/etl/queue_mpmc_mutex.h +++ b/include/etl/queue_mpmc_mutex.h @@ -182,7 +182,7 @@ namespace etl } #endif -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_MPMC_MUTEX_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_MPMC_MUTEX_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* /// Constructs a value in the queue 'in place'. /// If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full. @@ -424,7 +424,7 @@ namespace etl return false; } -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_MPMC_MUTEX_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_MPMC_MUTEX_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* /// Push a value to the queue. //************************************************************************* @@ -446,7 +446,7 @@ namespace etl } #endif -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_MPMC_MUTEX_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_MPMC_MUTEX_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* /// Constructs a value in the queue 'in place'. //************************************************************************* @@ -564,7 +564,7 @@ namespace etl return false; } -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKABLE_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKABLE_FORCE_CPP03_IMPLEMENTATION) value = etl::move(p_buffer[read_index]); #else value = p_buffer[read_index]; diff --git a/include/etl/queue_spsc_atomic.h b/include/etl/queue_spsc_atomic.h index 7718c687..543e0249 100644 --- a/include/etl/queue_spsc_atomic.h +++ b/include/etl/queue_spsc_atomic.h @@ -225,7 +225,7 @@ namespace etl return false; } -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_ATOMIC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_ATOMIC_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* /// Push a value to the queue. //************************************************************************* @@ -248,7 +248,7 @@ namespace etl } #endif -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_ATOMIC_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_ATOMIC_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* /// Constructs a value in the queue 'in place'. /// If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full. @@ -398,7 +398,7 @@ namespace etl size_type next_index = get_next_index(read_index, RESERVED); -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKABLE_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKABLE_FORCE_CPP03_IMPLEMENTATION) value = etl::move(p_buffer[read_index]); #else value = p_buffer[read_index]; diff --git a/include/etl/queue_spsc_isr.h b/include/etl/queue_spsc_isr.h index 0481bb55..fadc1270 100644 --- a/include/etl/queue_spsc_isr.h +++ b/include/etl/queue_spsc_isr.h @@ -82,7 +82,7 @@ namespace etl /// If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full. ///\param value The value to use to construct the item to push to the queue. //************************************************************************* -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_ISR_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_ISR_FORCE_CPP03_IMPLEMENTATION) template bool emplace_from_isr(Args&&... args) { @@ -238,7 +238,7 @@ namespace etl } #endif -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_ISR_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_ISR_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* /// Constructs a value in the queue 'in place'. /// If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full. @@ -363,7 +363,7 @@ namespace etl return false; } -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKABLE_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKABLE_FORCE_CPP03_IMPLEMENTATION) value = etl::move(p_buffer[read_index]); #else value = p_buffer[read_index]; @@ -515,7 +515,7 @@ namespace etl /// Constructs a value in the queue 'in place'. /// If asserts or exceptions are enabled, throws an etl::queue_full if the queue if already full. //************************************************************************* -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_ISR_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_ISR_FORCE_CPP03_IMPLEMENTATION) template bool emplace(Args&&... args) { diff --git a/include/etl/queue_spsc_locked.h b/include/etl/queue_spsc_locked.h index a1a3b4da..2b5a6d9f 100644 --- a/include/etl/queue_spsc_locked.h +++ b/include/etl/queue_spsc_locked.h @@ -227,7 +227,7 @@ namespace etl return result; } -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKED_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKED_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* /// Push a value to the queue. /// Unlocked. @@ -253,7 +253,7 @@ namespace etl } #endif -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKED_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKED_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* /// Constructs a value in the queue 'in place'. /// Unlocked. @@ -594,7 +594,7 @@ namespace etl return false; } -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKED_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKED_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* /// Push a value to the queue. /// Unlocked. @@ -617,7 +617,7 @@ namespace etl } #endif -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKED_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKED_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* /// Constructs a value in the queue 'in place'. /// Unlocked. @@ -737,7 +737,7 @@ namespace etl return false; } -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKABLE_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_QUEUE_LOCKABLE_FORCE_CPP03_IMPLEMENTATION) value = etl::move(p_buffer[this->read_index]); #else value = p_buffer[this->read_index]; diff --git a/include/etl/smallest.h b/include/etl/smallest.h index 5a694c42..cf580a8b 100644 --- a/include/etl/smallest.h +++ b/include/etl/smallest.h @@ -63,7 +63,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_SMALLEST_TYPE_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_SMALLEST_TYPE_FORCE_CPP03_IMPLEMENTATION) //*************************************************************************** /// Template to determine the largest type and size. /// Defines 'value_type' which is the type of the largest parameter. diff --git a/include/etl/type_lookup.h b/include/etl/type_lookup.h index f870f22d..6f2d6c43 100644 --- a/include/etl/type_lookup.h +++ b/include/etl/type_lookup.h @@ -71,7 +71,7 @@ namespace etl typedef T2 type2; }; -#if ETL_CPP11_SUPPORTED && !defined(ETL_TYPE_SELECT_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_TYPE_SELECT_FORCE_CPP03_IMPLEMENTATION) //*************************************************************************** // type_id_lookup //*************************************************************************** diff --git a/include/etl/type_select.h b/include/etl/type_select.h index 6e32603b..faaa6eb4 100644 --- a/include/etl/type_select.h +++ b/include/etl/type_select.h @@ -44,7 +44,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_TYPE_SELECT_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_TYPE_SELECT_FORCE_CPP03_IMPLEMENTATION) //*************************************************************************** // Variadic version. //*************************************************************************** diff --git a/include/etl/vector.h b/include/etl/vector.h index 499092d9..a9c09d43 100644 --- a/include/etl/vector.h +++ b/include/etl/vector.h @@ -451,7 +451,7 @@ namespace etl } #endif -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_VECTOR_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_VECTOR_FORCE_CPP03_IMPLEMENTATION) //********************************************************************* /// Constructs a value at the end of the vector. /// If asserts or exceptions are enabled, emits vector_full if the vector is already full. diff --git a/include/etl/visitor.h b/include/etl/visitor.h index 4dc6d99a..2feb03c5 100644 --- a/include/etl/visitor.h +++ b/include/etl/visitor.h @@ -50,7 +50,7 @@ SOFTWARE. namespace etl { -#if ETL_CPP11_SUPPORTED && !defined(ETL_VISITOR_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_VISITOR_FORCE_CPP03_IMPLEMENTATION) //***************************************************************** /// The visitable class for N types. @@ -149,7 +149,7 @@ namespace etl #endif -#if ETL_CPP11_SUPPORTED && !defined(ETL_VISITOR_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && !defined(ETL_VISITOR_FORCE_CPP03_IMPLEMENTATION) //***************************************************************** /// The visitor class for N types. diff --git a/test/etl_profile.h b/test/etl_profile.h index d98289d8..2ef4c5f1 100644 --- a/test/etl_profile.h +++ b/test/etl_profile.h @@ -78,28 +78,28 @@ SOFTWARE. //#define ETL_MESSAGES_ARE_VIRTUAL //#define ETL_POLYMORPHIC_MESSAGES -#if defined(ETL_FORCE_TEST_CPP03) - #define ETL_FUNCTION_FORCE_CPP03 - #define ETL_PRIORITY_QUEUE_FORCE_CPP03 - #define ETL_QUEUE_ATOMIC_FORCE_CPP03 - #define ETL_VARIANT_FORCE_CPP03 - #define ETL_VECTOR_FORCE_CPP03 - #define ETL_QUEUE_FORCE_CPP03 - #define ETL_QUEUE_MPMC_MUTEX_FORCE_CPP03 - #define ETL_QUEUE_ISR_FORCE_CPP03 - #define ETL_QUEUE_LOCKED_FORCE_CPP03 - #define ETL_OPTIONAL_FORCE_CPP03 - #define ETL_LARGEST_TYPE_FORCE_CPP03 - #define ETL_TYPE_SELECT_FORCE_CPP03 - #define ETL_UNINITIALIZED_BUFFER_FORCE_CPP03 - #define ETL_CRC_FORCE_CPP03 - #define ETL_MEM_CAST_FORCE_CPP03 - #define ETL_OBSERVER_FORCE_CPP03 - #define ETL_MESSAGE_PACKET_FORCE_CPP03 - #define ETL_OBSERVER_FORCE_CPP03 - #define ETL_MESSAGE_ROUTER_FORCE_CPP03 - #define ETL_FSM_FORCE_CPP03 - #define ETL_DELEGATE_FORCE_CPP03 +#if defined(ETL_FORCE_TEST_CPP03_IMPLEMENTATION) + #define ETL_FUNCTION_FORCE_CPP03_IMPLEMENTATION + #define ETL_PRIORITY_QUEUE_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_ATOMIC_FORCE_CPP03_IMPLEMENTATION + #define ETL_VARIANT_FORCE_CPP03_IMPLEMENTATION + #define ETL_VECTOR_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_MPMC_MUTEX_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_ISR_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_LOCKED_FORCE_CPP03_IMPLEMENTATION + #define ETL_OPTIONAL_FORCE_CPP03_IMPLEMENTATION + #define ETL_LARGEST_TYPE_FORCE_CPP03_IMPLEMENTATION + #define ETL_TYPE_SELECT_FORCE_CPP03_IMPLEMENTATION + #define ETL_UNINITIALIZED_BUFFER_FORCE_CPP03_IMPLEMENTATION + #define ETL_CRC_FORCE_CPP03_IMPLEMENTATION + #define ETL_MEM_CAST_FORCE_CPP03_IMPLEMENTATION + #define ETL_OBSERVER_FORCE_CPP03_IMPLEMENTATION + #define ETL_MESSAGE_PACKET_FORCE_CPP03_IMPLEMENTATION + #define ETL_OBSERVER_FORCE_CPP03_IMPLEMENTATION + #define ETL_MESSAGE_ROUTER_FORCE_CPP03_IMPLEMENTATION + #define ETL_FSM_FORCE_CPP03_IMPLEMENTATION + #define ETL_DELEGATE_FORCE_CPP03_IMPLEMENTATION #endif #if defined(ETL_FORCE_TEST_CPP11) diff --git a/test/runsanitychecks.sh b/test/runsanitychecks.sh index 3ca8d4b7..7c9e19c8 100755 --- a/test/runsanitychecks.sh +++ b/test/runsanitychecks.sh @@ -1,4 +1,6 @@ #!/bin/sh +clear + cd sanity-check || exit 1 echo "" > log.txt diff --git a/test/runtests.sh b/test/runtests.sh index 01e488a3..fbb7116d 100755 --- a/test/runtests.sh +++ b/test/runtests.sh @@ -1,5 +1,6 @@ #!/bin/sh -#sudo ntpdate ntp.ubuntu.com +clear + mkdir -p build-make || exit 1 cd build-make || exit 1 diff --git a/test/sanity-check/c++03/etl_profile.h b/test/sanity-check/c++03/etl_profile.h index 002a77d3..a16d2298 100644 --- a/test/sanity-check/c++03/etl_profile.h +++ b/test/sanity-check/c++03/etl_profile.h @@ -42,27 +42,27 @@ SOFTWARE. #define ETL_MESSAGE_TIMER_DISABLE_INTERRUPTS #define ETL_MESSAGE_TIMER_ENABLE_INTERRUPTS -#if defined(ETL_FORCE_TEST_CPP03) - #define ETL_FUNCTION_FORCE_CPP03 - #define ETL_PRIORITY_QUEUE_FORCE_CPP03 - #define ETL_QUEUE_ATOMIC_FORCE_CPP03 - #define ETL_VARIANT_FORCE_CPP03 - #define ETL_VECTOR_FORCE_CPP03 - #define ETL_QUEUE_FORCE_CPP03 - #define ETL_QUEUE_MPMC_MUTEX_FORCE_CPP03 - #define ETL_QUEUE_ISR_FORCE_CPP03 - #define ETL_QUEUE_LOCKED_FORCE_CPP03 - #define ETL_OPTIONAL_FORCE_CPP03 - #define ETL_LARGEST_TYPE_FORCE_CPP03 - #define ETL_TYPE_SELECT_FORCE_CPP03 - #define ETL_UNINITIALIZED_BUFFER_FORCE_CPP03 - #define ETL_CRC_FORCE_CPP03 - #define ETL_MEM_CAST_FORCE_CPP03 - #define ETL_OBSERVER_FORCE_CPP03 - #define ETL_MESSAGE_PACKET_FORCE_CPP03 - #define ETL_OBSERVER_FORCE_CPP03 - #define ETL_MESSAGE_ROUTER_FORCE_CPP03 - #define ETL_FSM_FORCE_CPP03 +#if defined(ETL_FORCE_TEST_CPP03_IMPLEMENTATION) + #define ETL_FUNCTION_FORCE_CPP03_IMPLEMENTATION + #define ETL_PRIORITY_QUEUE_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_ATOMIC_FORCE_CPP03_IMPLEMENTATION + #define ETL_VARIANT_FORCE_CPP03_IMPLEMENTATION + #define ETL_VECTOR_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_MPMC_MUTEX_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_ISR_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_LOCKED_FORCE_CPP03_IMPLEMENTATION + #define ETL_OPTIONAL_FORCE_CPP03_IMPLEMENTATION + #define ETL_LARGEST_TYPE_FORCE_CPP03_IMPLEMENTATION + #define ETL_TYPE_SELECT_FORCE_CPP03_IMPLEMENTATION + #define ETL_UNINITIALIZED_BUFFER_FORCE_CPP03_IMPLEMENTATION + #define ETL_CRC_FORCE_CPP03_IMPLEMENTATION + #define ETL_MEM_CAST_FORCE_CPP03_IMPLEMENTATION + #define ETL_OBSERVER_FORCE_CPP03_IMPLEMENTATION + #define ETL_MESSAGE_PACKET_FORCE_CPP03_IMPLEMENTATION + #define ETL_OBSERVER_FORCE_CPP03_IMPLEMENTATION + #define ETL_MESSAGE_ROUTER_FORCE_CPP03_IMPLEMENTATION + #define ETL_FSM_FORCE_CPP03_IMPLEMENTATION #endif #endif diff --git a/test/sanity-check/c++11/etl_profile.h b/test/sanity-check/c++11/etl_profile.h index 1c2c6283..54a6f1e1 100644 --- a/test/sanity-check/c++11/etl_profile.h +++ b/test/sanity-check/c++11/etl_profile.h @@ -42,27 +42,27 @@ SOFTWARE. #define ETL_MESSAGE_TIMER_DISABLE_INTERRUPTS #define ETL_MESSAGE_TIMER_ENABLE_INTERRUPTS -#if defined(ETL_FORCE_TEST_CPP03) - #define ETL_FUNCTION_FORCE_CPP03 - #define ETL_PRIORITY_QUEUE_FORCE_CPP03 - #define ETL_QUEUE_ATOMIC_FORCE_CPP03 - #define ETL_VARIANT_FORCE_CPP03 - #define ETL_VECTOR_FORCE_CPP03 - #define ETL_QUEUE_FORCE_CPP03 - #define ETL_QUEUE_MPMC_MUTEX_FORCE_CPP03 - #define ETL_QUEUE_ISR_FORCE_CPP03 - #define ETL_QUEUE_LOCKED_FORCE_CPP03 - #define ETL_OPTIONAL_FORCE_CPP03 - #define ETL_LARGEST_TYPE_FORCE_CPP03 - #define ETL_TYPE_SELECT_FORCE_CPP03 - #define ETL_UNINITIALIZED_BUFFER_FORCE_CPP03 - #define ETL_CRC_FORCE_CPP03 - #define ETL_MEM_CAST_FORCE_CPP03 - #define ETL_OBSERVER_FORCE_CPP03 - #define ETL_MESSAGE_PACKET_FORCE_CPP03 - #define ETL_OBSERVER_FORCE_CPP03 - #define ETL_MESSAGE_ROUTER_FORCE_CPP03 - #define ETL_FSM_FORCE_CPP03 +#if defined(ETL_FORCE_TEST_CPP03_IMPLEMENTATION) + #define ETL_FUNCTION_FORCE_CPP03_IMPLEMENTATION + #define ETL_PRIORITY_QUEUE_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_ATOMIC_FORCE_CPP03_IMPLEMENTATION + #define ETL_VARIANT_FORCE_CPP03_IMPLEMENTATION + #define ETL_VECTOR_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_MPMC_MUTEX_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_ISR_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_LOCKED_FORCE_CPP03_IMPLEMENTATION + #define ETL_OPTIONAL_FORCE_CPP03_IMPLEMENTATION + #define ETL_LARGEST_TYPE_FORCE_CPP03_IMPLEMENTATION + #define ETL_TYPE_SELECT_FORCE_CPP03_IMPLEMENTATION + #define ETL_UNINITIALIZED_BUFFER_FORCE_CPP03_IMPLEMENTATION + #define ETL_CRC_FORCE_CPP03_IMPLEMENTATION + #define ETL_MEM_CAST_FORCE_CPP03_IMPLEMENTATION + #define ETL_OBSERVER_FORCE_CPP03_IMPLEMENTATION + #define ETL_MESSAGE_PACKET_FORCE_CPP03_IMPLEMENTATION + #define ETL_OBSERVER_FORCE_CPP03_IMPLEMENTATION + #define ETL_MESSAGE_ROUTER_FORCE_CPP03_IMPLEMENTATION + #define ETL_FSM_FORCE_CPP03_IMPLEMENTATION #endif #endif diff --git a/test/sanity-check/c++14/etl_profile.h b/test/sanity-check/c++14/etl_profile.h index a5eed9bd..652b501c 100644 --- a/test/sanity-check/c++14/etl_profile.h +++ b/test/sanity-check/c++14/etl_profile.h @@ -42,27 +42,27 @@ SOFTWARE. #define ETL_MESSAGE_TIMER_DISABLE_INTERRUPTS #define ETL_MESSAGE_TIMER_ENABLE_INTERRUPTS -#if defined(ETL_FORCE_TEST_CPP03) - #define ETL_FUNCTION_FORCE_CPP03 - #define ETL_PRIORITY_QUEUE_FORCE_CPP03 - #define ETL_QUEUE_ATOMIC_FORCE_CPP03 - #define ETL_VARIANT_FORCE_CPP03 - #define ETL_VECTOR_FORCE_CPP03 - #define ETL_QUEUE_FORCE_CPP03 - #define ETL_QUEUE_MPMC_MUTEX_FORCE_CPP03 - #define ETL_QUEUE_ISR_FORCE_CPP03 - #define ETL_QUEUE_LOCKED_FORCE_CPP03 - #define ETL_OPTIONAL_FORCE_CPP03 - #define ETL_LARGEST_TYPE_FORCE_CPP03 - #define ETL_TYPE_SELECT_FORCE_CPP03 - #define ETL_UNINITIALIZED_BUFFER_FORCE_CPP03 - #define ETL_CRC_FORCE_CPP03 - #define ETL_MEM_CAST_FORCE_CPP03 - #define ETL_OBSERVER_FORCE_CPP03 - #define ETL_MESSAGE_PACKET_FORCE_CPP03 - #define ETL_OBSERVER_FORCE_CPP03 - #define ETL_MESSAGE_ROUTER_FORCE_CPP03 - #define ETL_FSM_FORCE_CPP03 +#if defined(ETL_FORCE_TEST_CPP03_IMPLEMENTATION) + #define ETL_FUNCTION_FORCE_CPP03_IMPLEMENTATION + #define ETL_PRIORITY_QUEUE_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_ATOMIC_FORCE_CPP03_IMPLEMENTATION + #define ETL_VARIANT_FORCE_CPP03_IMPLEMENTATION + #define ETL_VECTOR_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_MPMC_MUTEX_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_ISR_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_LOCKED_FORCE_CPP03_IMPLEMENTATION + #define ETL_OPTIONAL_FORCE_CPP03_IMPLEMENTATION + #define ETL_LARGEST_TYPE_FORCE_CPP03_IMPLEMENTATION + #define ETL_TYPE_SELECT_FORCE_CPP03_IMPLEMENTATION + #define ETL_UNINITIALIZED_BUFFER_FORCE_CPP03_IMPLEMENTATION + #define ETL_CRC_FORCE_CPP03_IMPLEMENTATION + #define ETL_MEM_CAST_FORCE_CPP03_IMPLEMENTATION + #define ETL_OBSERVER_FORCE_CPP03_IMPLEMENTATION + #define ETL_MESSAGE_PACKET_FORCE_CPP03_IMPLEMENTATION + #define ETL_OBSERVER_FORCE_CPP03_IMPLEMENTATION + #define ETL_MESSAGE_ROUTER_FORCE_CPP03_IMPLEMENTATION + #define ETL_FSM_FORCE_CPP03_IMPLEMENTATION #endif #endif diff --git a/test/sanity-check/c++17/etl_profile.h b/test/sanity-check/c++17/etl_profile.h index ce3a9e27..cc9973f1 100644 --- a/test/sanity-check/c++17/etl_profile.h +++ b/test/sanity-check/c++17/etl_profile.h @@ -42,27 +42,27 @@ SOFTWARE. #define ETL_MESSAGE_TIMER_DISABLE_INTERRUPTS #define ETL_MESSAGE_TIMER_ENABLE_INTERRUPTS -#if defined(ETL_FORCE_TEST_CPP03) - #define ETL_FUNCTION_FORCE_CPP03 - #define ETL_PRIORITY_QUEUE_FORCE_CPP03 - #define ETL_QUEUE_ATOMIC_FORCE_CPP03 - #define ETL_VARIANT_FORCE_CPP03 - #define ETL_VECTOR_FORCE_CPP03 - #define ETL_QUEUE_FORCE_CPP03 - #define ETL_QUEUE_MPMC_MUTEX_FORCE_CPP03 - #define ETL_QUEUE_ISR_FORCE_CPP03 - #define ETL_QUEUE_LOCKED_FORCE_CPP03 - #define ETL_OPTIONAL_FORCE_CPP03 - #define ETL_LARGEST_TYPE_FORCE_CPP03 - #define ETL_TYPE_SELECT_FORCE_CPP03 - #define ETL_UNINITIALIZED_BUFFER_FORCE_CPP03 - #define ETL_CRC_FORCE_CPP03 - #define ETL_MEM_CAST_FORCE_CPP03 - #define ETL_OBSERVER_FORCE_CPP03 - #define ETL_MESSAGE_PACKET_FORCE_CPP03 - #define ETL_OBSERVER_FORCE_CPP03 - #define ETL_MESSAGE_ROUTER_FORCE_CPP03 - #define ETL_FSM_FORCE_CPP03 +#if defined(ETL_FORCE_TEST_CPP03_IMPLEMENTATION) + #define ETL_FUNCTION_FORCE_CPP03_IMPLEMENTATION + #define ETL_PRIORITY_QUEUE_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_ATOMIC_FORCE_CPP03_IMPLEMENTATION + #define ETL_VARIANT_FORCE_CPP03_IMPLEMENTATION + #define ETL_VECTOR_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_MPMC_MUTEX_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_ISR_FORCE_CPP03_IMPLEMENTATION + #define ETL_QUEUE_LOCKED_FORCE_CPP03_IMPLEMENTATION + #define ETL_OPTIONAL_FORCE_CPP03_IMPLEMENTATION + #define ETL_LARGEST_TYPE_FORCE_CPP03_IMPLEMENTATION + #define ETL_TYPE_SELECT_FORCE_CPP03_IMPLEMENTATION + #define ETL_UNINITIALIZED_BUFFER_FORCE_CPP03_IMPLEMENTATION + #define ETL_CRC_FORCE_CPP03_IMPLEMENTATION + #define ETL_MEM_CAST_FORCE_CPP03_IMPLEMENTATION + #define ETL_OBSERVER_FORCE_CPP03_IMPLEMENTATION + #define ETL_MESSAGE_PACKET_FORCE_CPP03_IMPLEMENTATION + #define ETL_OBSERVER_FORCE_CPP03_IMPLEMENTATION + #define ETL_MESSAGE_ROUTER_FORCE_CPP03_IMPLEMENTATION + #define ETL_FSM_FORCE_CPP03_IMPLEMENTATION #endif #endif diff --git a/test/test_delegate.cpp b/test/test_delegate.cpp index 2f008277..d5ee2acf 100644 --- a/test/test_delegate.cpp +++ b/test/test_delegate.cpp @@ -28,10 +28,10 @@ SOFTWARE. #include "unit_test_framework.h" -#include "etl/delegate.h" +#include "etl/private/delegate_cpp11.h" #include "etl/vector.h" -#if !defined(ETL_CRC_FORCE_CPP03) +#if !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION) namespace { diff --git a/test/test_delegate_cpp03.cpp b/test/test_delegate_cpp03.cpp index a7122c9d..821f31f9 100644 --- a/test/test_delegate_cpp03.cpp +++ b/test/test_delegate_cpp03.cpp @@ -28,6 +28,8 @@ SOFTWARE. #include "unit_test_framework.h" +#define ETL_IN_DELEGATE_CPP03_UNIT_TEST + #include "etl/private/delegate_cpp03.h" #include "etl/vector.h" @@ -201,18 +203,18 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_is_valid_false) { - etl::delegate d; + etl_cpp03::delegate d; CHECK(!d.is_valid()); CHECK(!d); - CHECK_THROW(d(), etl::delegate_uninitialised); + CHECK_THROW(d(), etl_cpp03::delegate_uninitialised); } //************************************************************************* TEST_FIXTURE(SetupFixture, test_free_void) { - auto d = etl::delegate::create(); + auto d = etl_cpp03::delegate::create(); d(); @@ -222,7 +224,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_free_int) { - auto d = etl::delegate::create(); + auto d = etl_cpp03::delegate::create(); d(VALUE1); @@ -233,7 +235,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_free_reference) { - auto d = etl::delegate::create(); + auto d = etl_cpp03::delegate::create(); Data data; data.d = VALUE1; @@ -249,7 +251,7 @@ namespace { Test test; - etl::delegate d(test); + etl_cpp03::delegate d(test); d(); @@ -261,7 +263,7 @@ namespace { Test test; - auto d = etl::delegate::create(test); + auto d = etl_cpp03::delegate::create(test); d(); @@ -273,7 +275,7 @@ namespace { const Test test; - etl::delegate d(test); + etl_cpp03::delegate d(test); d(); @@ -284,7 +286,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_member_operator_void_compile_time) { - auto d = etl::delegate::create(); + auto d = etl_cpp03::delegate::create(); d(); @@ -294,7 +296,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_member_operator_void_compile_time_const) { - auto d = etl::delegate::create(); + auto d = etl_cpp03::delegate::create(); d(); @@ -307,7 +309,7 @@ namespace { Test test; - etl::delegate d; + etl_cpp03::delegate d; d = test; @@ -321,7 +323,7 @@ namespace { Test test; - auto d = etl::delegate::create(test); + auto d = etl_cpp03::delegate::create(test); d(); @@ -333,7 +335,7 @@ namespace { const Test test; - auto d = etl::delegate::create(test); + auto d = etl_cpp03::delegate::create(test); d(); @@ -345,7 +347,7 @@ namespace { Test test; - auto d = etl::delegate::create(test); + auto d = etl_cpp03::delegate::create(test); d(VALUE1); @@ -358,7 +360,7 @@ namespace { const Test test; - auto d = etl::delegate::create(test); + auto d = etl_cpp03::delegate::create(test); d(VALUE1); @@ -370,7 +372,7 @@ namespace TEST_FIXTURE(SetupFixture, test_member_reference) { Test test; - auto d = etl::delegate::create(test); + auto d = etl_cpp03::delegate::create(test); Data data; data.d = VALUE1; @@ -385,7 +387,7 @@ namespace TEST_FIXTURE(SetupFixture, test_member_reference_const) { const Test test; - auto d = etl::delegate::create(test); + auto d = etl_cpp03::delegate::create(test); Data data; data.d = VALUE1; @@ -399,7 +401,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_member_static) { - auto d = etl::delegate::create(); + auto d = etl_cpp03::delegate::create(); Data data; data.d = VALUE1; @@ -414,7 +416,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_member_void_compile_time) { - auto d = etl::delegate::create(); + auto d = etl_cpp03::delegate::create(); d(); @@ -424,7 +426,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_member_void_const_compile_time) { - auto d = etl::delegate::create(); + auto d = etl_cpp03::delegate::create(); d(); @@ -434,7 +436,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_member_int_compile_time) { - auto d = etl::delegate::create(); + auto d = etl_cpp03::delegate::create(); d(VALUE1); @@ -445,7 +447,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_member_int_const_compile_time) { - auto d = etl::delegate::create(); + auto d = etl_cpp03::delegate::create(); d(VALUE1); @@ -456,7 +458,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_member_reference_compile_time) { - auto d = etl::delegate::create(); + auto d = etl_cpp03::delegate::create(); Data data; data.d = VALUE1; @@ -470,7 +472,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_member_reference_const_compile_time) { - auto d = etl::delegate::create(); + auto d = etl_cpp03::delegate::create(); Data data; data.d = VALUE1; @@ -484,7 +486,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_set_free_int) { - etl::delegate d; + etl_cpp03::delegate d; d.set(); @@ -497,7 +499,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_set_lambda_int) { - etl::delegate d; + etl_cpp03::delegate d; d.set([](int i) { function_called = true; parameter_correct = (i == VALUE1); }); @@ -511,7 +513,7 @@ namespace TEST_FIXTURE(SetupFixture, test_set_member_reference) { Test test; - etl::delegate d; + etl_cpp03::delegate d; d.set(test); @@ -528,7 +530,7 @@ namespace TEST_FIXTURE(SetupFixture, test_set_const_member_reference) { Test test; - etl::delegate d; + etl_cpp03::delegate d; d.set(test); @@ -544,7 +546,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_set_member_reference_compile_time) { - etl::delegate d; + etl_cpp03::delegate d; d.set(); @@ -560,7 +562,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_set_member_reference_const_compile_time) { - etl::delegate d; + etl_cpp03::delegate d; d.set(); @@ -579,7 +581,7 @@ namespace { Test test; - auto d1 = etl::delegate::create(test); + auto d1 = etl_cpp03::delegate::create(test); auto d2(d1); d2(VALUE1); @@ -593,8 +595,8 @@ namespace { Test test; - auto d1 = etl::delegate::create(test); - etl::delegate d2; + auto d1 = etl_cpp03::delegate::create(test); + etl_cpp03::delegate d2; d2 = d1; @@ -609,7 +611,7 @@ namespace { Test test; - auto d1 = etl::delegate::create(test); + auto d1 = etl_cpp03::delegate::create(test); auto d2 = d1; CHECK(d1 == d2); @@ -620,8 +622,8 @@ namespace { Test test; - auto d1 = etl::delegate::create(test); - auto d2 = etl::delegate::create(test);; + auto d1 = etl_cpp03::delegate::create(test); + auto d2 = etl_cpp03::delegate::create(test);; CHECK(d1 != d2); } @@ -629,9 +631,9 @@ namespace //************************************************************************* TEST(test_issue_418) { - etl::vector, 5> vector_of_delegates; + etl::vector, 5> vector_of_delegates; - vector_of_delegates.push_back(etl::delegate::create()); + vector_of_delegates.push_back(etl_cpp03::delegate::create()); CHECK_EQUAL(42, vector_of_delegates.front()(21)); } @@ -639,7 +641,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_call_or_run_time_normal) { - auto d = etl::delegate::create(); + etl_cpp03::delegate d = etl_cpp03::delegate::create(); int result = d.call_or(alternative, VALUE1); @@ -649,7 +651,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_call_or_run_time_alternative) { - etl::delegate d; + etl_cpp03::delegate d; int result = d.call_or(alternative, VALUE1); @@ -659,7 +661,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_call_or_compile_time_alternative) { - etl::delegate d; + etl_cpp03::delegate d; int result = d.call_or(VALUE1); @@ -669,9 +671,9 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_call_or_delegate_alternative) { - etl::delegate d; + etl_cpp03::delegate d; - auto alt = etl::delegate::create(); + auto alt = etl_cpp03::delegate::create(); int result = d.call_or(alt, VALUE1); @@ -681,7 +683,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_call_if_and_valid) { - auto d = etl::delegate::create(); + auto d = etl_cpp03::delegate::create(); etl::optional result = d.call_if(VALUE1); @@ -692,7 +694,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_call_if_and_not_valid) { - etl::delegate d; + etl_cpp03::delegate d; etl::optional result = d.call_if(VALUE1); @@ -702,7 +704,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_call_if_and_valid_returning_void) { - auto d = etl::delegate::create(); + auto d = etl_cpp03::delegate::create(); bool was_called = d.call_if(VALUE1); @@ -714,7 +716,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_call_if_and_not_valid_returning_void) { - etl::delegate d; + etl_cpp03::delegate d; bool was_called = d.call_if(VALUE1); diff --git a/test/test_delegate_service.cpp b/test/test_delegate_service.cpp index dd7aef3e..d60825e2 100644 --- a/test/test_delegate_service.cpp +++ b/test/test_delegate_service.cpp @@ -31,7 +31,7 @@ SOFTWARE. #include "etl/delegate.h" #include "etl/delegate_service.h" -#if !defined(ETL_DELEGATE_FORCE_CPP03) +#if !defined(ETL_DELEGATE_FORCE_CPP03_IMPLEMENTATION) namespace { diff --git a/test/test_delegate_service_compile_time.cpp b/test/test_delegate_service_compile_time.cpp index f1fb2887..0b4f2c37 100644 --- a/test/test_delegate_service_compile_time.cpp +++ b/test/test_delegate_service_compile_time.cpp @@ -31,7 +31,7 @@ SOFTWARE. #include "etl/delegate.h" #include "etl/delegate_service.h" -#if !defined(ETL_DELEGATE_FORCE_CPP03) +#if !defined(ETL_DELEGATE_FORCE_CPP03_IMPLEMENTATION) namespace { diff --git a/test/test_delegate_service_cpp03.cpp b/test/test_delegate_service_cpp03.cpp index 5763074b..422c66e6 100644 --- a/test/test_delegate_service_cpp03.cpp +++ b/test/test_delegate_service_cpp03.cpp @@ -31,7 +31,7 @@ SOFTWARE. #include "etl/delegate.h" #include "etl/delegate_service.h" -#if defined(ETL_DELEGATE_FORCE_CPP03) +#if defined(ETL_DELEGATE_FORCE_CPP03_IMPLEMENTATION) namespace { @@ -73,7 +73,7 @@ namespace public: Test() - : callback(etl::delegate::create(*this)) + : callback(Service::delegate_type::create(*this)) { } diff --git a/test/test_indirect_vector.cpp b/test/test_indirect_vector.cpp index 0c498527..e8996fb4 100644 --- a/test/test_indirect_vector.cpp +++ b/test/test_indirect_vector.cpp @@ -845,7 +845,7 @@ namespace // So this is only tested on C++11 onwards TEST_FIXTURE(SetupFixture, test_emplace_back_non_const_references) { -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_VECTOR_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_VECTOR_FORCE_CPP03_IMPLEMENTATION) class Data { public: diff --git a/test/test_largest.cpp b/test/test_largest.cpp index 5c9ec6ce..5c637b95 100644 --- a/test/test_largest.cpp +++ b/test/test_largest.cpp @@ -55,7 +55,7 @@ namespace CHECK(type); } -#if !defined(ETL_LARGEST_TYPE_FORCE_CPP03) +#if !defined(ETL_LARGEST_TYPE_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* TEST(test_pod_type_vt) { @@ -99,7 +99,7 @@ namespace CHECK(type); } -#if !defined(ETL_LARGEST_TYPE_FORCE_CPP03) +#if !defined(ETL_LARGEST_TYPE_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* TEST(test_non_pod_type_vt) { diff --git a/test/test_queue_mpmc_mutex.cpp b/test/test_queue_mpmc_mutex.cpp index 0c8045c9..e41865e9 100644 --- a/test/test_queue_mpmc_mutex.cpp +++ b/test/test_queue_mpmc_mutex.cpp @@ -153,7 +153,7 @@ namespace CHECK(!queue.pop(i)); } -#if !defined(ETL_FORCE_TEST_CPP03) +#if !defined(ETL_FORCE_TEST_CPP03_IMPLEMENTATION) //************************************************************************* TEST(test_move_push_pop) { diff --git a/test/test_queue_mpmc_mutex_small.cpp b/test/test_queue_mpmc_mutex_small.cpp index 0b1ba2fc..aa3e7aa7 100644 --- a/test/test_queue_mpmc_mutex_small.cpp +++ b/test/test_queue_mpmc_mutex_small.cpp @@ -165,7 +165,7 @@ namespace CHECK(!queue.pop(i)); } -#if !defined(ETL_FORCE_TEST_CPP03) +#if !defined(ETL_FORCE_TEST_CPP03_IMPLEMENTATION) //************************************************************************* TEST(test_move_push_pop) { diff --git a/test/test_queue_spsc_atomic.cpp b/test/test_queue_spsc_atomic.cpp index ae55fe60..c103fee6 100644 --- a/test/test_queue_spsc_atomic.cpp +++ b/test/test_queue_spsc_atomic.cpp @@ -150,7 +150,7 @@ namespace CHECK(!queue.pop(i)); } -#if !defined(ETL_FORCE_TEST_CPP03) +#if !defined(ETL_FORCE_TEST_CPP03_IMPLEMENTATION) //************************************************************************* TEST(test_move_push_pop) { diff --git a/test/test_queue_spsc_atomic_small.cpp b/test/test_queue_spsc_atomic_small.cpp index 1b3ecfe1..b84c9861 100644 --- a/test/test_queue_spsc_atomic_small.cpp +++ b/test/test_queue_spsc_atomic_small.cpp @@ -155,7 +155,7 @@ namespace CHECK(!queue.pop(i)); } -#if !defined(ETL_FORCE_TEST_CPP03) +#if !defined(ETL_FORCE_TEST_CPP03_IMPLEMENTATION) //************************************************************************* TEST(test_move_push_pop) { diff --git a/test/test_queue_spsc_locked.cpp b/test/test_queue_spsc_locked.cpp index 58799996..97e6cc58 100644 --- a/test/test_queue_spsc_locked.cpp +++ b/test/test_queue_spsc_locked.cpp @@ -241,7 +241,7 @@ namespace CHECK(!queue.pop_from_unlocked(i)); } -#if !defined(ETL_FORCE_TEST_CPP03) +#if !defined(ETL_FORCE_TEST_CPP03_IMPLEMENTATION) //************************************************************************* TEST(test_move_push_pop) { diff --git a/test/test_queue_spsc_locked_small.cpp b/test/test_queue_spsc_locked_small.cpp index 91236d0b..e89edd2c 100644 --- a/test/test_queue_spsc_locked_small.cpp +++ b/test/test_queue_spsc_locked_small.cpp @@ -245,7 +245,7 @@ namespace CHECK(!queue.pop_from_unlocked(i)); } -#if !defined(ETL_FORCE_TEST_CPP03) +#if !defined(ETL_FORCE_TEST_CPP03_IMPLEMENTATION) //************************************************************************* TEST(test_move_push_pop) { diff --git a/test/test_type_lookup.cpp b/test/test_type_lookup.cpp index 1a6ccd3a..22a88a16 100644 --- a/test/test_type_lookup.cpp +++ b/test/test_type_lookup.cpp @@ -134,7 +134,7 @@ namespace CHECK((etl::is_same::type>::value)); } -#if !defined(ETL_TYPE_SELECT_FORCE_CPP03) +#if !defined(ETL_TYPE_SELECT_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* TEST(test_type_from_id_t_16) { @@ -170,7 +170,7 @@ namespace CHECK((etl::is_same::type>::value)); } -#if !defined(ETL_TYPE_SELECT_FORCE_CPP03) +#if !defined(ETL_TYPE_SELECT_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* TEST(test_type_from_id_t_8) { @@ -191,7 +191,7 @@ namespace CHECK((etl::is_same::type>::value)); } -#if !defined(ETL_TYPE_SELECT_FORCE_CPP03) +#if !defined(ETL_TYPE_SELECT_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* TEST(test_type_from_id_t_1) { @@ -253,7 +253,7 @@ namespace CHECK_EQUAL((unsigned int)Type16::ID, (unsigned int)Type_Id_Lookup16::get_id_from_type(Type16())); } -#if !defined(ETL_TYPE_SELECT_FORCE_CPP03) +#if !defined(ETL_TYPE_SELECT_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* TEST(test_id_from_type_v_16) { @@ -306,7 +306,7 @@ namespace CHECK_EQUAL((unsigned int)Type16::ID, (unsigned int)Type_Id_Lookup8::get_id_from_type(Type16())); } -#if !defined(ETL_TYPE_SELECT_FORCE_CPP03) +#if !defined(ETL_TYPE_SELECT_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* TEST(test_id_from_type_v_8) { @@ -330,7 +330,7 @@ namespace CHECK_EQUAL((unsigned int)Type16::ID, (unsigned int)Type_Id_Lookup1::get_id_from_type(Type16())); } -#if !defined(ETL_TYPE_SELECT_FORCE_CPP03) +#if !defined(ETL_TYPE_SELECT_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* TEST(test_id_from_type_v_1) { @@ -359,7 +359,7 @@ namespace CHECK((etl::is_same::type>::value)); } -#if !defined(ETL_TYPE_SELECT_FORCE_CPP03) +#if !defined(ETL_TYPE_SELECT_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* TEST(test_type_from_type_t_16) { @@ -395,7 +395,7 @@ namespace CHECK((etl::is_same::type>::value)); } -#if !defined(ETL_TYPE_SELECT_FORCE_CPP03) +#if !defined(ETL_TYPE_SELECT_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* TEST(test_type_from_type_t_8) { @@ -416,7 +416,7 @@ namespace CHECK((etl::is_same::type>::value)); } -#if !defined(ETL_TYPE_SELECT_FORCE_CPP03) +#if !defined(ETL_TYPE_SELECT_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* TEST(test_type_from_type_t_1) { diff --git a/test/test_type_select.cpp b/test/test_type_select.cpp index 51011b28..fd2d7aed 100644 --- a/test/test_type_select.cpp +++ b/test/test_type_select.cpp @@ -54,7 +54,7 @@ namespace CHECK(!(etl::is_same, typename Types1::select<0>::type>::value)); } -#if !defined(ETL_TYPE_SELECT_FORCE_CPP03) +#if !defined(ETL_TYPE_SELECT_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* TEST(test_type_select_t_1) { @@ -84,7 +84,7 @@ namespace CHECK(!(etl::is_same, typename Types8::select<7>::type>::value)); } -#if !defined(ETL_TYPE_SELECT_FORCE_CPP03) +#if !defined(ETL_TYPE_SELECT_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* TEST(test_type_select_t_8) { @@ -144,7 +144,7 @@ namespace CHECK(!(etl::is_same, typename Types16::select<15>::type>::value)); } -#if !defined(ETL_TYPE_SELECT_FORCE_CPP03) +#if !defined(ETL_TYPE_SELECT_FORCE_CPP03_IMPLEMENTATION) //************************************************************************* TEST(test_type_select_t_16) { diff --git a/test/test_vector_non_trivial.cpp b/test/test_vector_non_trivial.cpp index d620876c..0b6e0729 100644 --- a/test/test_vector_non_trivial.cpp +++ b/test/test_vector_non_trivial.cpp @@ -824,7 +824,7 @@ namespace // So this is only tested on C++11 onwards TEST_FIXTURE(SetupFixture, test_emplace_back_non_const_references) { -#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_VECTOR_FORCE_CPP03) +#if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && !defined(ETL_VECTOR_FORCE_CPP03_IMPLEMENTATION) class Data { public: diff --git a/test/vs2019/etl.vcxproj b/test/vs2019/etl.vcxproj index 87ed565f..4fe89a50 100644 --- a/test/vs2019/etl.vcxproj +++ b/test/vs2019/etl.vcxproj @@ -774,7 +774,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;ETL_FORCE_TEST_CPP03;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;ETL_FORCE_TEST_CPP03_IMPLEMENTATION;%(PreprocessorDefinitions) ../../../unittest-cpp/;../../include;../../test