Compare commits

...

3 Commits

Author SHA1 Message Date
733bc4ee82 Set version to 7.4.2 2025-06-20 09:37:14 +02:00
9aa77994b4 Remove sponsor Programming Electronics Academy 2025-06-20 08:43:48 +02:00
f051f8328d Undef true and false macros
Replacing `true` with `1` changes `JsonString("ABC", true)` into `JsonString("ABC", 1)`, so all static strings had a length of 1.

This is a workaround for arduino/ArduinoCore-sam#50
Fixes #2181
2025-06-19 13:59:15 +02:00
11 changed files with 60 additions and 16 deletions

View File

@ -1,6 +1,11 @@
ArduinoJson: change log
=======================
v7.4.2 (2025-06-20)
------
* Fix truncated strings on Arduino Due (issue #2181)
v7.4.1 (2025-04-11)
------

View File

@ -10,7 +10,7 @@ if(ESP_PLATFORM)
return()
endif()
project(ArduinoJson VERSION 7.4.1)
project(ArduinoJson VERSION 7.4.2)
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
include(CTest)

View File

@ -139,11 +139,6 @@ See the [tutorial on arduinojson.org](https://arduinojson.org/v7/doc/serializati
ArduinoJson is thankful to its sponsors. Please give them a visit; they deserve it!
<p>
<a href="https://www.programmingelectronics.com/" rel="sponsored">
<img src="https://arduinojson.org/images/2021/10/programmingeleactronicsacademy.png" alt="Programming Electronics Academy" width="200">
</a>
</p>
<p>
<a href="https://github.com/1technophile" rel="sponsored">
<img alt="1technophile" src="https://avatars.githubusercontent.com/u/12672732?s=40&v=4">

View File

@ -1,4 +1,4 @@
version: 7.4.1.{build}
version: 7.4.2.{build}
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022

View File

@ -29,3 +29,23 @@ set_tests_properties(Misc
PROPERTIES
LABELS "Catch"
)
add_executable(Issue2181
issue2181.cpp # Cannot be linked with other tests
)
set_target_properties(Issue2181 PROPERTIES UNITY_BUILD OFF)
add_test(Issue2181 Issue2181)
set_tests_properties(Issue2181
PROPERTIES
LABELS "Catch"
)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(Issue2181
PRIVATE
-Wno-keyword-macro # keyword is hidden by macro definition
)
endif()

View File

@ -0,0 +1,15 @@
// ArduinoJson - https://arduinojson.org
// Copyright © 2014-2025, Benoit BLANCHON
// MIT License
#define true 0x1
#define false 0x0
#include <ArduinoJson.h>
#include <catch.hpp>
TEST_CASE("Issue #2181") {
JsonDocument doc;
doc["hello"] = "world";
REQUIRE(doc.as<std::string>() == "{\"hello\":\"world\"}");
}

View File

@ -1,7 +1,7 @@
version: "7.4.1"
version: "7.4.2"
description: >-
A simple and efficient JSON library for embedded C++.
★ 6898 stars on GitHub!
★ 6953 stars on GitHub!
Supports serialization, deserialization, MessagePack, streams, filtering, and more.
Fully tested and documented.
url: https://arduinojson.org/

View File

@ -1,13 +1,13 @@
{
"name": "ArduinoJson",
"keywords": "json, rest, http, web",
"description": "A simple and efficient JSON library for embedded C++. ⭐ 6898 stars on GitHub! Supports serialization, deserialization, MessagePack, streams, filtering, and more. Fully tested and documented.",
"description": "A simple and efficient JSON library for embedded C++. ⭐ 6953 stars on GitHub! Supports serialization, deserialization, MessagePack, streams, filtering, and more. Fully tested and documented.",
"homepage": "https://arduinojson.org/?utm_source=meta&utm_medium=library.json",
"repository": {
"type": "git",
"url": "https://github.com/bblanchon/ArduinoJson.git"
},
"version": "7.4.1",
"version": "7.4.2",
"authors": {
"name": "Benoit Blanchon",
"url": "https://blog.benoitblanchon.fr"

View File

@ -1,9 +1,9 @@
name=ArduinoJson
version=7.4.1
version=7.4.2
author=Benoit Blanchon <blog.benoitblanchon.fr>
maintainer=Benoit Blanchon <blog.benoitblanchon.fr>
sentence=A simple and efficient JSON library for embedded C++.
paragraph=⭐ 6898 stars on GitHub! Supports serialization, deserialization, MessagePack, streams, filtering, and more. Fully tested and documented.
paragraph=⭐ 6953 stars on GitHub! Supports serialization, deserialization, MessagePack, streams, filtering, and more. Fully tested and documented.
category=Data Processing
url=https://arduinojson.org/?utm_source=meta&utm_medium=library.properties
architectures=*

View File

@ -26,6 +26,15 @@
# endif
#endif
// Remove true and false macros defined by some cores, such as Arduino Due's
// See issues #2181 and arduino/ArduinoCore-sam#50
#ifdef true
# undef true
#endif
#ifdef false
# undef false
#endif
#include "ArduinoJson/Array/JsonArray.hpp"
#include "ArduinoJson/Object/JsonObject.hpp"
#include "ArduinoJson/Variant/JsonVariantConst.hpp"

View File

@ -4,8 +4,8 @@
#pragma once
#define ARDUINOJSON_VERSION "7.4.1"
#define ARDUINOJSON_VERSION "7.4.2"
#define ARDUINOJSON_VERSION_MAJOR 7
#define ARDUINOJSON_VERSION_MINOR 4
#define ARDUINOJSON_VERSION_REVISION 1
#define ARDUINOJSON_VERSION_MACRO V741
#define ARDUINOJSON_VERSION_REVISION 2
#define ARDUINOJSON_VERSION_MACRO V742