From 97cd7e90dccf5b47375d7de6434c8fd7d69fbc39 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Sat, 6 Sep 2025 20:49:39 +0100 Subject: [PATCH] Changed #if ETL_USING_STL to #if ETL_USING_STD_OSTREAM around std::basic_ostream Fixed warnings when using ETL_DEBUG_COUNT in non debug build --- include/etl/basic_string.h | 2 +- include/etl/debug_count.h | 20 ++++++++++---------- include/etl/forward_list.h | 4 ++-- include/etl/string_view.h | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/etl/basic_string.h b/include/etl/basic_string.h index 18df56ef..b73df175 100644 --- a/include/etl/basic_string.h +++ b/include/etl/basic_string.h @@ -3173,7 +3173,7 @@ namespace etl ///\return Reference to the output stream, for chaining write operations. ///\ingroup string //*************************************************************************** -#if ETL_USING_STL +#if ETL_USING_STD_OSTREAM template std::basic_ostream > &operator<<(std::basic_ostream > &os, const etl::ibasic_string& str) diff --git a/include/etl/debug_count.h b/include/etl/debug_count.h index 9e15c21a..c589762c 100644 --- a/include/etl/debug_count.h +++ b/include/etl/debug_count.h @@ -158,16 +158,16 @@ inline void swap(etl::debug_count& lhs, etl::debug_count& rhs) } #else - #define ETL_DECLARE_DEBUG_COUNT - #define ETL_SET_DEBUG_COUNT(n) - #define ETL_GET_DEBUG_COUNT - #define ETL_INCREMENT_DEBUG_COUNT - #define ETL_DECREMENT_DEBUG_COUNT - #define ETL_ADD_DEBUG_COUNT(n) - #define ETL_SUBTRACT_DEBUG_COUNT(n) - #define ETL_RESET_DEBUG_COUNT - #define ETL_OBJECT_RESET_DEBUG_COUNT(object) - #define ETL_OBJECT_GET_DEBUG_COUNT(object) +#define ETL_DECLARE_DEBUG_COUNT enum { etl_debug_count_suppressed__ = 0 } +#define ETL_SET_DEBUG_COUNT(n) ((void)0) +#define ETL_GET_DEBUG_COUNT 0 +#define ETL_INCREMENT_DEBUG_COUNT ((void)0) +#define ETL_DECREMENT_DEBUG_COUNT ((void)0) +#define ETL_ADD_DEBUG_COUNT(n) ((void)0) +#define ETL_SUBTRACT_DEBUG_COUNT(n) ((void)0) +#define ETL_RESET_DEBUG_COUNT ((void)0) +#define ETL_OBJECT_RESET_DEBUG_COUNT(object) ((void)0) +#define ETL_OBJECT_GET_DEBUG_COUNT(object) 0 #endif // ETL_DEBUG_COUNT #endif diff --git a/include/etl/forward_list.h b/include/etl/forward_list.h index 13bf1e5d..4af4bd4a 100644 --- a/include/etl/forward_list.h +++ b/include/etl/forward_list.h @@ -352,7 +352,7 @@ namespace etl etl::ipool* p_node_pool; ///< The pool of data nodes used in the list. size_type MAX_SIZE; ///< The maximum size of the forward_list. bool pool_is_shared; ///< If true then the pool is shared between lists. - ETL_DECLARE_DEBUG_COUNT; ///< Internal debugging. + ETL_DECLARE_DEBUG_COUNT; ///< Internal debugging. }; //*************************************************************************** @@ -745,7 +745,7 @@ namespace etl data_node_t* p_data_node = allocate_data_node(); ::new (&(p_data_node->value)) T(); ETL_INCREMENT_DEBUG_COUNT; - insert_node_after(start_node, *p_data_node); + insert_node_after(start_node, *p_data_node); return front(); } diff --git a/include/etl/string_view.h b/include/etl/string_view.h index b16bcba4..0ed1ad85 100644 --- a/include/etl/string_view.h +++ b/include/etl/string_view.h @@ -982,7 +982,7 @@ void swap(etl::basic_string_view >& lhs, etl::basic_strin //************************************************************************* /// Operator overload to write to std basic_ostream //************************************************************************* -#if ETL_USING_STL +#if ETL_USING_STD_OSTREAM template std::basic_ostream > &operator<<(std::basic_ostream > &os, etl::basic_string_view > text)