diff --git a/extras/tests/FailingBuilds/write_long_long.cpp b/extras/tests/FailingBuilds/write_long_long.cpp index 2213a4dc..ec2d8179 100644 --- a/extras/tests/FailingBuilds/write_long_long.cpp +++ b/extras/tests/FailingBuilds/write_long_long.cpp @@ -9,10 +9,6 @@ # error This test requires sizeof(long) < 8 #endif -#if !ARDUINOJSON_HAS_LONG_LONG -# error This test requires C++11 -#endif - int main() { DynamicJsonDocument doc(1024); doc["dummy"] = static_cast(42); diff --git a/extras/tests/Numbers/convertNumber.cpp b/extras/tests/Numbers/convertNumber.cpp index 3cf795dc..ba47d30f 100644 --- a/extras/tests/Numbers/convertNumber.cpp +++ b/extras/tests/Numbers/convertNumber.cpp @@ -99,7 +99,6 @@ TEST_CASE("canConvertNumber()") { CHECK(canConvertNumber(4.294967296e+9f) == false); } -#if ARDUINOJSON_HAS_LONG_LONG SECTION("float -> int64_t") { CHECK(canConvertNumber(0) == true); CHECK(canConvertNumber(-9.22337204e+18f) == true); @@ -129,5 +128,4 @@ TEST_CASE("canConvertNumber()") { CHECK(canConvertNumber(1.844674407370955166e+19) == false); } -#endif } diff --git a/src/ArduinoJson/Configuration.hpp b/src/ArduinoJson/Configuration.hpp index 72a8b6e4..3ebdab5c 100644 --- a/src/ArduinoJson/Configuration.hpp +++ b/src/ArduinoJson/Configuration.hpp @@ -5,10 +5,8 @@ #pragma once #if __cplusplus >= 201103L -# define ARDUINOJSON_HAS_LONG_LONG 1 # define ARDUINOJSON_HAS_RVALUE_REFERENCES 1 #else -# define ARDUINOJSON_HAS_LONG_LONG 0 # define ARDUINOJSON_HAS_RVALUE_REFERENCES 0 #endif @@ -77,8 +75,7 @@ // Store integral values with long (0) or long long (1) #ifndef ARDUINOJSON_USE_LONG_LONG -# if ARDUINOJSON_HAS_LONG_LONG && defined(__SIZEOF_POINTER__) && \ - __SIZEOF_POINTER__ >= 4 || \ +# if defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ >= 4 || \ defined(_MSC_VER) # define ARDUINOJSON_USE_LONG_LONG 1 # endif diff --git a/src/ArduinoJson/Numbers/JsonInteger.hpp b/src/ArduinoJson/Numbers/JsonInteger.hpp index ccf852bd..494bbfde 100644 --- a/src/ArduinoJson/Numbers/JsonInteger.hpp +++ b/src/ArduinoJson/Numbers/JsonInteger.hpp @@ -21,12 +21,8 @@ typedef unsigned long JsonUInt; } // namespace ARDUINOJSON_NAMESPACE -#if ARDUINOJSON_HAS_LONG_LONG && !ARDUINOJSON_USE_LONG_LONG -# define ARDUINOJSON_ASSERT_INTEGER_TYPE_IS_SUPPORTED(T) \ - static_assert(sizeof(T) <= sizeof(ARDUINOJSON_NAMESPACE::JsonInteger), \ - "To use 64-bit integers with ArduinoJson, you must set " \ - "ARDUINOJSON_USE_LONG_LONG to 1. See " \ - "https://arduinojson.org/v6/api/config/use_long_long/"); -#else -# define ARDUINOJSON_ASSERT_INTEGER_TYPE_IS_SUPPORTED(T) -#endif +#define ARDUINOJSON_ASSERT_INTEGER_TYPE_IS_SUPPORTED(T) \ + static_assert(sizeof(T) <= sizeof(ARDUINOJSON_NAMESPACE::JsonInteger), \ + "To use 64-bit integers with ArduinoJson, you must set " \ + "ARDUINOJSON_USE_LONG_LONG to 1. See " \ + "https://arduinojson.org/v6/api/config/use_long_long/"); diff --git a/src/ArduinoJson/Polyfills/type_traits/is_integral.hpp b/src/ArduinoJson/Polyfills/type_traits/is_integral.hpp index 97d31049..1e201b00 100644 --- a/src/ArduinoJson/Polyfills/type_traits/is_integral.hpp +++ b/src/ArduinoJson/Polyfills/type_traits/is_integral.hpp @@ -23,10 +23,8 @@ struct is_integral : integral_constant::type, unsigned int>::value || is_same::type, signed long>::value || is_same::type, unsigned long>::value || -#if ARDUINOJSON_HAS_LONG_LONG is_same::type, signed long long>::value || is_same::type, unsigned long long>::value || -#endif is_same::type, char>::value || is_same::type, bool>::value> {}; // clang-format on diff --git a/src/ArduinoJson/Polyfills/type_traits/is_signed.hpp b/src/ArduinoJson/Polyfills/type_traits/is_signed.hpp index 9c4f4341..d20a78cc 100644 --- a/src/ArduinoJson/Polyfills/type_traits/is_signed.hpp +++ b/src/ArduinoJson/Polyfills/type_traits/is_signed.hpp @@ -18,9 +18,7 @@ struct is_signed : integral_constant::type, signed short>::value || is_same::type, signed int>::value || is_same::type, signed long>::value || -#if ARDUINOJSON_HAS_LONG_LONG is_same::type, signed long long>::value || -#endif is_same::type, float>::value || is_same::type, double>::value> {}; // clang-format on diff --git a/src/ArduinoJson/Polyfills/type_traits/is_unsigned.hpp b/src/ArduinoJson/Polyfills/type_traits/is_unsigned.hpp index 9dfd6677..90f71fbd 100644 --- a/src/ArduinoJson/Polyfills/type_traits/is_unsigned.hpp +++ b/src/ArduinoJson/Polyfills/type_traits/is_unsigned.hpp @@ -17,9 +17,7 @@ struct is_unsigned : integral_constant::type, unsigned short>::value || is_same::type, unsigned int>::value || is_same::type, unsigned long>::value || -#if ARDUINOJSON_HAS_LONG_LONG is_same::type, unsigned long long>::value || -#endif is_same::type, bool>::value> {}; // clang-format on } // namespace ARDUINOJSON_NAMESPACE diff --git a/src/ArduinoJson/Polyfills/type_traits/make_unsigned.hpp b/src/ArduinoJson/Polyfills/type_traits/make_unsigned.hpp index 9b81071c..cf447997 100644 --- a/src/ArduinoJson/Polyfills/type_traits/make_unsigned.hpp +++ b/src/ArduinoJson/Polyfills/type_traits/make_unsigned.hpp @@ -33,10 +33,8 @@ struct make_unsigned : type_identity {}; template <> struct make_unsigned : type_identity {}; -#if ARDUINOJSON_HAS_LONG_LONG template <> struct make_unsigned : type_identity {}; template <> struct make_unsigned : type_identity {}; -#endif } // namespace ARDUINOJSON_NAMESPACE