From e18b7ffa4893aa1011bae52e6e7a8f1bfcc336d5 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 4 Sep 2017 10:52:33 +0200 Subject: [PATCH] stdio.h: Don't define unlocked macros using static inline on C++ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In C++, the usage of static inline functions for getchar_unlocked and putchar_unlocked may result in error messages like error: ‘_putchar_unlocked’ was not declared in this scope Fix this by not using the _getchar_unlocked and _putchar_unlocked macros in C++. Signed-off-by: Corinna Vinschen --- newlib/libc/include/stdio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h index 331a1cf07..ee0f612c4 100644 --- a/newlib/libc/include/stdio.h +++ b/newlib/libc/include/stdio.h @@ -762,12 +762,12 @@ _putchar_unlocked(int _c) #define getchar() _getchar_unlocked() #define putchar(_c) _putchar_unlocked(_c) #endif /* __SINGLE_THREAD__ */ -#endif /* __cplusplus */ #if __MISC_VISIBLE || __POSIX_VISIBLE #define getchar_unlocked() _getchar_unlocked() #define putchar_unlocked(_c) _putchar_unlocked(_c) #endif +#endif /* __cplusplus */ #if __MISC_VISIBLE /* fast always-buffered version, true iff error */