Bläddra i källkod

Fixed error Pe070 "incomplete type is not allowed" on IAR (fixes #1560)

Benoit Blanchon 4 år sedan
förälder
incheckning
af3bb131c8
3 ändrade filer med 8 tillägg och 4 borttagningar
  1. 1 0
      CHANGELOG.md
  2. 5 0
      src/ArduinoJson/Variant/VariantImpl.hpp
  3. 2 4
      src/ArduinoJson/Variant/VariantRef.hpp

+ 1 - 0
CHANGELOG.md

@@ -5,6 +5,7 @@ HEAD
 ----
 
 * Fixed support for `volatile float` and `volatile double` (issue #1557)
+* Fixed error `[Pe070]: incomplete type is not allowed` on IAR (issue #1560)
 
 v6.18.0 (2021-05-05)
 -------

+ 5 - 0
src/ArduinoJson/Variant/VariantImpl.hpp

@@ -140,4 +140,9 @@ inline VariantConstRef operator|(VariantConstRef preferedValue,
                                  VariantConstRef defaultValue) {
   return preferedValue ? preferedValue : defaultValue;
 }
+
+// Out of class definition to avoid #1560
+inline bool VariantRef::set(char value) const {
+  return set<signed char>(value);
+}
 }  // namespace ARDUINOJSON_NAMESPACE

+ 2 - 4
src/ArduinoJson/Variant/VariantRef.hpp

@@ -88,11 +88,9 @@ class VariantRef : public VariantRefBase<VariantData>,
     return Converter<T>::toJson(value, *this);
   }
 
-  FORCE_INLINE bool ARDUINOJSON_DEPRECATED(
+  bool ARDUINOJSON_DEPRECATED(
       "Support for char is deprecated, use int8_t or uint8_t instead")
-      set(char value) const {
-    return set<signed char>(value);
-  }
+      set(char value) const;
 
   template <typename T>
   FORCE_INLINE bool set(T *value) const {