Changeset 3712 for trunk


Ignore:
Timestamp:
Mar 17, 2011, 6:00:34 PM (14 years ago)
Author:
bird
Message:

stdio.h,features.h: Don't use gcc's 'extern inline' feature with 4.3.0 and later.

Location:
trunk/libc/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libc/include/features.h

    r2288 r3712  
    368368
    369369/* Decide whether we can define 'extern inline' functions in headers.  */
    370 #if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
     370#if __GNUC_PREREQ (2, 7) && !__GNUC_PREREQ (4, 3) && defined __OPTIMIZE__ \
    371371    && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__
    372372# define __USE_EXTERN_INLINES   1
  • trunk/libc/include/stdio.h

    r2776 r3712  
    465465#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++))
    466466#if defined(__GNUC__) && defined(__STDC__)
    467 static __inline int __sputc(int _c, FILE *_p) {
     467static __inline__ int __sputc(int _c, FILE *_p) {
    468468        if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
    469469                return (*_p->_p++ = _c);
     
    527527int _rmtmp (void);
    528528
    529 extern __inline__ int feof (FILE *_s)
     529#include <features.h>
     530#ifdef __USE_EXTERN_INLINES
     531
     532static __inline__ int feof (FILE *_s)
    530533{
    531534  return (_s->_flags & _IOEOF ? 1 : 0);
    532535}
    533536
    534 extern __inline__ int ferror (FILE *_s)
     537static __inline__ int ferror (FILE *_s)
    535538{
    536539  return (_s->_flags & _IOERR ? 1 : 0);
    537540}
    538541
    539 extern __inline__ int getchar (void) { return getc (stdin); }
    540 extern __inline__ int putchar (int _c) { return putc (_c, stdout); }
     542static __inline__ int getchar (void) { return getc (stdin); }
     543static __inline__ int putchar (int _c) { return putc (_c, stdout); }
     544
     545#endif /* __USE_EXTERN_INLINES */
    541546
    542547#if !defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE) || defined(__USE_EMX)
Note: See TracChangeset for help on using the changeset viewer.