We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a55fac8 commit 10a44c8Copy full SHA for 10a44c8
cores/rp2040/Arduino.h
@@ -36,6 +36,18 @@
36
37
#include "debug_internal.h"
38
39
+// Try and make the best of the old Arduino abs() macro. When in C++, use
40
+// the sane std::abs() call, but for C code use their macro since stdlib abs()
41
+// is int but their macro "works" for everything (with potential side effects)
42
+#ifdef abs
43
+#undef abs
44
+#endif // abs
45
+#ifdef __cplusplus
46
+using std::abs;
47
+#else
48
+#define abs(x) ((x)>0?(x):-(x))
49
+#endif
50
+
51
#ifdef __cplusplus
52
extern "C"{
53
#endif // __cplusplus
0 commit comments