diff --git a/include/etl/alignment.h b/include/etl/alignment.h index 1867874b..e7f1bb9d 100644 --- a/include/etl/alignment.h +++ b/include/etl/alignment.h @@ -116,7 +116,7 @@ namespace etl template operator T& () { - STATIC_ASSERT((etl::is_same:: value || ((ALIGNMENT % etl::alignment_of::value) == 0)), "Incompatible alignment"); + ETL_STATIC_ASSERT((etl::is_same:: value || ((ALIGNMENT % etl::alignment_of::value) == 0)), "Incompatible alignment"); T* t = *this; return *t; } @@ -125,7 +125,7 @@ namespace etl template operator const T& () const { - STATIC_ASSERT((etl::is_same:: value || ((ALIGNMENT % etl::alignment_of::value) == 0)), "Incompatible alignment"); + ETL_STATIC_ASSERT((etl::is_same:: value || ((ALIGNMENT % etl::alignment_of::value) == 0)), "Incompatible alignment"); const T* t = *this; return *t; } @@ -134,7 +134,7 @@ namespace etl template operator T* () { - STATIC_ASSERT((etl::is_same:: value || ((ALIGNMENT % etl::alignment_of::value) == 0)), "Incompatible alignment"); + ETL_STATIC_ASSERT((etl::is_same:: value || ((ALIGNMENT % etl::alignment_of::value) == 0)), "Incompatible alignment"); return reinterpret_cast(data); } @@ -142,7 +142,7 @@ namespace etl template operator const T* () const { - STATIC_ASSERT((etl::is_same:: value || ((ALIGNMENT % etl::alignment_of::value) == 0)), "Incompatible alignment"); + ETL_STATIC_ASSERT((etl::is_same:: value || ((ALIGNMENT % etl::alignment_of::value) == 0)), "Incompatible alignment"); return reinterpret_cast(data); } @@ -150,7 +150,7 @@ namespace etl template T& get_reference() { - STATIC_ASSERT((etl::is_same:: value || ((ALIGNMENT % etl::alignment_of::value) == 0)), "Incompatible alignment"); + ETL_STATIC_ASSERT((etl::is_same:: value || ((ALIGNMENT % etl::alignment_of::value) == 0)), "Incompatible alignment"); T* t = *this; return *t; } @@ -159,7 +159,7 @@ namespace etl template const T& get_reference() const { - STATIC_ASSERT((etl::is_same:: value || ((ALIGNMENT % etl::alignment_of::value) == 0)), "Incompatible alignment"); + ETL_STATIC_ASSERT((etl::is_same:: value || ((ALIGNMENT % etl::alignment_of::value) == 0)), "Incompatible alignment"); const T* t = *this; return *t; } @@ -168,7 +168,7 @@ namespace etl template T* get_address() { - STATIC_ASSERT((etl::is_same:: value || ((ALIGNMENT % etl::alignment_of::value) == 0)), "Incompatible alignment"); + ETL_STATIC_ASSERT((etl::is_same:: value || ((ALIGNMENT % etl::alignment_of::value) == 0)), "Incompatible alignment"); return reinterpret_cast(data); } @@ -176,7 +176,7 @@ namespace etl template const T* get_address() const { - STATIC_ASSERT((etl::is_same:: value || ((ALIGNMENT % etl::alignment_of::value) == 0)), "Incompatible alignment"); + ETL_STATIC_ASSERT((etl::is_same:: value || ((ALIGNMENT % etl::alignment_of::value) == 0)), "Incompatible alignment"); return reinterpret_cast(data); } diff --git a/include/etl/array.h b/include/etl/array.h index 06c096a7..05393422 100644 --- a/include/etl/array.h +++ b/include/etl/array.h @@ -649,7 +649,7 @@ namespace etl template inline T& get(array& a) { - STATIC_ASSERT(I < MAXN, "Index out of bounds"); + ETL_STATIC_ASSERT(I < MAXN, "Index out of bounds"); return a[I]; } @@ -664,7 +664,7 @@ namespace etl template inline const T& get(const array& a) { - STATIC_ASSERT(I < MAXN, "Index out of bounds"); + ETL_STATIC_ASSERT(I < MAXN, "Index out of bounds"); return a[I]; } } diff --git a/include/etl/atomic/atomic_gcc_sync.h b/include/etl/atomic/atomic_gcc_sync.h index d77046c2..c866d85e 100644 --- a/include/etl/atomic/atomic_gcc_sync.h +++ b/include/etl/atomic/atomic_gcc_sync.h @@ -62,7 +62,7 @@ namespace etl { public: - STATIC_ASSERT(etl::is_integral::value, "Only integral types are supported"); + ETL_STATIC_ASSERT(etl::is_integral::value, "Only integral types are supported"); atomic() : value(0) diff --git a/include/etl/binary.h b/include/etl/binary.h index c9fa2653..cf2a80ef 100644 --- a/include/etl/binary.h +++ b/include/etl/binary.h @@ -108,7 +108,7 @@ namespace etl template T rotate_left(T value) { - STATIC_ASSERT(etl::is_integral::value, "Not an integral type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "Not an integral type"); const size_t SHIFT = etl::integral_limits::type>::bits - 1; @@ -121,7 +121,7 @@ namespace etl template T rotate_left(T value, size_t distance) { - STATIC_ASSERT(etl::is_integral::value, "Not an integral type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "Not an integral type"); const size_t BITS = etl::integral_limits::type>::bits; distance %= BITS; @@ -136,7 +136,7 @@ namespace etl template T rotate_right(T value) { - STATIC_ASSERT(etl::is_integral::value, "Not an integral type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "Not an integral type"); const size_t SHIFT = etl::integral_limits::type>::bits - 1; @@ -149,7 +149,7 @@ namespace etl template T rotate_right(T value, size_t distance) { - STATIC_ASSERT(etl::is_integral::value, "Not an integral type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "Not an integral type"); const size_t BITS = etl::integral_limits::type>::bits; distance %= BITS; @@ -165,7 +165,7 @@ namespace etl template T rotate(T value, typename etl::make_signed::type distance) { - STATIC_ASSERT(etl::is_integral::value, "Not an integral type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "Not an integral type"); T result; @@ -215,7 +215,7 @@ namespace etl template T binary_to_gray(T value) { - STATIC_ASSERT(etl::is_integral::value, "Not an integral type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "Not an integral type"); return (value >> 1) ^ value; } @@ -268,7 +268,7 @@ namespace etl template TReturn fold_bits(TValue value) { - STATIC_ASSERT(integral_limits::bits >= NBITS, "Return type too small to hold result"); + ETL_STATIC_ASSERT(integral_limits::bits >= NBITS, "Return type too small to hold result"); const TValue mask = etl::power<2, NBITS>::value - 1; const size_t shift = NBITS; @@ -296,10 +296,10 @@ namespace etl template TReturn sign_extend(TValue value) { - STATIC_ASSERT(etl::is_integral::value, "TValue not an integral type"); - STATIC_ASSERT(etl::is_integral::value, "TReturn not an integral type"); - STATIC_ASSERT(etl::is_signed::value, "TReturn not a signed type"); - STATIC_ASSERT(NBITS <= std::numeric_limits::digits, "NBITS too large for return type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "TValue not an integral type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "TReturn not an integral type"); + ETL_STATIC_ASSERT(etl::is_signed::value, "TReturn not a signed type"); + ETL_STATIC_ASSERT(NBITS <= std::numeric_limits::digits, "NBITS too large for return type"); struct S { @@ -317,11 +317,11 @@ namespace etl template TReturn sign_extend(TValue value) { - STATIC_ASSERT(etl::is_integral::value, "TValue not an integral type"); - STATIC_ASSERT(etl::is_integral::value, "TReturn not an integral type"); - STATIC_ASSERT(etl::is_signed::value, "TReturn not a signed type"); - STATIC_ASSERT(NBITS <= std::numeric_limits::digits, "NBITS too large for return type"); - STATIC_ASSERT(SHIFT <= std::numeric_limits::digits, "SHIFT too large"); + ETL_STATIC_ASSERT(etl::is_integral::value, "TValue not an integral type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "TReturn not an integral type"); + ETL_STATIC_ASSERT(etl::is_signed::value, "TReturn not a signed type"); + ETL_STATIC_ASSERT(NBITS <= std::numeric_limits::digits, "NBITS too large for return type"); + ETL_STATIC_ASSERT(SHIFT <= std::numeric_limits::digits, "SHIFT too large"); struct S { @@ -338,9 +338,9 @@ namespace etl template TReturn sign_extend(TValue value, const size_t NBITS) { - STATIC_ASSERT(etl::is_integral::value, "TValue not an integral type"); - STATIC_ASSERT(etl::is_integral::value, "TReturn not an integral type"); - STATIC_ASSERT(etl::is_signed::value, "TReturn not a signed type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "TValue not an integral type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "TReturn not an integral type"); + ETL_STATIC_ASSERT(etl::is_signed::value, "TReturn not a signed type"); ETL_ASSERT((NBITS <= std::numeric_limits::digits), ETL_ERROR(binary_out_of_range)); @@ -358,9 +358,9 @@ namespace etl template TReturn sign_extend(TValue value, const size_t NBITS, const size_t SHIFT) { - STATIC_ASSERT(etl::is_integral::value, "TValue not an integral type"); - STATIC_ASSERT(etl::is_integral::value, "TReturn not an integral type"); - STATIC_ASSERT(etl::is_signed::value, "TReturn not a signed type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "TValue not an integral type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "TReturn not an integral type"); + ETL_STATIC_ASSERT(etl::is_signed::value, "TReturn not a signed type"); ETL_ASSERT((NBITS <= std::numeric_limits::digits), ETL_ERROR(binary_out_of_range)); @@ -443,8 +443,8 @@ namespace etl { private: - STATIC_ASSERT(sizeof(TResult) >= sizeof(TValue), "Result must be at least as large as the fill value"); - STATIC_ASSERT(VALUE <= etl::integral_limits::type>::max, "Value is too large for specified type"); + ETL_STATIC_ASSERT(sizeof(TResult) >= sizeof(TValue), "Result must be at least as large as the fill value"); + ETL_STATIC_ASSERT(VALUE <= etl::integral_limits::type>::max, "Value is too large for specified type"); typedef typename etl::make_unsigned::type unsigned_r_t; typedef typename etl::make_unsigned::type unsigned_v_t; @@ -472,7 +472,7 @@ namespace etl template static TResult value(TValue value) { - STATIC_ASSERT(sizeof(TResult) >= sizeof(TValue), "Result must be at least as large as the fill value"); + ETL_STATIC_ASSERT(sizeof(TResult) >= sizeof(TValue), "Result must be at least as large as the fill value"); typedef typename etl::make_unsigned::type unsigned_v_t; diff --git a/include/etl/callback_timer.h b/include/etl/callback_timer.h index 2547e346..3a829833 100644 --- a/include/etl/callback_timer.h +++ b/include/etl/callback_timer.h @@ -669,7 +669,7 @@ namespace etl { public: - STATIC_ASSERT(MAX_TIMERS_ <= 254, "No more than 254 timers are allowed"); + ETL_STATIC_ASSERT(MAX_TIMERS_ <= 254, "No more than 254 timers are allowed"); //******************************************* /// Constructor. diff --git a/include/etl/frame_check_sequence.h b/include/etl/frame_check_sequence.h index 093a93c9..f54dc72c 100644 --- a/include/etl/frame_check_sequence.h +++ b/include/etl/frame_check_sequence.h @@ -34,7 +34,7 @@ SOFTWARE. #include "type_traits.h" #include "binary.h" -STATIC_ASSERT(ETL_8BIT_SUPPORT, "This file does not currently support targets with no 8bit type"); +ETL_STATIC_ASSERT(ETL_8BIT_SUPPORT, "This file does not currently support targets with no 8bit type"); ///\defgroup frame_check_sequence Frame check sequence calculation ///\ingroup maths @@ -54,7 +54,7 @@ namespace etl typedef TPolicy policy_type; typedef typename policy_type::value_type value_type; - STATIC_ASSERT(etl::is_unsigned::value, "Signed frame check type not supported"); + ETL_STATIC_ASSERT(etl::is_unsigned::value, "Signed frame check type not supported"); //************************************************************************* /// Default constructor. @@ -72,7 +72,7 @@ namespace etl template frame_check_sequence(TIterator begin, const TIterator end) { - STATIC_ASSERT(sizeof(typename std::iterator_traits::value_type) == 1, "Type not supported"); + ETL_STATIC_ASSERT(sizeof(typename std::iterator_traits::value_type) == 1, "Type not supported"); reset(); add(begin, end); @@ -94,7 +94,7 @@ namespace etl template void add(TIterator begin, const TIterator end) { - STATIC_ASSERT(sizeof(typename std::iterator_traits::value_type) == 1, "Type not supported"); + ETL_STATIC_ASSERT(sizeof(typename std::iterator_traits::value_type) == 1, "Type not supported"); while (begin != end) { diff --git a/include/etl/hash.h b/include/etl/hash.h index 61b19b81..42c2b2a0 100644 --- a/include/etl/hash.h +++ b/include/etl/hash.h @@ -97,7 +97,7 @@ namespace etl template <> struct hash { - STATIC_ASSERT(sizeof(size_t) >= sizeof(bool), "size_t smaller than type"); + ETL_STATIC_ASSERT(sizeof(size_t) >= sizeof(bool), "size_t smaller than type"); size_t operator ()(bool v) const { @@ -112,7 +112,7 @@ namespace etl template <> struct hash { - STATIC_ASSERT(sizeof(size_t) >= sizeof(char), "size_t smaller than type"); + ETL_STATIC_ASSERT(sizeof(size_t) >= sizeof(char), "size_t smaller than type"); size_t operator ()(char v) const { @@ -127,7 +127,7 @@ namespace etl template<> struct hash { - STATIC_ASSERT(sizeof(size_t) >= sizeof(signed char), "size_t smaller than type"); + ETL_STATIC_ASSERT(sizeof(size_t) >= sizeof(signed char), "size_t smaller than type"); size_t operator ()(signed char v) const { @@ -142,7 +142,7 @@ namespace etl template<> struct hash { - STATIC_ASSERT(sizeof(size_t) >= sizeof(unsigned char), "size_t smaller than type"); + ETL_STATIC_ASSERT(sizeof(size_t) >= sizeof(unsigned char), "size_t smaller than type"); size_t operator ()(unsigned char v) const { @@ -157,7 +157,7 @@ namespace etl template<> struct hash { - STATIC_ASSERT(sizeof(size_t) >= sizeof(wchar_t), "size_t smaller than type"); + ETL_STATIC_ASSERT(sizeof(size_t) >= sizeof(wchar_t), "size_t smaller than type"); size_t operator ()(wchar_t v) const { @@ -172,7 +172,7 @@ namespace etl template<> struct hash { - STATIC_ASSERT(sizeof(size_t) >= sizeof(short), "size_t smaller than type"); + ETL_STATIC_ASSERT(sizeof(size_t) >= sizeof(short), "size_t smaller than type"); size_t operator ()(short v) const { @@ -187,7 +187,7 @@ namespace etl template<> struct hash { - STATIC_ASSERT(sizeof(size_t) >= sizeof(unsigned short), "size_t smaller than type"); + ETL_STATIC_ASSERT(sizeof(size_t) >= sizeof(unsigned short), "size_t smaller than type"); size_t operator ()(unsigned short v) const { @@ -202,7 +202,7 @@ namespace etl template<> struct hash { - STATIC_ASSERT(sizeof(size_t) >= sizeof(int), "size_t smaller than type"); + ETL_STATIC_ASSERT(sizeof(size_t) >= sizeof(int), "size_t smaller than type"); size_t operator ()(int v) const { @@ -217,7 +217,7 @@ namespace etl template<> struct hash { - STATIC_ASSERT(sizeof(size_t) >= sizeof(unsigned int), "size_t smaller than type"); + ETL_STATIC_ASSERT(sizeof(size_t) >= sizeof(unsigned int), "size_t smaller than type"); size_t operator ()(unsigned int v) const { diff --git a/include/etl/largest.h b/include/etl/largest.h index a352a582..4ab26e80 100644 --- a/include/etl/largest.h +++ b/include/etl/largest.h @@ -160,7 +160,7 @@ namespace etl template struct larger_int_type { - STATIC_ASSERT(etl::is_integral::value, "Must be an integral type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "Must be an integral type"); typedef typename etl::smallest_int_for_bits::type>::bits + 1>::type type; }; @@ -173,7 +173,7 @@ namespace etl template struct larger_uint_type { - STATIC_ASSERT(etl::is_integral::value, "Must be an integral type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "Must be an integral type"); typedef typename etl::smallest_uint_for_bits::type>::bits + 1>::type type; }; @@ -190,7 +190,7 @@ namespace etl template struct larger_type { - STATIC_ASSERT(etl::is_integral::value, "Must be an integral type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "Must be an integral type"); typedef typename etl::smallest_uint_for_bits::bits + 1>::type type; }; @@ -198,7 +198,7 @@ namespace etl template struct larger_type { - STATIC_ASSERT(etl::is_integral::value, "Must be an integral type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "Must be an integral type"); typedef typename etl::smallest_int_for_bits::bits + 1>::type type; }; diff --git a/include/etl/largest_generator.h b/include/etl/largest_generator.h index 7ac3db53..13b6d58d 100644 --- a/include/etl/largest_generator.h +++ b/include/etl/largest_generator.h @@ -208,7 +208,7 @@ namespace etl template struct larger_int_type { - STATIC_ASSERT(etl::is_integral::value, "Must be an integral type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "Must be an integral type"); typedef typename etl::smallest_int_for_bits::type>::bits + 1>::type type; }; @@ -221,7 +221,7 @@ namespace etl template struct larger_uint_type { - STATIC_ASSERT(etl::is_integral::value, "Must be an integral type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "Must be an integral type"); typedef typename etl::smallest_uint_for_bits::type>::bits + 1>::type type; }; @@ -238,7 +238,7 @@ namespace etl template struct larger_type { - STATIC_ASSERT(etl::is_integral::value, "Must be an integral type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "Must be an integral type"); typedef typename etl::smallest_uint_for_bits::bits + 1>::type type; }; @@ -246,7 +246,7 @@ namespace etl template struct larger_type { - STATIC_ASSERT(etl::is_integral::value, "Must be an integral type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "Must be an integral type"); typedef typename etl::smallest_int_for_bits::bits + 1>::type type; }; diff --git a/include/etl/message_router.h b/include/etl/message_router.h index ff1ba20b..94d6e248 100644 --- a/include/etl/message_router.h +++ b/include/etl/message_router.h @@ -286,7 +286,7 @@ namespace etl template explicit message_packet(const T& msg) { - STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); + ETL_STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); void* p = data; ::new (p) T(static_cast(msg)); @@ -472,7 +472,7 @@ namespace etl template explicit message_packet(const T& msg) { - STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); + ETL_STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); void* p = data; ::new (p) T(static_cast(msg)); @@ -655,7 +655,7 @@ namespace etl template explicit message_packet(const T& msg) { - STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); + ETL_STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); void* p = data; ::new (p) T(static_cast(msg)); @@ -835,7 +835,7 @@ namespace etl template explicit message_packet(const T& msg) { - STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); + ETL_STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); void* p = data; ::new (p) T(static_cast(msg)); @@ -1011,7 +1011,7 @@ namespace etl template explicit message_packet(const T& msg) { - STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); + ETL_STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); void* p = data; ::new (p) T(static_cast(msg)); @@ -1184,7 +1184,7 @@ namespace etl template explicit message_packet(const T& msg) { - STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); + ETL_STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); void* p = data; ::new (p) T(static_cast(msg)); @@ -1354,7 +1354,7 @@ namespace etl template explicit message_packet(const T& msg) { - STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); + ETL_STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); void* p = data; ::new (p) T(static_cast(msg)); @@ -1521,7 +1521,7 @@ namespace etl template explicit message_packet(const T& msg) { - STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); + ETL_STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); void* p = data; ::new (p) T(static_cast(msg)); @@ -1684,7 +1684,7 @@ namespace etl template explicit message_packet(const T& msg) { - STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); + ETL_STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); void* p = data; ::new (p) T(static_cast(msg)); @@ -1844,7 +1844,7 @@ namespace etl template explicit message_packet(const T& msg) { - STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); + ETL_STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); void* p = data; ::new (p) T(static_cast(msg)); @@ -2000,7 +2000,7 @@ namespace etl template explicit message_packet(const T& msg) { - STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); + ETL_STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); void* p = data; ::new (p) T(static_cast(msg)); @@ -2153,7 +2153,7 @@ namespace etl template explicit message_packet(const T& msg) { - STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); + ETL_STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); void* p = data; ::new (p) T(static_cast(msg)); @@ -2302,7 +2302,7 @@ namespace etl template explicit message_packet(const T& msg) { - STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); + ETL_STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); void* p = data; ::new (p) T(static_cast(msg)); @@ -2448,7 +2448,7 @@ namespace etl template explicit message_packet(const T& msg) { - STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); + ETL_STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); void* p = data; ::new (p) T(static_cast(msg)); @@ -2591,7 +2591,7 @@ namespace etl template explicit message_packet(const T& msg) { - STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); + ETL_STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); void* p = data; ::new (p) T(static_cast(msg)); @@ -2731,7 +2731,7 @@ namespace etl template explicit message_packet(const T& msg) { - STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); + ETL_STATIC_ASSERT((etl::is_one_of::value), "Unsupported type for this message packet"); void* p = data; ::new (p) T(static_cast(msg)); diff --git a/include/etl/message_router_generator.h b/include/etl/message_router_generator.h index cc503cca..3edf621b 100644 --- a/include/etl/message_router_generator.h +++ b/include/etl/message_router_generator.h @@ -294,7 +294,7 @@ namespace etl cog.outl(" template ") cog.outl(" explicit message_packet(const T& msg)") cog.outl(" {") - cog.out(" STATIC_ASSERT((etl::is_one_of") cog.outl(" explicit message_packet(const T& msg)") cog.outl(" {") - cog.out(" STATIC_ASSERT((etl::is_one_of::value || etl::is_same::value), "Only 32 & 64 bit types supported"); + ETL_STATIC_ASSERT((etl::is_same::value || etl::is_same::value), "Only 32 & 64 bit types supported"); typedef THash value_type; @@ -81,7 +81,7 @@ namespace etl murmur3(TIterator begin, const TIterator end, value_type seed_ = 0) : seed(seed_) { - STATIC_ASSERT(sizeof(typename std::iterator_traits::value_type) == 1, "Incompatible type"); + ETL_STATIC_ASSERT(sizeof(typename std::iterator_traits::value_type) == 1, "Incompatible type"); reset(); while (begin != end) @@ -119,7 +119,7 @@ namespace etl template void add(TIterator begin, const TIterator end) { - STATIC_ASSERT(sizeof(typename std::iterator_traits::value_type) == 1, "Incompatible type"); + ETL_STATIC_ASSERT(sizeof(typename std::iterator_traits::value_type) == 1, "Incompatible type"); ETL_ASSERT(!is_finalised, ETL_ERROR(hash_finalised)); while (begin != end) diff --git a/include/etl/nullptr.h b/include/etl/nullptr.h index 641b6338..1fd946c6 100644 --- a/include/etl/nullptr.h +++ b/include/etl/nullptr.h @@ -67,14 +67,6 @@ namespace std // Can't take address of nullptr. void operator&() const; }; - - //***************************************************************************** - /// A null pointer. - ///\ingroup nullptr - //***************************************************************************** - #if !defined(ETL_STLPORT) - const nullptr_t nullptr = { }; - #endif } //***************************************************************************** diff --git a/include/etl/packet.h b/include/etl/packet.h index bd9f28f7..5e12c0a5 100644 --- a/include/etl/packet.h +++ b/include/etl/packet.h @@ -62,9 +62,9 @@ namespace etl template explicit packet(const T& value) { - STATIC_ASSERT((etl::is_base_of::value), "Unsupported type"); - STATIC_ASSERT(sizeof(T) <= SIZE, "Unsupported size"); - STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT, "Unsupported alignment"); + ETL_STATIC_ASSERT((etl::is_base_of::value), "Unsupported type"); + ETL_STATIC_ASSERT(sizeof(T) <= SIZE, "Unsupported size"); + ETL_STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT, "Unsupported alignment"); ::new (static_cast(data)) T(value); } @@ -84,9 +84,9 @@ namespace etl template packet& operator =(const T& value) { - STATIC_ASSERT((etl::is_base_of::value), "Unsupported type"); - STATIC_ASSERT(sizeof(T) <= SIZE, "Unsupported size"); - STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT, "Unsupported alignment"); + ETL_STATIC_ASSERT((etl::is_base_of::value), "Unsupported type"); + ETL_STATIC_ASSERT(sizeof(T) <= SIZE, "Unsupported size"); + ETL_STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT, "Unsupported alignment"); static_cast(data)->~TBase(); ::new (static_cast(data)) T(value); diff --git a/include/etl/pearson.h b/include/etl/pearson.h index aef15302..a7ae1829 100644 --- a/include/etl/pearson.h +++ b/include/etl/pearson.h @@ -40,7 +40,7 @@ SOFTWARE. #include "array.h" #include "container.h" -STATIC_ASSERT(ETL_8BIT_SUPPORT, "This file does not currently support targets with no 8bit type"); +ETL_STATIC_ASSERT(ETL_8BIT_SUPPORT, "This file does not currently support targets with no 8bit type"); #if defined(ETL_COMPILER_KEIL) #pragma diag_suppress 1300 @@ -87,7 +87,7 @@ namespace etl pearson(TIterator begin, const TIterator end) : first(true) { - STATIC_ASSERT(sizeof(typename std::iterator_traits::value_type) == 1, "Type not supported"); + ETL_STATIC_ASSERT(sizeof(typename std::iterator_traits::value_type) == 1, "Type not supported"); reset(); add(begin, end); @@ -109,7 +109,7 @@ namespace etl template void add(TIterator begin, const TIterator end) { - STATIC_ASSERT(sizeof(typename std::iterator_traits::value_type) == 1, "Type not supported"); + ETL_STATIC_ASSERT(sizeof(typename std::iterator_traits::value_type) == 1, "Type not supported"); while (begin != end) { diff --git a/include/etl/pool.h b/include/etl/pool.h index e110fa43..57ad5940 100644 --- a/include/etl/pool.h +++ b/include/etl/pool.h @@ -494,8 +494,8 @@ namespace etl template U* allocate() { - STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT_, "Type has incompatible alignment"); - STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); + ETL_STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT_, "Type has incompatible alignment"); + ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); return ipool::allocate(); } @@ -508,8 +508,8 @@ namespace etl template U* create() { - STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT_, "Type has incompatible alignment"); - STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); + ETL_STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT_, "Type has incompatible alignment"); + ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); return ipool::create(); } @@ -521,8 +521,8 @@ namespace etl template U* create(const T1& value1) { - STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT_, "Type has incompatible alignment"); - STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); + ETL_STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT_, "Type has incompatible alignment"); + ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); return ipool::create(value1); } @@ -534,8 +534,8 @@ namespace etl template U* create(const T1& value1, const T2& value2) { - STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT_, "Type has incompatible alignment"); - STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); + ETL_STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT_, "Type has incompatible alignment"); + ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); return ipool::create(value1, value2); } @@ -547,8 +547,8 @@ namespace etl template U* create(const T1& value1, const T2& value2, const T3& value3) { - STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT_, "Type has incompatible alignment"); - STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); + ETL_STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT_, "Type has incompatible alignment"); + ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); return ipool::create(value1, value2, value3); } @@ -560,8 +560,8 @@ namespace etl template U* create(const T1& value1, const T2& value2, const T3& value3, const T4& value4) { - STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT_, "Type has incompatible alignment"); - STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); + ETL_STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT_, "Type has incompatible alignment"); + ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); return ipool::create(value1, value2, value3, value4); } #else @@ -571,8 +571,8 @@ namespace etl template U* create(Args&&... args) { - STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT_, "Type has incompatible alignment"); - STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); + ETL_STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT_, "Type has incompatible alignment"); + ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); return ipool::create(std::forward(args)...); } #endif @@ -585,8 +585,8 @@ namespace etl template void destroy(const void* const p_object) { - STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT_, "Type has incompatible alignment"); - STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); + ETL_STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT_, "Type has incompatible alignment"); + ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); reinterpret_cast((const_cast(p_object)))->~U(); ipool::release(p_object); } @@ -645,8 +645,8 @@ namespace etl template U* allocate() { - STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT, "Type has incompatible alignment"); - STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); + ETL_STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT, "Type has incompatible alignment"); + ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); return base_t::template allocate(); } @@ -659,8 +659,8 @@ namespace etl template U* create() { - STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT, "Type has incompatible alignment"); - STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); + ETL_STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT, "Type has incompatible alignment"); + ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); return base_t::template create(); } @@ -672,8 +672,8 @@ namespace etl template U* create(const T1& value1) { - STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT, "Type has incompatible alignment"); - STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); + ETL_STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT, "Type has incompatible alignment"); + ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); return base_t::template create(value1); } @@ -685,8 +685,8 @@ namespace etl template U* create(const T1& value1, const T2& value2) { - STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT, "Type has incompatible alignment"); - STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); + ETL_STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT, "Type has incompatible alignment"); + ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); return base_t::template create(value1, value2); } @@ -698,8 +698,8 @@ namespace etl template U* create(const T1& value1, const T2& value2, const T3& value3) { - STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT, "Type has incompatible alignment"); - STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); + ETL_STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT, "Type has incompatible alignment"); + ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); return base_t::template create(value1, value2, value3); } @@ -711,8 +711,8 @@ namespace etl template U* create(const T1& value1, const T2& value2, const T3& value3, const T4& value4) { - STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT, "Type has incompatible alignment"); - STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); + ETL_STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT, "Type has incompatible alignment"); + ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); return base_t::template create(value1, value2, value3, value4); } #else @@ -724,8 +724,8 @@ namespace etl template U* create(Args&&... args) { - STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT, "Type has incompatible alignment"); - STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); + ETL_STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT, "Type has incompatible alignment"); + ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); return base_t::template create(std::forward(args)...); } #endif @@ -738,8 +738,8 @@ namespace etl template void destroy(const void* const p_object) { - STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT, "Type has incompatible alignment"); - STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); + ETL_STATIC_ASSERT(etl::alignment_of::value <= ALIGNMENT, "Type has incompatible alignment"); + ETL_STATIC_ASSERT(sizeof(U) <= TYPE_SIZE, "Type too large for pool"); reinterpret_cast((const_cast(p_object)))->~U(); base_t::release(p_object); } diff --git a/include/etl/reference_flat_map.h b/include/etl/reference_flat_map.h index e76ccfd6..339a8fb3 100644 --- a/include/etl/reference_flat_map.h +++ b/include/etl/reference_flat_map.h @@ -522,7 +522,7 @@ namespace etl template void assign(TIterator first, TIterator last) { - STATIC_ASSERT((etl::is_same::value_type>::value), "Incompatible data for assign"); + ETL_STATIC_ASSERT((etl::is_same::value_type>::value), "Incompatible data for assign"); #if defined(ETL_DEBUG) difference_type d = std::distance(first, last); diff --git a/include/etl/static_assert.h b/include/etl/static_assert.h index af3d76a1..4d09cbb9 100644 --- a/include/etl/static_assert.h +++ b/include/etl/static_assert.h @@ -26,26 +26,26 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************************/ -#ifndef ETL_STATIC_ASSERT_INCLUDED -#define ETL_STATIC_ASSERT_INCLUDED +#ifndef ETL_ETL_STATIC_ASSERT_INCLUDED +#define ETL_ETL_STATIC_ASSERT_INCLUDED #include "platform.h" #if (ETL_CPP11_SUPPORTED) - #define STATIC_ASSERT(Condition, Message) static_assert(Condition, Message) + #define ETL_STATIC_ASSERT(Condition, Message) static_assert(Condition, Message) #else template - struct STATIC_ASSERT_FAILED; + struct ETL_ETL_STATIC_ASSERT_FAILED; template <> - struct STATIC_ASSERT_FAILED {}; + struct ETL_ETL_STATIC_ASSERT_FAILED {}; #define ETL_SA1(a,b) a##b #define ETL_SA2(a,b) ETL_SA1(a,b) - #define STATIC_ASSERT(Condition, Message) \ + #define ETL_STATIC_ASSERT(Condition, Message) \ enum \ { \ - ETL_SA2(dummy, __LINE__) = sizeof(STATIC_ASSERT_FAILED<(bool)(Condition)>) \ + ETL_SA2(dummy, __LINE__) = sizeof(ETL_ETL_STATIC_ASSERT_FAILED<(bool)(Condition)>) \ } #endif diff --git a/include/etl/type_lookup.h b/include/etl/type_lookup.h index 30e4932e..4470f3f4 100644 --- a/include/etl/type_lookup.h +++ b/include/etl/type_lookup.h @@ -122,7 +122,7 @@ namespace etl ::type>::type>::type>::type> ::type>::type>::type>::type type; - STATIC_ASSERT(!(etl::is_same, type>::value), "Invalid id"); + ETL_STATIC_ASSERT(!(etl::is_same, type>::value), "Invalid id"); }; //************************************ @@ -156,7 +156,7 @@ namespace etl (unsigned int) UNKNOWN }; - STATIC_ASSERT(((unsigned int)value != (unsigned int)UNKNOWN), "Invalid type"); + ETL_STATIC_ASSERT(((unsigned int)value != (unsigned int)UNKNOWN), "Invalid type"); }; //************************************ @@ -221,7 +221,7 @@ namespace etl etl::null_type<0>>::type>::type>::type>::type>::type>::type>::type>::type> ::type>::type>::type>::type>::type>::type>::type>::type type; - STATIC_ASSERT(!(etl::is_same, type>::value), "Invalid type"); + ETL_STATIC_ASSERT(!(etl::is_same, type>::value), "Invalid type"); }; }; } diff --git a/include/etl/type_lookup_generator.h b/include/etl/type_lookup_generator.h index 398773bd..b003a746 100644 --- a/include/etl/type_lookup_generator.h +++ b/include/etl/type_lookup_generator.h @@ -116,7 +116,7 @@ namespace etl cog.outl("") cog.out(" ") cog.outl("") - cog.outl(" STATIC_ASSERT(!(etl::is_same, type>::value), \"Invalid id\");") + cog.outl(" ETL_STATIC_ASSERT(!(etl::is_same, type>::value), \"Invalid id\");") cog.outl(" };") cog.outl("") cog.outl(" //************************************") @@ -136,7 +136,7 @@ namespace etl cog.outl(" (unsigned int) UNKNOWN") cog.outl(" };") cog.outl("") - cog.outl(" STATIC_ASSERT(((unsigned int)value != (unsigned int)UNKNOWN), \"Invalid type\");") + cog.outl(" ETL_STATIC_ASSERT(((unsigned int)value != (unsigned int)UNKNOWN), \"Invalid type\");") cog.outl(" };") cog.outl("") cog.outl(" //************************************") @@ -183,7 +183,7 @@ namespace etl cog.outl("") cog.out(" ") cog.outl("") - cog.outl(" STATIC_ASSERT(!(etl::is_same, type>::value), \"Invalid type\");") + cog.outl(" ETL_STATIC_ASSERT(!(etl::is_same, type>::value), \"Invalid type\");") cog.outl(" };") cog.outl("};") ]]]*/ diff --git a/include/etl/type_select.h b/include/etl/type_select.h index 52c8f5f5..894b642d 100644 --- a/include/etl/type_select.h +++ b/include/etl/type_select.h @@ -93,7 +93,7 @@ namespace etl ::type>::type>::type>::type>::type>::type>::type>::type> ::type>::type>::type>::type>::type>::type>::type>::type type; - STATIC_ASSERT(ID < 16, "Invalid ID"); + ETL_STATIC_ASSERT(ID < 16, "Invalid ID"); }; }; @@ -140,7 +140,7 @@ namespace etl ::type>::type>::type>::type>::type>::type>::type>::type> ::type>::type>::type>::type>::type>::type>::type type; - STATIC_ASSERT(ID < 15, "Invalid ID"); + ETL_STATIC_ASSERT(ID < 15, "Invalid ID"); }; }; @@ -185,7 +185,7 @@ namespace etl ::type>::type>::type>::type>::type>::type>::type>::type> ::type>::type>::type>::type>::type>::type type; - STATIC_ASSERT(ID < 14, "Invalid ID"); + ETL_STATIC_ASSERT(ID < 14, "Invalid ID"); }; }; @@ -228,7 +228,7 @@ namespace etl ::type>::type>::type>::type>::type>::type>::type>::type> ::type>::type>::type>::type>::type type; - STATIC_ASSERT(ID < 13, "Invalid ID"); + ETL_STATIC_ASSERT(ID < 13, "Invalid ID"); }; }; @@ -269,7 +269,7 @@ namespace etl ::type>::type>::type>::type>::type>::type>::type>::type> ::type>::type>::type>::type type; - STATIC_ASSERT(ID < 12, "Invalid ID"); + ETL_STATIC_ASSERT(ID < 12, "Invalid ID"); }; }; @@ -308,7 +308,7 @@ namespace etl ::type>::type>::type>::type>::type>::type>::type>::type> ::type>::type>::type type; - STATIC_ASSERT(ID < 11, "Invalid ID"); + ETL_STATIC_ASSERT(ID < 11, "Invalid ID"); }; }; @@ -345,7 +345,7 @@ namespace etl ::type>::type>::type>::type>::type>::type>::type>::type> ::type>::type type; - STATIC_ASSERT(ID < 10, "Invalid ID"); + ETL_STATIC_ASSERT(ID < 10, "Invalid ID"); }; }; @@ -380,7 +380,7 @@ namespace etl ::type>::type>::type>::type>::type>::type>::type>::type> ::type type; - STATIC_ASSERT(ID < 9, "Invalid ID"); + ETL_STATIC_ASSERT(ID < 9, "Invalid ID"); }; }; @@ -412,7 +412,7 @@ namespace etl etl::null_type<0> > ::type>::type>::type>::type>::type>::type>::type>::type type; - STATIC_ASSERT(ID < 8, "Invalid ID"); + ETL_STATIC_ASSERT(ID < 8, "Invalid ID"); }; }; @@ -442,7 +442,7 @@ namespace etl etl::null_type<0> > ::type>::type>::type>::type>::type>::type>::type type; - STATIC_ASSERT(ID < 7, "Invalid ID"); + ETL_STATIC_ASSERT(ID < 7, "Invalid ID"); }; }; @@ -470,7 +470,7 @@ namespace etl etl::null_type<0> > ::type>::type>::type>::type>::type>::type type; - STATIC_ASSERT(ID < 6, "Invalid ID"); + ETL_STATIC_ASSERT(ID < 6, "Invalid ID"); }; }; @@ -496,7 +496,7 @@ namespace etl etl::null_type<0> > ::type>::type>::type>::type>::type type; - STATIC_ASSERT(ID < 5, "Invalid ID"); + ETL_STATIC_ASSERT(ID < 5, "Invalid ID"); }; }; @@ -520,7 +520,7 @@ namespace etl etl::null_type<0> > ::type>::type>::type>::type type; - STATIC_ASSERT(ID < 4, "Invalid ID"); + ETL_STATIC_ASSERT(ID < 4, "Invalid ID"); }; }; @@ -542,7 +542,7 @@ namespace etl etl::null_type<0> > ::type>::type>::type type; - STATIC_ASSERT(ID < 3, "Invalid ID"); + ETL_STATIC_ASSERT(ID < 3, "Invalid ID"); }; }; @@ -562,7 +562,7 @@ namespace etl etl::null_type<0> > ::type>::type type; - STATIC_ASSERT(ID < 2, "Invalid ID"); + ETL_STATIC_ASSERT(ID < 2, "Invalid ID"); }; }; @@ -580,7 +580,7 @@ namespace etl etl::null_type<0> > ::type type; - STATIC_ASSERT(ID < 1, "Invalid ID"); + ETL_STATIC_ASSERT(ID < 1, "Invalid ID"); }; }; } diff --git a/include/etl/type_select_generator.h b/include/etl/type_select_generator.h index e804360b..70880f9c 100644 --- a/include/etl/type_select_generator.h +++ b/include/etl/type_select_generator.h @@ -87,7 +87,7 @@ namespace etl cog.out(" ") cog.outl("::type type;") cog.outl(""); - cog.outl(" STATIC_ASSERT(ID < %s, \"Invalid ID\");" % int(NTypes)); + cog.outl(" ETL_STATIC_ASSERT(ID < %s, \"Invalid ID\");" % int(NTypes)); cog.outl(" };") cog.outl("};") @@ -122,7 +122,7 @@ namespace etl cog.out(" ") cog.outl("::type type;") cog.outl(""); - cog.outl(" STATIC_ASSERT(ID < %s, \"Invalid ID\");" % s); + cog.outl(" ETL_STATIC_ASSERT(ID < %s, \"Invalid ID\");" % s); cog.outl(" };") cog.outl("};") ]]]*/ diff --git a/include/etl/type_traits.h b/include/etl/type_traits.h index 36036944..f0b23bfa 100644 --- a/include/etl/type_traits.h +++ b/include/etl/type_traits.h @@ -327,14 +327,14 @@ namespace etl template struct conditional_integral_constant { - STATIC_ASSERT(etl::is_integral::value, "Not an integral type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "Not an integral type"); static const T value = TRUE_VALUE; }; template struct conditional_integral_constant { - STATIC_ASSERT(etl::is_integral::value, "Not an integral type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "Not an integral type"); static const T value = FALSE_VALUE; }; diff --git a/include/etl/type_traits_generator.h b/include/etl/type_traits_generator.h index 5151b34e..61df9313 100644 --- a/include/etl/type_traits_generator.h +++ b/include/etl/type_traits_generator.h @@ -339,14 +339,14 @@ namespace etl template struct conditional_integral_constant { - STATIC_ASSERT(etl::is_integral::value, "Not an integral type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "Not an integral type"); static const T value = TRUE_VALUE; }; template struct conditional_integral_constant { - STATIC_ASSERT(etl::is_integral::value, "Not an integral type"); + ETL_STATIC_ASSERT(etl::is_integral::value, "Not an integral type"); static const T value = FALSE_VALUE; }; diff --git a/include/etl/variant.h b/include/etl/variant.h index db22a746..a539fe3f 100644 --- a/include/etl/variant.h +++ b/include/etl/variant.h @@ -678,12 +678,12 @@ namespace etl //*************************************************************************** /// Constructor that catches any types that are not supported. - /// Forces a STATIC_ASSERT. + /// Forces a ETL_STATIC_ASSERT. //*************************************************************************** template variant(const T& value) { - STATIC_ASSERT(Type_Is_Supported::value, "Unsupported type"); + ETL_STATIC_ASSERT(Type_Is_Supported::value, "Unsupported type"); ::new (static_cast(data)) T(value); type_id = Type_Id_Lookup::type_id; @@ -718,7 +718,7 @@ namespace etl template T& emplace(const TP1& value1) { - STATIC_ASSERT(Type_Is_Supported::value, "Unsupported type"); + ETL_STATIC_ASSERT(Type_Is_Supported::value, "Unsupported type"); destruct_current(); ::new (static_cast(data)) T(value1); @@ -733,7 +733,7 @@ namespace etl template T& emplace(const TP1& value1, const TP2& value2) { - STATIC_ASSERT(Type_Is_Supported::value, "Unsupported type"); + ETL_STATIC_ASSERT(Type_Is_Supported::value, "Unsupported type"); destruct_current(); ::new (static_cast(data)) T(value1, value2); @@ -748,7 +748,7 @@ namespace etl template T& emplace(const TP1& value1, const TP2& value2, const TP3& value3) { - STATIC_ASSERT(Type_Is_Supported::value, "Unsupported type"); + ETL_STATIC_ASSERT(Type_Is_Supported::value, "Unsupported type"); destruct_current(); ::new (static_cast(data)) T(value1, value2, value3); @@ -763,7 +763,7 @@ namespace etl template T& emplace(const TP1& value1, const TP2& value2, const TP3& value3, const TP4& value4) { - STATIC_ASSERT(Type_Is_Supported::value, "Unsupported type"); + ETL_STATIC_ASSERT(Type_Is_Supported::value, "Unsupported type"); destruct_current(); ::new (static_cast(data)) T(value1, value2, value3, value4); @@ -779,7 +779,7 @@ namespace etl template T& emplace(Args&&... args) { - STATIC_ASSERT(Type_Is_Supported::value, "Unsupported type"); + ETL_STATIC_ASSERT(Type_Is_Supported::value, "Unsupported type"); destruct_current(); ::new (static_cast(data)) T(std::forward(args)...); @@ -796,7 +796,7 @@ namespace etl template variant& operator =(const T& value) { - STATIC_ASSERT(Type_Is_Supported::value, "Unsupported type"); + ETL_STATIC_ASSERT(Type_Is_Supported::value, "Unsupported type"); destruct_current(); ::new (static_cast(data)) T(value); @@ -933,7 +933,7 @@ namespace etl template T& get() { - STATIC_ASSERT(Type_Is_Supported::value, "Unsupported type"); + ETL_STATIC_ASSERT(Type_Is_Supported::value, "Unsupported type"); ETL_ASSERT(is_type(), ETL_ERROR(variant_incorrect_type_exception)); return static_cast(data); @@ -947,7 +947,7 @@ namespace etl template const T& get() const { - STATIC_ASSERT(Type_Is_Supported::value, "Unsupported type"); + ETL_STATIC_ASSERT(Type_Is_Supported::value, "Unsupported type"); ETL_ASSERT(is_type(), ETL_ERROR(variant_incorrect_type_exception)); return static_cast(data); diff --git a/include/etl/variant_pool.h b/include/etl/variant_pool.h index bc66274a..1c033ce5 100644 --- a/include/etl/variant_pool.h +++ b/include/etl/variant_pool.h @@ -140,7 +140,7 @@ namespace etl template T* create() { - STATIC_ASSERT((etl::is_one_of::value), "Unsupported type"); + ETL_STATIC_ASSERT((etl::is_one_of::value), "Unsupported type"); T* p = nullptr; @@ -167,7 +167,7 @@ namespace etl template T* create(const TP1& p1) { - STATIC_ASSERT((etl::is_one_of::value), "Unsupported type"); + ETL_STATIC_ASSERT((etl::is_one_of::value), "Unsupported type"); T* p = nullptr; @@ -194,7 +194,7 @@ namespace etl template T* create(const TP1& p1, const TP2& p2) { - STATIC_ASSERT((etl::is_one_of::value), "Unsupported type"); + ETL_STATIC_ASSERT((etl::is_one_of::value), "Unsupported type"); T* p = nullptr; @@ -221,7 +221,7 @@ namespace etl template T* create(const TP1& p1, const TP2& p2, const TP3& p3) { - STATIC_ASSERT((etl::is_one_of::value), "Unsupported type"); + ETL_STATIC_ASSERT((etl::is_one_of::value), "Unsupported type"); T* p = nullptr; @@ -248,7 +248,7 @@ namespace etl template T* create(const TP1& p1, const TP2& p2, const TP3& p3, const TP4& p4) { - STATIC_ASSERT((etl::is_one_of::value), "Unsupported type"); + ETL_STATIC_ASSERT((etl::is_one_of::value), "Unsupported type"); T* p = nullptr; @@ -275,7 +275,7 @@ namespace etl template T* create(Args&&... args) { - STATIC_ASSERT((etl::is_one_of::value), "Unsupported type"); + ETL_STATIC_ASSERT((etl::is_one_of::value), "Unsupported type"); T* p = nullptr; @@ -303,7 +303,7 @@ namespace etl template bool destroy(const T* const p) { - STATIC_ASSERT((etl::is_one_of::value || + ETL_STATIC_ASSERT((etl::is_one_of::value || etl::is_base_of::value || etl::is_base_of::value || etl::is_base_of::value || diff --git a/include/etl/variant_pool_generator.h b/include/etl/variant_pool_generator.h index 5c859697..cb357424 100644 --- a/include/etl/variant_pool_generator.h +++ b/include/etl/variant_pool_generator.h @@ -149,7 +149,7 @@ namespace etl { /*[[[cog import cog - cog.out("STATIC_ASSERT((etl::is_one_of void assign(TIterator first, TIterator last) { - STATIC_ASSERT((etl::is_same::type, typename etl::remove_cv::value_type>::type>::value), "Iterator type does not match container type"); + ETL_STATIC_ASSERT((etl::is_same::type, typename etl::remove_cv::value_type>::type>::value), "Iterator type does not match container type"); #if defined(ETL_DEBUG) difference_type d = std::distance(first, last); diff --git a/include/etl/version.h b/include/etl/version.h index 5b4b22be..fb81796b 100644 --- a/include/etl/version.h +++ b/include/etl/version.h @@ -37,10 +37,10 @@ SOFTWARE. /// Definitions of the ETL version ///\ingroup utilities -#define ETL_VERSION "11.11.2" +#define ETL_VERSION "11.12.0" #define ETL_VERSION_MAJOR 11 -#define ETL_VERSION_MINOR 11 -#define ETL_VERSION_PATCH 2 +#define ETL_VERSION_MINOR 12 +#define ETL_VERSION_PATCH 0 #endif diff --git a/src/crc8_ccitt.cpp b/src/crc8_ccitt.cpp index 3ab90ceb..15b80cc9 100644 --- a/src/crc8_ccitt.cpp +++ b/src/crc8_ccitt.cpp @@ -33,7 +33,7 @@ SOFTWARE. #include "platform.h" #include "static_assert.h" -STATIC_ASSERT(ETL_8BIT_SUPPORT, "This file does not currently support targets with no 8bit type"); +ETL_STATIC_ASSERT(ETL_8BIT_SUPPORT, "This file does not currently support targets with no 8bit type"); namespace etl { diff --git a/src/pearson.cpp b/src/pearson.cpp index 94c5ec0f..0852c7e5 100644 --- a/src/pearson.cpp +++ b/src/pearson.cpp @@ -33,7 +33,7 @@ SOFTWARE. #include "platform.h" #include "static_assert.h" -STATIC_ASSERT(ETL_8BIT_SUPPORT, "This file does not currently support targets with no 8bit type"); +ETL_STATIC_ASSERT(ETL_8BIT_SUPPORT, "This file does not currently support targets with no 8bit type"); namespace etl { diff --git a/support/Release notes.txt b/support/Release notes.txt index c182077b..fc86ae10 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,8 @@ +=============================================================================== +11.12.0 +Renamed STATIC_ASSERT to ETL_STATIC_ASSERT +Removed non-conforming std::nullptr + =============================================================================== 11.11.1 Compatibilty changes for Segger IDE, GCC & STLPort