public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] stdio.h: Don't define unlocked macros using static inline on C++
@ 2017-09-04  8:54 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2017-09-04  8:54 UTC (permalink / raw)
  To: newlib-cvs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 1377 bytes --]

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=e18b7ffa4893aa1011bae52e6e7a8f1bfcc336d5

commit e18b7ffa4893aa1011bae52e6e7a8f1bfcc336d5
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Mon Sep 4 10:52:33 2017 +0200

    stdio.h: Don't define unlocked macros using static inline on C++
    
    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 <corinna@vinschen.de>

Diff:
---
 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 331a1cf..ee0f612 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 */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-09-04  8:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-04  8:54 [newlib-cygwin] stdio.h: Don't define unlocked macros using static inline on C++ Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).