Make Arduino.h safe to include from C files

This commit is contained in:
me-no-dev 2016-10-26 04:07:52 +03:00
parent bdd98828c7
commit 6465d4fa8e

View File

@ -121,16 +121,6 @@ typedef unsigned int word;
#ifdef __cplusplus #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 "WCharacter.h"
#include "WString.h" #include "WString.h"
@ -144,6 +134,17 @@ typedef unsigned int word;
#include "HardwareSerial.h" #include "HardwareSerial.h"
#include "Esp.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" #include "pins_arduino.h"
#endif /* _ESP32_CORE_ARDUINO_H_ */ #endif /* _ESP32_CORE_ARDUINO_H_ */