Skip to content

Commit 9ba10f2

Browse files
committed
Undefine stdlib's abs
1 parent a1924ed commit 9ba10f2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: cores/arduino/Arduino.h

+7
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ extern "C"{
5454
#define digitalPinToInterrupt(P) ( P )
5555
#endif
5656

57+
// undefine stdlib's abs if encountered
58+
#ifdef abs
59+
#undef abs
60+
#endif // abs
61+
62+
#define abs(x) ((x)>0?(x):-(x))
63+
5764
// Allows publishing the Beta core under samd-beta / arduino organization
5865
#ifndef ARDUINO_ARCH_SAMD
5966
#define ARDUINO_ARCH_SAMD

0 commit comments

Comments
 (0)