Include prototypes for standard library functions that are also defined as macros.

This is needed to ensure correct behavior in cases where the macro is bypassed to access the library function, e.g. by enclosing the function name in parentheses or by taking its address.
This commit is contained in:
Stephen Heumann 2017-11-12 23:27:15 -06:00
parent 10c9e70f85
commit dedd50c81e
2 changed files with 30 additions and 0 deletions

View File

@ -28,6 +28,33 @@ extern char __ctype[],__ctype2[];
#define __csymf 0x02
#define __octal 0x04
int isalnum(int);
int isalpha(int);
#ifndef __KeepNamespacePure__
int isascii(int);
#endif
int iscntrl(int);
#ifndef __KeepNamespacePure__
int iscsym(int);
int iscsymf(int);
#endif
int isdigit(int);
int isgraph(int);
int islower(int);
#ifndef __KeepNamespacePure__
int isodigit(int);
#endif
int isprint(int);
int ispunct(int);
int isspace(int);
int isupper(int);
int isxdigit(int);
#ifndef __KeepNamespacePure__
int toascii(int);
#endif
#define isalnum(c) ((__ctype)[(c)+1] & (__upper|__lower|__digit))
#define isalpha(c) ((__ctype)[(c)+1] & (__upper|__lower))
#ifndef __KeepNamespacePure__

View File

@ -103,6 +103,9 @@ typedef long fpos_t;
* Functions declared as macros
*/
void setbuf(FILE *, char *);
void rewind(FILE *);
#define setbuf(stream,buf) ((buf==NULL) ? (void) __setvbuf(stream,NULL,_IONBF,0l) : (void) __setvbuf(stream,buf,_IOFBF,(size_t) BUFSIZ))
#define rewind(stream) (__fseek((stream),0L,SEEK_SET))