diff --git a/include/etl/stl/alternate/limits.h b/include/etl/stl/alternate/limits.h index dc0f9a21..ec8df96a 100644 --- a/include/etl/stl/alternate/limits.h +++ b/include/etl/stl/alternate/limits.h @@ -51,18 +51,18 @@ namespace etlstd enum float_round_style { - round_indeterminate = -1, - round_toward_zero = 0, - round_to_nearest = 1, - round_toward_infinity = 2, + round_indeterminate = -1, + round_toward_zero = 0, + round_to_nearest = 1, + round_toward_infinity = 2, round_toward_neg_infinity = 3, }; enum float_denorm_style { denorm_indeterminate = -1, - denorm_absent = 0, - denorm_present = 1 + denorm_absent = 0, + denorm_present = 1 }; //*************************************************************************** @@ -76,66 +76,42 @@ namespace etlstd static ETL_CONST int max_digits10 = 0; static ETL_CONST bool is_integer = true; - static ETL_CONST bool is_exact = true; + static ETL_CONST bool is_exact = true; static ETL_CONST int radix = 2; static ETL_CONSTEXPR T epsilon() { return 0; } static ETL_CONSTEXPR T round_error() { return 0; } - static ETL_CONST int digits = (CHAR_BIT * sizeof(T)) - (etl::is_signed::value ? 1 : 0); + static ETL_CONST int digits = (CHAR_BIT * sizeof(T)) - (etl::is_signed::value ? 1 : 0); static ETL_CONST int digits10 = ETL_LOG2(digits); static ETL_CONST bool is_signed = etl::is_signed::value; - static ETL_CONST int min_exponent = 0; + static ETL_CONST int min_exponent = 0; static ETL_CONST int min_exponent10 = 0; - static ETL_CONST int max_exponent = 0; + static ETL_CONST int max_exponent = 0; static ETL_CONST int max_exponent10 = 0; - static ETL_CONST bool has_infinity = false; - static ETL_CONST bool has_quiet_NaN = false; - static ETL_CONST bool has_signaling_NaN = false; + static ETL_CONST bool has_infinity = false; + static ETL_CONST bool has_quiet_NaN = false; + static ETL_CONST bool has_signaling_NaN = false; static ETL_CONST float_denorm_style has_denorm = denorm_absent; - static ETL_CONST bool has_denorm_loss = false; + static ETL_CONST bool has_denorm_loss = false; static ETL_CONSTEXPR T infinity() { return 0; } static ETL_CONSTEXPR T quiet_NaN() { return 0; } static ETL_CONSTEXPR T signaling_NaN() { return 0; } static ETL_CONSTEXPR T denorm_min() { return 0; } - static ETL_CONST bool is_iec559 = false; + static ETL_CONST bool is_iec559 = false; static ETL_CONST bool is_bounded = true; - static ETL_CONST bool is_modulo = etl::is_unsigned::value; + static ETL_CONST bool is_modulo = etl::is_unsigned::value; static ETL_CONST bool traps = false; static ETL_CONST bool tinyness_before = false; static ETL_CONST float_round_style round_style = round_toward_zero; }; - template ETL_CONST bool etl_integral_type::is_specialized; - template ETL_CONST int etl_integral_type::digits; - template ETL_CONST int etl_integral_type::digits10; - template ETL_CONST int etl_integral_type::max_digits10; - template ETL_CONST bool etl_integral_type::is_signed; - template ETL_CONST bool etl_integral_type::is_integer; - template ETL_CONST bool etl_integral_type::is_exact; - template ETL_CONST int etl_integral_type::radix; - template ETL_CONST int etl_integral_type::min_exponent; - template ETL_CONST int etl_integral_type::min_exponent10; - template ETL_CONST int etl_integral_type::max_exponent; - template ETL_CONST int etl_integral_type::max_exponent10; - template ETL_CONST bool etl_integral_type::has_infinity; - template ETL_CONST bool etl_integral_type::has_quiet_NaN; - template ETL_CONST bool etl_integral_type::has_signaling_NaN; - template ETL_CONST float_denorm_style etl_integral_type::has_denorm; - template ETL_CONST bool etl_integral_type::has_denorm_loss; - template ETL_CONST bool etl_integral_type::is_iec559; - template ETL_CONST bool etl_integral_type::is_bounded; - template ETL_CONST bool etl_integral_type::is_modulo; - template ETL_CONST bool etl_integral_type::traps; - template ETL_CONST bool etl_integral_type::tinyness_before; - template ETL_CONST float_round_style etl_integral_type::round_style; - //*************************************************************************** // Base for floating point types. template @@ -144,9 +120,9 @@ namespace etlstd public: static ETL_CONST bool is_specialized = true; - static ETL_CONST bool is_signed = true; + static ETL_CONST bool is_signed = true; static ETL_CONST bool is_integer = false; - static ETL_CONST bool is_exact = false; + static ETL_CONST bool is_exact = false; static ETL_CONST int radix = 2; @@ -170,23 +146,6 @@ namespace etlstd static ETL_CONST float_round_style round_style = round_to_nearest; }; - template ETL_CONST bool etl_floating_point_type::is_specialized; - template ETL_CONST bool etl_floating_point_type::is_signed; - template ETL_CONST bool etl_floating_point_type::is_integer; - template ETL_CONST bool etl_floating_point_type::is_exact; - template ETL_CONST int etl_floating_point_type::radix; - template ETL_CONST bool etl_floating_point_type::has_infinity; - template ETL_CONST bool etl_floating_point_type::has_quiet_NaN; - template ETL_CONST bool etl_floating_point_type::has_signaling_NaN; - template ETL_CONST float_denorm_style etl_floating_point_type::has_denorm; - template ETL_CONST bool etl_floating_point_type::has_denorm_loss; - template ETL_CONST bool etl_floating_point_type::is_iec559; - template ETL_CONST bool etl_floating_point_type::is_bounded; - template ETL_CONST bool etl_floating_point_type::is_modulo; - template ETL_CONST bool etl_floating_point_type::traps; - template ETL_CONST bool etl_floating_point_type::tinyness_before; - template ETL_CONST float_round_style etl_floating_point_type::round_style; - //*************************************************************************** // Default template @@ -242,30 +201,6 @@ namespace etlstd static ETL_CONST float_round_style round_style = round_toward_zero; }; - ETL_CONST bool numeric_limits::is_specialized; - ETL_CONST int numeric_limits::digits; - ETL_CONST int numeric_limits::digits10; - ETL_CONST int numeric_limits::max_digits10; - ETL_CONST bool numeric_limits::is_signed; - ETL_CONST bool numeric_limits::is_integer; - ETL_CONST bool numeric_limits::is_exact; - ETL_CONST int numeric_limits::radix; - ETL_CONST int numeric_limits::min_exponent; - ETL_CONST int numeric_limits::min_exponent10; - ETL_CONST int numeric_limits::max_exponent; - ETL_CONST int numeric_limits::max_exponent10; - ETL_CONST bool numeric_limits::has_infinity; - ETL_CONST bool numeric_limits::has_quiet_NaN; - ETL_CONST bool numeric_limits::has_signaling_NaN; - ETL_CONST float_denorm_style numeric_limits::has_denorm; - ETL_CONST bool numeric_limits::has_denorm_loss; - ETL_CONST bool numeric_limits::is_iec559; - ETL_CONST bool numeric_limits::is_bounded; - ETL_CONST bool numeric_limits::is_modulo; - ETL_CONST bool numeric_limits::traps; - ETL_CONST bool numeric_limits::tinyness_before; - ETL_CONST float_round_style numeric_limits::round_style; - //*************************************************************************** // char template<> @@ -273,9 +208,9 @@ namespace etlstd { public: - static ETL_CONSTEXPR char min() { return CHAR_MIN; } - static ETL_CONSTEXPR char max() { return CHAR_MAX; } - static ETL_CONSTEXPR char lowest() { return CHAR_MIN; } + static ETL_CONSTEXPR char min() { return char(CHAR_MIN); } + static ETL_CONSTEXPR char max() { return char(CHAR_MAX); } + static ETL_CONSTEXPR char lowest() { return char(CHAR_MIN); } }; //*************************************************************************** @@ -302,6 +237,7 @@ namespace etlstd static ETL_CONSTEXPR signed char lowest() { return SCHAR_MIN; } }; +#if (ETL_NO_LARGE_CHAR_SUPPORT == false) //*************************************************************************** // char16_t template<> @@ -325,6 +261,7 @@ namespace etlstd static ETL_CONSTEXPR char32_t max() { return UINT_LEAST32_MAX; } static ETL_CONSTEXPR char32_t lowest() { return 0; } }; +#endif //*************************************************************************** // wchar_t @@ -447,24 +384,16 @@ namespace etlstd static ETL_CONSTEXPR float epsilon() { return FLT_EPSILON; } static ETL_CONSTEXPR float denorm_min() { return FLT_MIN; } - static ETL_CONST int digits = FLT_MANT_DIG; - static ETL_CONST int digits10 = FLT_DIG; + static ETL_CONST int digits = FLT_MANT_DIG; + static ETL_CONST int digits10 = FLT_DIG; static ETL_CONST int max_digits10 = ETL_LOG2(FLT_MANT_DIG) + 2; - static ETL_CONST int min_exponent = FLT_MIN_EXP; + static ETL_CONST int min_exponent = FLT_MIN_EXP; static ETL_CONST int min_exponent10 = FLT_MIN_10_EXP; - static ETL_CONST int max_exponent = FLT_MAX_EXP; + static ETL_CONST int max_exponent = FLT_MAX_EXP; static ETL_CONST int max_exponent10 = FLT_MAX_10_EXP; }; - ETL_CONST int numeric_limits::digits; - ETL_CONST int numeric_limits::max_digits10; - ETL_CONST int numeric_limits::digits10; - ETL_CONST int numeric_limits::min_exponent; - ETL_CONST int numeric_limits::min_exponent10; - ETL_CONST int numeric_limits::max_exponent; - ETL_CONST int numeric_limits::max_exponent10; - //*************************************************************************** // double template<> @@ -478,24 +407,16 @@ namespace etlstd static ETL_CONSTEXPR double epsilon() { return DBL_EPSILON; } static ETL_CONSTEXPR double denorm_min() { return DBL_MIN; } - static ETL_CONST int digits = DBL_MANT_DIG; - static ETL_CONST int digits10 = DBL_DIG; + static ETL_CONST int digits = DBL_MANT_DIG; + static ETL_CONST int digits10 = DBL_DIG; static ETL_CONST int max_digits10 = ETL_LOG2(DBL_MANT_DIG) + 2; - static ETL_CONST int min_exponent = DBL_MIN_EXP; + static ETL_CONST int min_exponent = DBL_MIN_EXP; static ETL_CONST int min_exponent10 = DBL_MIN_10_EXP; - static ETL_CONST int max_exponent = DBL_MAX_EXP; + static ETL_CONST int max_exponent = DBL_MAX_EXP; static ETL_CONST int max_exponent10 = DBL_MAX_10_EXP; }; - ETL_CONST int numeric_limits::digits; - ETL_CONST int numeric_limits::max_digits10; - ETL_CONST int numeric_limits::digits10; - ETL_CONST int numeric_limits::min_exponent; - ETL_CONST int numeric_limits::min_exponent10; - ETL_CONST int numeric_limits::max_exponent; - ETL_CONST int numeric_limits::max_exponent10; - //*************************************************************************** // long double template<> @@ -509,23 +430,15 @@ namespace etlstd static ETL_CONSTEXPR long double epsilon() { return LDBL_EPSILON; } static ETL_CONSTEXPR long double denorm_min() { return LDBL_MIN; } - static ETL_CONST int digits = LDBL_MANT_DIG; - static ETL_CONST int digits10 = LDBL_DIG; + static ETL_CONST int digits = LDBL_MANT_DIG; + static ETL_CONST int digits10 = LDBL_DIG; static ETL_CONST int max_digits10 = ETL_LOG2(LDBL_MANT_DIG) + 2; - static ETL_CONST int min_exponent = LDBL_MIN_EXP; + static ETL_CONST int min_exponent = LDBL_MIN_EXP; static ETL_CONST int min_exponent10 = LDBL_MIN_10_EXP; - static ETL_CONST int max_exponent = LDBL_MAX_EXP; + static ETL_CONST int max_exponent = LDBL_MAX_EXP; static ETL_CONST int max_exponent10 = LDBL_MAX_10_EXP; }; - - ETL_CONST int numeric_limits::digits; - ETL_CONST int numeric_limits::max_digits10; - ETL_CONST int numeric_limits::digits10; - ETL_CONST int numeric_limits::min_exponent; - ETL_CONST int numeric_limits::min_exponent10; - ETL_CONST int numeric_limits::max_exponent; - ETL_CONST int numeric_limits::max_exponent10; } #endif diff --git a/include/etl/version.h b/include/etl/version.h index 3f6458c0..64abbb3b 100644 --- a/include/etl/version.h +++ b/include/etl/version.h @@ -39,7 +39,7 @@ SOFTWARE. #define ETL_VERSION_MAJOR 15 #define ETL_VERSION_MINOR 3 -#define ETL_VERSION_PATCH 0 +#define ETL_VERSION_PATCH 1 #define ETL_VERSION ETL_STRINGIFY(ETL_VERSION_MAJOR) "." ETL_STRINGIFY(ETL_VERSION_MINOR) "." ETL_STRINGIFY(ETL_VERSION_PATCH) #define ETL_VERSION_W ETL_STRINGIFY(ETL_VERSION_MAJOR) L"." ETL_STRINGIFY(ETL_VERSION_MINOR) L"." ETL_STRINGIFY(ETL_VERSION_PATCH) diff --git a/library.json b/library.json index c2e9281e..b2399ec0 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Embedded Template Library", - "version": "15.3.0", + "version": "15.3.1", "authors": { "name": "John Wellbelove", "email": "" diff --git a/library.properties b/library.properties index 0a327d6e..55396e07 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Embedded Template Library -version=15.3.0 +version=15.3.1 author= John Wellbelove maintainer=John Wellbelove license=MIT diff --git a/support/Release notes.txt b/support/Release notes.txt index abc768f1..de5c0872 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,7 @@ +=============================================================================== +15.3.1 +Changes to alternate STL limits.h for ARM5 compiler compatibility + =============================================================================== 15.3.0 Added etl::make_string_with_capacity