diff --git a/CHANGELOG.md b/CHANGELOG.md index e3f837a9..da2af206 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ HEAD ---- * Added `JsonVariant::operator|` to return a default value (see bellow) +* Added a clear error message when compiled as C instead of C++ (issue #629) * Rewrote example `JsonHttpClient.ino` (issue #600) > ### How to use the new feature? diff --git a/src/ArduinoJson.h b/src/ArduinoJson.h index f447e672..287b0482 100644 --- a/src/ArduinoJson.h +++ b/src/ArduinoJson.h @@ -4,6 +4,14 @@ #pragma once +#ifdef __cplusplus + #include "ArduinoJson.hpp" using namespace ArduinoJson; + +#else + +#error ArduinoJson requires a C++ compiler, please change file extension to .cc or .cpp + +#endif