From 407fc2cd45c7c0c346aba17d66fc9ac38c15dd64 Mon Sep 17 00:00:00 2001 From: Benoit Blanchon Date: Fri, 10 Feb 2023 09:36:18 +0100 Subject: [PATCH] Drop support for C++98/C++03 (closes #1820) --- CHANGELOG.md | 5 +++++ extras/fuzzing/CMakeLists.txt | 3 +++ extras/fuzzing/Makefile | 2 +- src/ArduinoJson.hpp | 4 ++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd4945bc..ea3ce00c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ ArduinoJson: change log ======================= +HEAD +---- + +* Drop support for C++98/C++03. Minimum required is C++11. + v6.20.1 (2023-02-08) ------- diff --git a/extras/fuzzing/CMakeLists.txt b/extras/fuzzing/CMakeLists.txt index 4800704d..3cdc7e51 100644 --- a/extras/fuzzing/CMakeLists.txt +++ b/extras/fuzzing/CMakeLists.txt @@ -2,6 +2,9 @@ # Copyright © 2014-2022, Benoit BLANCHON # MIT License +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + if(MSVC) add_compile_options(-D_CRT_SECURE_NO_WARNINGS) endif() diff --git a/extras/fuzzing/Makefile b/extras/fuzzing/Makefile index d3c574e1..81fc4125 100644 --- a/extras/fuzzing/Makefile +++ b/extras/fuzzing/Makefile @@ -1,6 +1,6 @@ # CAUTION: this file is invoked by https://github.com/google/oss-fuzz -CXXFLAGS += -I../../src -DARDUINOJSON_DEBUG=1 +CXXFLAGS += -I../../src -DARDUINOJSON_DEBUG=1 -std=c++11 all: \ $(OUT)/json_fuzzer \ diff --git a/src/ArduinoJson.hpp b/src/ArduinoJson.hpp index 3a490f33..31909c45 100644 --- a/src/ArduinoJson.hpp +++ b/src/ArduinoJson.hpp @@ -4,6 +4,10 @@ #pragma once +#if __cplusplus < 201103L && (!defined(_MSC_VER) || _MSC_VER < 1910) +# error ArduinoJson requires C++11 or newer. Configure your compiler for C++11 or downgrade ArduinoJson to 6.20. +#endif + #include "ArduinoJson/Configuration.hpp" // Include Arduino.h before stdlib.h to avoid conflict with atexit()