mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Allow using PROGMEM outside of Arduino (fixes #1903)
This commit is contained in:
		| @@ -13,7 +13,8 @@ | ||||
| // Include Arduino.h before stdlib.h to avoid conflict with atexit() | ||||
| // https://github.com/bblanchon/ArduinoJson/pull/1693#issuecomment-1001060240 | ||||
| #if ARDUINOJSON_ENABLE_ARDUINO_STRING || ARDUINOJSON_ENABLE_ARDUINO_STREAM || \ | ||||
|     ARDUINOJSON_ENABLE_ARDUINO_PRINT || ARDUINOJSON_ENABLE_PROGMEM | ||||
|     ARDUINOJSON_ENABLE_ARDUINO_PRINT ||                                       \ | ||||
|     (ARDUINOJSON_ENABLE_PROGMEM && defined(ARDUINO)) | ||||
| #  include <Arduino.h> | ||||
| #endif | ||||
|  | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|  | ||||
| #pragma once | ||||
|  | ||||
| #include <Arduino.h> | ||||
| #include <ArduinoJson/Polyfills/pgmspace.hpp> | ||||
|  | ||||
| ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE | ||||
|  | ||||
|   | ||||
| @@ -4,7 +4,13 @@ | ||||
|  | ||||
| #pragma once | ||||
|  | ||||
| #include <Arduino.h> | ||||
| #ifdef ARDUINO | ||||
| #  include <Arduino.h> | ||||
| #else | ||||
| // Allow using PROGMEM outside of Arduino (issue #1903) | ||||
| class __FlashStringHelper; | ||||
| #  include <avr/pgmspace.h> | ||||
| #endif | ||||
|  | ||||
| #include <ArduinoJson/Configuration.hpp> | ||||
| #include <ArduinoJson/Namespace.hpp> | ||||
|   | ||||
| @@ -4,8 +4,6 @@ | ||||
|  | ||||
| #pragma once | ||||
|  | ||||
| #include <Arduino.h> | ||||
|  | ||||
| #include <ArduinoJson/Polyfills/pgmspace.hpp> | ||||
| #include <ArduinoJson/Strings/StringAdapter.hpp> | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user