mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-21 00:07:36 +08:00
Use __sputc_r inline code when building with gcc
Per the preceeding comment this inline code is disabled since 1993(!) because of a bug in GCC at the time. This is long gone and the equivalent inline code is used in the BSDs for quite some time. Enable this code for newlib as well. * libc/include/stdio.h (__sputc_r): Enable GCC inline code. Add handling for targets defining __SCLE. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
fcd8a0d4f4
commit
6b97fabf1b
@ -651,10 +651,12 @@ _ELIDABLE_INLINE int __sgetc_r(struct _reent *__ptr, FILE *__p)
|
||||
#define __sgetc_r(__ptr, __p) __sgetc_raw_r(__ptr, __p)
|
||||
#endif
|
||||
|
||||
#ifdef _never /* __GNUC__ */
|
||||
/* If this inline is actually used, then systems using coff debugging
|
||||
info get hopelessly confused. 21sept93 rich@cygnus.com. */
|
||||
#ifdef __GNUC__
|
||||
_ELIDABLE_INLINE int __sputc_r(struct _reent *_ptr, int _c, FILE *_p) {
|
||||
#ifdef __SCLE
|
||||
if ((_p->_flags & __SCLE) && _c == '\n')
|
||||
__sputc_r (_ptr, '\r', _p);
|
||||
#endif
|
||||
if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
|
||||
return (*_p->_p++ = _c);
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user