Skip to content

Commit 093471f

Browse files
authored
Merge pull request esp8266#4 from esp8266/master
fix _min and _max macros (esp8266#6374)
2 parents 27f8893 + 55539ae commit 093471f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cores/esp8266/Arduino.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ using std::max;
251251
using std::isinf;
252252
using std::isnan;
253253

254-
#define _min(a,b) ((a)<(b)?(a):(b))
255-
#define _max(a,b) ((a)>(b)?(a):(b))
254+
#define _min(a,b) ({ decltype(a) _a = (a); decltype(b) _b = (b); _a < _b? _a : _b; })
255+
#define _max(a,b) ({ decltype(a) _a = (a); decltype(b) _b = (b); _a > _b? _a : _b; })
256256

257257
uint16_t makeWord(uint16_t w);
258258
uint16_t makeWord(byte h, byte l);

0 commit comments

Comments
 (0)