Skip to content

Commit

Permalink
Parenthesize function names in masking macros for getc() etc. for the
Browse files Browse the repository at this point in the history
benefit of obsolete C preprocessors.
  • Loading branch information
Tim J. Robbins authored and Tim J. Robbins committed Mar 20, 2004
1 parent 33a2fec commit 257982e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions include/stdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,16 +418,16 @@ static __inline int __sputc(int _c, FILE *_p) {

extern int __isthreaded;

#define feof(p) (!__isthreaded ? __sfeof(p) : feof(p))
#define ferror(p) (!__isthreaded ? __sferror(p) : ferror(p))
#define clearerr(p) (!__isthreaded ? __sclearerr(p) : clearerr(p))
#define feof(p) (!__isthreaded ? __sfeof(p) : (feof)(p))
#define ferror(p) (!__isthreaded ? __sferror(p) : (ferror)(p))
#define clearerr(p) (!__isthreaded ? __sclearerr(p) : (clearerr)(p))

#if __POSIX_VISIBLE
#define fileno(p) (!__isthreaded ? __sfileno(p) : fileno(p))
#define fileno(p) (!__isthreaded ? __sfileno(p) : (fileno)(p))
#endif

#define getc(fp) (!__isthreaded ? __sgetc(fp) : getc(fp))
#define putc(x, fp) (!__isthreaded ? __sputc(x, fp) : putc(x, fp))
#define getc(fp) (!__isthreaded ? __sgetc(fp) : (getc)(fp))
#define putc(x, fp) (!__isthreaded ? __sputc(x, fp) : (putc)(x, fp))

#define getchar() getc(stdin)
#define putchar(x) putc(x, stdout)
Expand Down

0 comments on commit 257982e

Please sign in to comment.