Skip to content

Commit 1d97f0c

Browse files
authored
[core] Avoid re-defining C++ round() method (#321)
1 parent 895b6e8 commit 1d97f0c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cores/common/arduino/src/wiring/wiring_compat.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ extern "C" {
2222
#define voidFuncPtrArg voidFuncPtrParam
2323

2424
// Additional Arduino compatibility macros
25-
#define round(x) ((x) >= 0 ? (long)((x) + 0.5) : (long)((x) - 0.5))
25+
#ifndef __cplusplus
26+
#define round(x) ((x) >= 0 ? (long)((x) + 0.5) : (long)((x) - 0.5))
27+
#endif
2628
#define digitalPinToInterrupt(pin) (pin)
2729

2830
// FreeRTOS utilities

0 commit comments

Comments
 (0)