A C++ template library for embedded applications
Designed and maintained by
Aster Consulting Ltd

Macros

Many of the features or options in the ETL can be selected by defining the appropriate macros.
Some macros are defined by the ETL.

User defined

These must be defined in the user created etl_profile.h.
ETL_NO_CHECKS ETL_ASSERT has no effect.
ETL_THROW_EXCEPTIONS
ETL_ASSERT throws the specified exception.
ETL_THROW_EXCEPTIONS + ETL_LOG_ERRORS ETL_ASSERT calls the error handler then throws an exception.
ETL_LOG_ERRORS ETL_ASSERT calls the error handler then asserts.
ETL_LOG_ERRORS + NDEBUG ETL_ASSERT calls the error handler.
ETL_CHECK_PUSH_POP Pushes and pops to containers are checked for bounds.
ETL_VERBOSE_ERRORS If this is defined then error messages and ouputted in their long form.
ETL_BITSET_ELEMENT_TYPE If this is defined, then it will become the type used for elements in the bitset class.
Default is
uint_least8_t
ETL_FSM_STATE_ID_TYPE If this is defined, then it will become the type used for FSM state id numbers.
Default is
uint_least8_t
ETL_MESSAGE_ID_TYPE If this is defined, then it will become the type used for message id numbers.
Default is
uint_least8_t
ETL_TIMER_GUARD_TYPE If this is defined, then it will become the type used for the type for the timer guard variable. This must be a type that cannot be interrupted during a read/modify/write cycle.
Default is
etl::atomic_uint32_t
ETL_ISTRING_REPAIR_ENABLE Define this if you wish to memcpy ETL strings and repair them via an istring pointer or reference.
Warning: This will make the container a virtual class.
ETL_IVECTOR_REPAIR_ENABLE Define this if you wish to memcpy ETL vectors and repair them via an ivector pointer or reference.
Warning: This will make the container a virtual class.
ETL_IDEQUE_REPAIR_ENABLE Define this if you wish to memcpy ETL deques and repair them via an ideque pointer or reference.
Warning: This will make the container a virtual class.
ETL_STLPORT This must be defined in the user library profile when using STLPort as the standard library implementation.
ETL_NO_STL If defined, the ETL will not use definitions from the STL. Instead it will use its own reverse engineered versions .
Do not directly rely on these definitions for your code, the ETL defines only those parts that are necessary to support itself.
ETL_POLYMORPHIC_BITSET
ETL_POLYMORPHIC_DEQUE
ETL_POLYMORPHIC_FLAT_MAP
ETL_POLYMORPHIC_FLAT_MULTIMAP
ETL_POLYMORPHIC_FLAT_SET
ETL_POLYMORPHIC_FLAT_MULTISET
ETL_POLYMORPHIC_FORWARD_LIST
ETL_POLYMORPHIC_LIST
ETL_POLYMORPHIC_MAP
ETL_POLYMORPHIC_MULTIMAP
ETL_POLYMORPHIC_SET
ETL_POLYMORPHIC_MULTISET
ETL_POLYMORPHIC_QUEUE
ETL_POLYMORPHIC_STACK
ETL_POLYMORPHIC_REFERENCE_FLAT_MAP
ETL_POLYMORPHIC_REFERENCE_FLAT_MULTIMAP
ETL_POLYMORPHIC_REFERENCE_FLAT_SET
ETL_POLYMORPHIC_REFERENCE_FLAT_MULTISET
ETL_POLYMORPHIC_UNORDERED_MAP
ETL_POLYMORPHIC_UNORDERED_MULTIMAP
ETL_POLYMORPHIC_UNORDERED_SET
ETL_POLYMORPHIC_UNORDERED_MULTISET
ETL_POLYMORPHIC_STRINGS
ETL_POLYMORPHIC_POOL
ETL_POLYMORPHIC_VECTOR
Defining any one of these will make the corresponding container polymorphic, turning the protected non-virtual destructor to public virtual.
ETL_POLYMORPHIC_CONTAINERS
If defined then all containers are polymorphic.
ETL_MESSAGES_ARE_VIRTUAL
ETL_POLYMORPHIC_MESSAGES
If either is defined then etl::imessage is virtual.
ETL_MESSAGES_ARE_VIRTUAL is deprecated.
ETL defined

Defined in platform.h

 
ETL_DEBUG This is defined as 1 if DEBUG or _DEBUG is defined. Otherwise 0.
ETL_8BIT_SUPPORT This is defined as 1 if the platform supports 8 bit char types. Otherwise 0.
ETL_CONSTEXPR If ETL_CPP11_SUPPORTED is defined as 1 then this macro is defined as constexpr, otherwise defined as blank.
ETL_IF_CONSTEXPR If ETL_CPP17_SUPPORTED is defined as 1 then this macro is defined as constexpr, otherwise defined as blank.

Defined in the profile

 
ETL_CPP11_SUPPORTED This is defined as 1 if the compiler supports C++11.
Otherwise
0.
ETL_CPP14_SUPPORTED This is defined as 1 if the compiler supports C++14.
Otherwise
0.
ETL_CPP17_SUPPORTED This is defined as 1 if the compiler supports C++17.
Otherwise
0. The library does not currently support C++17.
ETL_NO_NULLPTR_SUPPORT
This is defined as 1 if compiler does not support nullptr
Otherwise
0.
ETL_NO_LARGE_CHAR_SUPPORT
This is defined as 1 if the compiler does not support char16_t or char32_t types. Otherwise 0.
ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED This is defined as 1 if compiler supports  the std::is_trivially_xxx set of traits. Otherwise 0.
ETL_ATOMIC_SUPPORTED This is defined as 1 if the compiler supports std::atomic.
Otherwise 0.

ETL_COMPILER_IAR
ETL_COMPILER_KEIL
ETL_COMPILER_GREEN_HILLS
ETL_COMPILER_INTEL
ETL_COMPILER_MICROSOFT
ETL_COMPILER_GCC
ETL_COMPILER_TI
ETL_COMPILER_MICROTEC
ETL_COMPILER_METAWARE_HIGH
ETL_COMPILER_LLVM
ETL_COMPILER_KAI
ETL_COMPILER_COMEAU
ETL_COMPILER_BORLAND
ETL_COMPILER_ARM
ETL_COMPILER_MPW
ETL_COMPILER_GENERIC
One of these will be defined.