From 6465d4fa8e4e244472b660a1c3e72168d5b5b885 Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Wed, 26 Oct 2016 04:07:52 +0300 Subject: [PATCH] Make Arduino.h safe to include from C files --- cores/esp32/Arduino.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/cores/esp32/Arduino.h b/cores/esp32/Arduino.h index bdfbf5bb..4489fbdb 100644 --- a/cores/esp32/Arduino.h +++ b/cores/esp32/Arduino.h @@ -121,16 +121,6 @@ typedef unsigned int word; #ifdef __cplusplus } -#endif - -#ifndef _GLIBCXX_VECTOR -// arduino is not compatible with std::vector -#define min(a,b) ((a)<(b)?(a):(b)) -#define max(a,b) ((a)>(b)?(a):(b)) -#endif - -#define _min(a,b) ((a)<(b)?(a):(b)) -#define _max(a,b) ((a)>(b)?(a):(b)) #include "WCharacter.h" #include "WString.h" @@ -144,6 +134,17 @@ typedef unsigned int word; #include "HardwareSerial.h" #include "Esp.h" +#endif /* __cplusplus */ + +#ifndef _GLIBCXX_VECTOR +// arduino is not compatible with std::vector +#define min(a,b) ((a)<(b)?(a):(b)) +#define max(a,b) ((a)>(b)?(a):(b)) +#endif + +#define _min(a,b) ((a)<(b)?(a):(b)) +#define _max(a,b) ((a)>(b)?(a):(b)) + #include "pins_arduino.h" #endif /* _ESP32_CORE_ARDUINO_H_ */