Skip to content

Commit 1818da2

Browse files
committed
lib/utils/printf: Fix issue with putchar define for some ports.
1 parent 8ee43e2 commit 1818da2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/utils/printf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "py/formatfloat.h"
3636
#endif
3737

38+
#undef putchar // Some stdlibs have a #define for putchar
3839
int printf(const char *fmt, ...);
3940
int vprintf(const char *fmt, va_list ap);
4041
int putchar(int c);
@@ -72,7 +73,6 @@ int DEBUG_printf(const char *fmt, ...) {
7273
#endif
7374

7475
// need this because gcc optimises printf("%c", c) -> putchar(c), and printf("a") -> putchar('a')
75-
#undef putchar // Some stdlibs have a #define for putchar
7676
int putchar(int c) {
7777
char chr = c;
7878
mp_hal_stdout_tx_strn_cooked(&chr, 1);

0 commit comments

Comments
 (0)