Skip to content

Commit b4eb5a3

Browse files
authored
Undefine cstdlib::abs before re-defining it (#34)
Apparently, more recent Arduino versions already have it. Fixes `expected unqualified-id before 'long'` build error. See also #2.
1 parent 201c785 commit b4eb5a3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: cstdlib

+3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ namespace std{
5757
using ::wcstombs;
5858
#endif
5959

60+
// Undefine `abs`, because Arduino already has it.
61+
// https://github.com/maniacbug/StandardCplusplus/issues/2#issuecomment-32912640
62+
#undef abs
6063
inline long abs(long i){
6164
return labs(i);
6265
}

0 commit comments

Comments
 (0)