Skip to content

Commit a5852a9

Browse files
committed
core: fix abs() misusage
1 parent 2adb071 commit a5852a9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cores/arduino/Arduino.h

+7
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ auto F(T1&& A)
3030
return (const arduino::__FlashStringHelper*)A;
3131
}
3232

33+
// undefine stdlib's abs if encountered
34+
#ifdef abs
35+
#undef abs
36+
#endif // abs
37+
38+
#define abs(x) ((x)>0?(x):-(x))
39+
3340
#endif //__cplusplus
3441

3542
#define interrupts() __enable_irq()

0 commit comments

Comments
 (0)