Просмотр исходного кода

Change the default of `ARDUINOJSON_USE_LONG_LONG` to `1` on 32-bit platforms

Benoit Blanchon 4 лет назад
Родитель
Сommit
e4658e963f
3 измененных файлов с 9 добавлено и 1 удалено
  1. 1 0
      CHANGELOG.md
  2. 1 1
      extras/conf_test/esp8266.cpp
  3. 7 0
      src/ArduinoJson/Configuration.hpp

+ 1 - 0
CHANGELOG.md

@@ -7,6 +7,7 @@ HEAD
 * Remove `ARDUINOJSON_EMBEDDED_MODE` and assume we run on an embedded platform.  
   Dependent settings (like `ARDUINOJSON_DEFAULT_NESTING_LIMIT`) must be set individually.
 * Change the default of `ARDUINOJSON_USE_DOUBLE` to `1`
+* Change the default of `ARDUINOJSON_USE_LONG_LONG` to `1` on 32-bit platforms
 
 v6.18.5 (2021-09-28)
 -------

+ 1 - 1
extras/conf_test/esp8266.cpp

@@ -1,6 +1,6 @@
 #include <ArduinoJson.h>
 
-static_assert(ARDUINOJSON_USE_LONG_LONG == 0, "ARDUINOJSON_USE_LONG_LONG");
+static_assert(ARDUINOJSON_USE_LONG_LONG == 1, "ARDUINOJSON_USE_LONG_LONG");
 
 static_assert(ARDUINOJSON_SLOT_OFFSET_SIZE == 2,
               "ARDUINOJSON_SLOT_OFFSET_SIZE");

+ 7 - 0
src/ArduinoJson/Configuration.hpp

@@ -83,6 +83,13 @@
 
 // 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 ||                              \
+      defined(_MSC_VER)
+#    define ARDUINOJSON_USE_LONG_LONG 1
+#  endif
+#endif
+#ifndef ARDUINOJSON_USE_LONG_LONG
 #  define ARDUINOJSON_USE_LONG_LONG 0
 #endif